« first day (1652 days earlier)      last day (3290 days later) » 

10:00 PM
like, that answer is really "I've no idea what I'm talking about, but some random dudes on the Internets think this is what is going on so I'm writing it all in bold just in case it's correct"
 
I've written a lot of Pimpls with boost::scoped_ptr.
 
also it's Lounge<C++>, not Lounge(C++)
 
@AndyProwl I couldn't put Lounge<C++>
How do I escape it? < >
 
@AndyProwl he meant it like: Lounge (the C++ one)
i think
 
@Cinch back-ticks
 
10:02 PM
or maybe he's been using D for a while
 
LoungeC∑∑
 
@AndyProwl k done
 
Longue<SeePlasPlas>
 
Lounge<Rust*=2 >
 
@Cinch good
 
10:03 PM
@AndyProwl Wait but is it a bad answer or wrong?
I'm just trying to do administrative answers or edits here
 
@Cinch I don't know. It's a funny one. To me it sounds like you can't answer the question but really really desperately want to
 
@AndyProwl Because I'm at 496 rep now, that's why.
 
@Cinch That's not a good motivation. Pick questions you can answer. This said, I'd like to point out that I'm drunk, so you don't really have to listen to me
 
@AndyProwl lol that's cute
 
yeah
 
10:05 PM
> co-routines (finally, again for the first time since 1990)
^ Good. Bjarne is on board with the coroutines.
 
co-poutine
 
Also I don't get how or why co routines are so nice
 
Etienne would support them
 
They're not even really multi-threaded
 
> • transactional memory
^ Silence
He doesn't want to hurt Boehm.
I heard STM is not without contention points. (from Mark Thomson interview)
This kills the STM.
It's probably not that bad :P
default comparisons seems like a really nice addition
> uniform call syntax
^ I can't believe they will ever do this.
 
10:09 PM
I like the default comparisons thing
 
I feel really strongly that I should try and do a chinese-accent reading of this question: stackoverflow.com/questions/29870976/…
 
> operator dot (to finally get proxies and smart references)
^ wow
 
wot
they're not doing that are they
 
It doesn't even look like a joke.
 
What is STM?
 
10:10 PM
I want modules
 
Damn.
 
I want to press the "compile" button and not wait for a super-long time till it's done
@StackedCrooked lol
 
URL is too long.
 
@StackedCrooked rotfl
 
@StackedCrooked thanks, i haxored ur campooter
 
@StackedCrooked default comparisons?
 
operator== generated by compiler
At least that's what I thought it meant.
 
Xeo
whoo
back
 
> Bad Committee habits to avoid: make something a library because that's easier to get accepted in the committee than a language feature (even if there is good argument that what is provided is fundamental)
I so much agree with this
 
so
 
10:14 PM
@StackedCrooked Yep
 
saw Age of Ultron today.
was pretty fun I think
 
user1804599
PureScript is great.
 
Damn it: google.com/…
 
So Google Ultron got starred in a movie, nice.
 
@milleniumbug Which movie?
 
10:21 PM
@Nooble It's a joke, see Puppy's comment.
 
@milleniumbug ...such joke wow
 
@Cinch software transactional memory.
 
@JerryCoffin is this something like pipes?
 
STM comes after STL.
 
hi
 
10:26 PM
@jalf hi
 
@Cinch No, not really. It's basically taking things you do with memory, and wrapping them up in database-like transactions so the rest of the world sees them as happening atomically.
@jalf Hello.
 
@JerryCoffin ...
so atomic databasing ops
 
@Cinch Without the database though. Being able to make arbitrary C++ expressions atomic, basically
 
@milleniumbug Oh :P
 
Effective Modern C++ is amazing. It's contents is 100% relevant for the working developer.
That's a rare thing.
 
10:29 PM
@jalf ...
@StackedCrooked how much
 
@Cinch Semi-sort of. The idea is to provide an easier way of dealing with multithreading than locks, mutexes, etc.
 
@JerryCoffin Oh I see
So make operations implicitly atomic
I guess that's interesting
 
@Cinch Not necessarily implicitly. But allow the programmer to specify for a series of operations (preferably in plain C++ source) that "these should be executed as a single atomic operation, so other threats see all or none of it
 
STM is kinda like svn commit but faster.
That should be accurate.
 
@jalf so creating the ability to mark operations as atomic
 
10:31 PM
@StackedCrooked Accurate, but only helpful for people who know svn reasonably well.
 
yep
 
like atomic int add(int x, int y) {return x + y}
 
Yeah, but more complex stuff too
an atomic std::sort, say.
 
atomic virtual const std::vector<<std::vector<int>> add(const int x, const int y) noexcept override const {}
what a mess
 
@Cinch Yes, but for more complex things (you can already create an std::atomic<int> and have operations on it happen atomically).
 
10:33 PM
@Cinch lacks constexpr (ew, virtual; in that case, lakce override)
 
@sehe shouldn't constexpr be non-atomic?
 
Is @R.MartinhoFernandes around? James told me that they've fixed the limitations on string literal lengths in VC2015 :)
 
@Cinch ? you tell me
 
@sehe constexpr should be able to computed at compile-time so yes
 
The idea in TM is that the programmer gets to specify what should be executed as a single (atomic) transaction, so you decide. You want it to be atomic, you say so in the source code
 
10:34 PM
@Cinch not necessarily. so; also that makes it eminently atomic IYAM
 
Bah I wonder if a register-based language would do better
 
better at what?
(also what's a register-based language?)
 
Concurrency management
@jalf Instead of stacks we have a heap of threads/fibers with registers
 
stacks vs registers has nothing to say about concurrency.
they're both completely thread-local storage.
 
@Puppy Each thread will have a header register
It will store input, output, concurrency, and exception infromation
 
10:36 PM
@Cinch and what when you run out of registers?
 
what on earth would be the point of that?
 
C++ doesn't say anything about a stack. The stack is an implementation detail
 
pretty much that.
 
@Puppy It will wrap all status information in a nice pollable interface
 
(inb4 some smartass mentions std::stack)
 
10:37 PM
This would be RL, not C++
 
@Cinch That does not explain what the point is.
 
RL = Register Language
 
why would some random function f() give a shit about any of those things?
it should, in fact, quite explicitly not give a shit about any of them.
 
@Puppy Because it's a much cleaner interface in my opinion
For example, say we split functions into processes and functions
 
@Cinch Cleaner than what?
 
10:38 PM
cleaner interfaces offer less information, not more.
 
@jalf There are better examples like stack unwinding.
 
@jalf C++
For example, say we have a reader-writer thread pairing
 
there's lots of things that are terrible about C++, and the stack model is not one of them.
@Cinch Then you're a moron.
 
Say that we need to split information among different output files
Say we have 5 different output files and we read in a single line from a database with 5 entries
 
people don't write code so that a particular thread performs a particular task, unless they basically have to because the OS was designed that way.
 
10:40 PM
Ugh I'm trying to come up with an example
 
:)
 
One example is that of event handling
 
and that pretty much only applies to hardcore OS stuff like GUI input events or 3D rendering.
and even then a good interface would hide that detail if physically possible.
 
If we have fibers trying to keep track of, say, I/O pins we can have each thread modify its header when it receives an event
 
right, except I completely do not want it to do that at all.
 
10:41 PM
We can then hook up event handling fibers up to the event-receiving fibers and then have them fire based on the register
Even better if there is something wrong we can notice that from the error part of the header
And if we need more concurrency, we can use the concurrency part to coordiante that
 
you're just making the user do a whole bunch of pointless busywork to write f().
 
@Cinch I don't see what any of that has to do with registers. C++ (and other mainstream languages) have these cool things called variables, you know. You can make them contain anything you like, including the information that would otherwise be in your registers ;)
 
and introducing a bunch of global mutable state, effectively.
 
@jalf The point is that there'd be a unified standard interface for all of this instead of having different schemes
 
which is well-known to be the worst thing you could possibly do in practically any situation.
@Cinch Which is absolutely not what you want.
those different schemes arise for a reason, and it's because the users have different needs.
 
10:42 PM
@Puppy Wouldn't be mutable
 
> we can have each thread modify its header when it receives an event
I fail to see how this can occur without mutation.
 
@Puppy The thread owns its own header
The outside threads are read-only
 
that does not make it not mutable.
 
Just write a C++ library that does this. Problem solved. :)
 
Xeo
@rightfold I'll just stay out of this one. I've expressed my opinion enough times already, and it hasn't changed in the slightest. (fuck function_traits)
 
10:44 PM
@jalf I wanted to make a language or VM that does this instead
 
besides
 
@Cinch You don't need to.
 
I already have a unified standard interface that can do all of this.
it's called C++.
the most flexible thing in the world is int main() { }, you can turn it into literally any C++ program you want.
completely uniform interface.
just insert code here.
 
@Puppy The problem with C++ is it's complexity, not its versatility
Many people shy away from C++ because it's too wide and too specific in many cases
 
@Cinch That's true, but the problematic complexity does not occur in any of the things that you would change.
it occurs in stuff like dumb syntactic decisions, arbitrary primitive/UDT separation, poor understanding of the implications of RAII, failure to properly handle rvalues early in the language, etc.
 
10:45 PM
@Puppy We have 3.5 languages within C++. C, C++03, assembly, C++11 being the 0.5
 
none of those issues are on the list of things you're changing.
 
@Cinch That's a very different problem from.... whatever you're trying to solve with the register thing (by the way I still don't see how it relates to registers)
@Cinch No, we have C++
 
instead you're trying to fix one of the very few things that is definitely not broken about C++.
 
@jalf We use registers as an alternative abstraction to stacks
 
@Puppy Though, theoretically speaking, main isn't even necessary in C++. You could just define objects, and "running the program" would consist solely of creating, then destroying those objects.
 
10:46 PM
@Cinch But the C++ language does not have stacks
 
@JerryCoffin Arguably true. You could do something like class Program { Program() { /* stuff */ } }; Program p;.
 
@jalf Scope stacks?
 
How can you replace something that doesn't exist?
@Cinch Go ahead and look through the C++ standards. You won't find any mention of scope stacks at all
 
@jalf Each local scope has its own "stacked scope" per say
int main()
 
You will find talk of variables, and objects, and values, and scopes, sure. Nothing says it has to be implemented as a stack
 
10:47 PM
lots of stack values are reduced to registers.
 
So I wouldn't be able to declare arbitrary variables in this new language then? I'd just have to use a fixed set of registers?
 
and plenty of scopes don't take up stack space, like TCO.
 
@jalf ...though in fairness, it does mandate stack-like (LIFO) behavior.
 
@JerryCoffin Yeah, sure :)
 
@JerryCoffin That's what I mean
 
10:48 PM
@Cinch So instead you want every variable to... what? Be global and live forever?
 
And you only get three.
 
@JerryCoffin Which is pretty much mandatory, really. The only alternative would be to simply not permit function calls.
 
@jalf No, we'd create each local scope but structure it in a way that we can throw the reference to the scope around should we desire to
 
@StackedCrooked What distro are you running on coliru btrw
 
@Cinch ... you'll have to write up an example of that, I think. :p
 
10:49 PM
That way we can recover the failed state of a thrown-exception function
 
why the fuck would you want to do that.
the state is broken and useless.
you can't recover it just by literally accessing the values in memory.
 
@Puppy No, it can be helpful for error handling
 
you'd have to fix the actual bad values that led to the exception.
which is not possible.
@Cinch No, that's a debugger.
 
@Puppy For example, say we have a division function that takes a matrix of numbers and divides them by a divisor
 
@Cinch Ok, I'm kind of confused. This seems entirely unrelated from all the problems you said you wanted this language to solve 10 minutes ago
 
10:51 PM
@jalf I want it to solve many things
 
First it was about concurrency, then it was about removing complexity, and now it's about error handling?
 
Using a different paradigm
 
Hey, I've got an idea
you should join forces with @Puppy on Wide! :D
 
Pull requests welcome!
 
I keep saying that to everybody who wants to make a new language.
 
10:51 PM
/ducks
 
@jalf The point was for me to try experimenting with a different paradigm and see what happened
 
but it seems that I'm the only one with a decent idea for where to go from C++.
 
Say we have a matrix and a function that needs to be divided by set divisors
 
@Puppy ...... right
 
... or any skill in writing a compiler.
 
10:52 PM
We iterate linearly through the matrix and then... oops a divide by 0 exception!
 
it's not an exception.
 
Sorry, I'll go get some sleep
 
it's a processor trap.
 
-2
Q: The difference of I/O between C and C++

coderhttps://github.com/joywang1994/question2/blob/master/test.cpp This is my code. But it has a warning for fopen. I know I can turn it off but I want to use other method to avoid the error. fopen_s or ofstream something like that. I am a C programmer so I am not very good at C++ So could you tell m...

 
it means that there's a bug in your program.
 
10:52 PM
@Cinch It sounds to me like you're trying to re-invent call with continuation (probably without realizing it, but it looks to me like that's where this ends up).
 
it's not to be fixed-up at runtime, it's to be fixed by the programmer so that it doesn't occur.
 
@JerryCoffin Or conditions.
 
@JerryCoffin Perhaps. But we can have an entirely different thread do error handling if we can coordinate it with exceptions
 
@Cinch Right, except nobody would want that because the current thread has to do something when encountering an error.
 
Once the failed thread displays its error state, an error-handling thread can take over
 
10:53 PM
@Cinch that said, go ahead and play with it! You can learn a lot from trying to create a new language
 
@Puppy But what if it's outside of our scope?
 
@Cinch Who cares? That's what exception propagation is for.
 
Say a thread is designed to do only math. Another thread handles I/O. The input is wrong. What to do?
 
Just look at @Puppy. As much as we like to mock his efforts with Wide, he's definitely gotten a lot out of it
 
@Puppy Yes, but exception handling can only up the chain of execution. Why not have it thrown sideways if needed?
 
10:54 PM
@Cinch What to do is fix your design so that your threads aren't separated in such silly ways.
and then if your input is wrong, terminate all the operation.
 
@Puppy We can simply just reject it and ask the user to try again, ya know...
 
@Cinch That requires terminating the current operation.
since you're terminating processing of the current input and then getting a new input.
 
@Puppy Or we can simply leave the operation state intact and resume once they fix it
 
you're going to ask your user to start fixing random shit in memory?
that's crazy.
 
@Cinch First and foremost, realize that bad input from a user is sufficiently common that it should almost never be handled via exception handling (or anything similar).
 
10:56 PM
@Puppy It's not random shit, man
 
@Cinch If the operation state led to a divide by zero, then it is hardly intact, though. :)
 
@JerryCoffin But this exception handling scheme would not be throwing anything
It would simply flip a few flags, then stop
 
@Cinch The only way to realistically propagate a change in input is to terminate and re-start the operation. Otherwise, you would have to find every place that depended on that value and update it- manually.
 
@Cinch Doesn't matter. Bad input from a user is not an exception. It's expected (or damned well should be, anyway).
 
@JerryCoffin Exceptions are perfectly fine for expected outcomes.
"exceptions for exceptional situations" is a silly catchphrase with no basis in reality.
 
10:59 PM
@Columbo Ubuntu 12.04.5 LTS
..apparently
 
exceptions are for all process-recoverable failures (assuming that you don't need something niche like IPC communication of failures)
 
Say we are in a distributed computing environment. We need to do floating point
calculation, and we get input from a data file. Say that we need to continuously
get input from a remote source (i.e. a client app).

Say that we then get a disconnect exception. What to do?
In C++, our error-handling must be handled by a wrapping structure to handle
the error since all exceptions or errors must return to the main line of operation
it came from.

But, in RL, we can instead just have a thread wait for an exception flag on the
 

« first day (1652 days earlier)      last day (3290 days later) »