« first day (2202 days earlier)      last day (2741 days later) » 

9:15 PM
Guis guis. Look at this!
Announcing the Lounge Track http://meetingcpp.com/index.php/newsreader/items/announcing-the-lounge-track.html #cpp #cplusplus
 
user1804599
They should call it "Lounge<C++>", that would be a great pun!
 
That's not what a pun is. It's a pointe
 
user1804599
*C is the pointee. C++ is out of bounds.
 
user1804599
This song.
 
9:19 PM
@sehe repost, but I'd say it's fine
 
@sehe You're one day late to the party :p
 
can't have enough lounges
 
@Morwenn I /did/ search but didn't see it mentioned
Also, people massively failed to star it
3
 
I've got to admit, I don't see the cost of using const& to consume rvalues. What am I missing?
 
Sadness much many sads.
 
9:22 PM
@sehe gotta fix that mistake
 
@milleniumbug I'd star the one above (not "just-hyperlink")
 
lagged news bear :'(
 
@caps The assembly
 
I fail to find the context for "Ban the doofus" is it deleted?
 
@sehe There's a difference in the assembly even though the function calls are the same?
 
9:23 PM
Which function calls
 
---BEGIN BLOCK---	rvalue by const&	---
default constructor	id: 3
printing		id: 3
destructor		id: 3	moved_from: false
---END BLOCK---		rvalue by const&	---


---BEGIN BLOCK---	lvalue by const&	---
default constructor	id: 4
printing		id: 4
destructor		id: 4	moved_from: false
---END BLOCK---		lvalue by const&	---

---BEGIN BLOCK---	rvalue from function call by const&	---
default constructor	id: 6
printing		id: 6
destructor		id: 6	moved_from: false
---END BLOCK---		rvalue from function call by const&	---
A default constructor and no copy constructor or move constructor.
 
@caps what's your question
 
@caps What kinda printout is that?
 
seems you have a wrong assumption, but I can't see which one
 
@caps It's not always a problem, of course. It's only a problem due to aliasing (references...!) and/or missed opportunity for moves (e.g. "sinking" values from arguments or returning them)
 
9:26 PM
@milleniumbug Why do people say that there is a performance hit for taking an rvalue by const&?
 
@CaptainGiraffe Random line noise, IYAM
@caps Read my message
 
@CaptainGiraffe What do you mean?
 
@caps they're wrong, or you've misinterpreted what they had said
 
@caps What produced that output?
 
@CaptainGiraffe The coliru I just linked: coliru.stacked-crooked.com/a/ebe6c9229fe97ff3
@milleniumbug What might they have said that I would misinterpret it to get that impression?
 
9:28 PM
@caps Also, your "noisy" is so trivial, the compiler sees right through everything of it and probably "destructures" the class at all. I doubt there will even be "an instance of Noisy" - it might just be a few en-registered member values
 
sehe is onto something here again. Hmm.
I have a more serious conundrum at hand.
A person I care about has started to use C where c++ would be a good fit. The initial response I got was "I kinda like it"
"C doesn't have std::map" was a concern.
 
user1804599
He should use Rust
 
How do I get this person to see the light?
 
user1804599
Show him Rust.
 
@rightfold I've already shown him several literal programs in haskell.
 
user1804599
9:33 PM
Nice. :)
 
@CaptainGiraffe It's ok to "kinda like it" for its niche.
@CaptainGiraffe What's the risk if it takes a while for him/her to see the light?
 
user1804599
Twitter suggests I follow someone, but that person is plonked.
 
user1804599
Goodware.
 
user1804599
Very good software.
 
user1804599
btw @sehe I found a ƒ50 bill today :D
 
9:35 PM
@sehe None, but the C kinda startled me. I became afraid. We have already discussed type systems.
 
@rightfold Wow.
 
user1804599
Nice MediaWiki flower on it.
 
@CaptainGiraffe C has a type system. Just a very limited/semi-flawed one
@rightfold Lies
 
@sehe The type system in C is like the democracy in Russia.
12
 
See. Many people kinda like it
 
user1804599
9:37 PM
C is bad for gay people.
 
user1804599
I like my types value-dependent.
 
C is to type systems what theology is to physics
 
user1804599
C has a better type system than Python.
 
:33721030 The solution is simple. Stop it with the clever comebacks :)
 
@caps who knows I wasn't there
 
9:39 PM
@sehe The theory is simple, the implementation is NP.
 
No Problem
@CaptainGiraffe How is it relevant that you "already discussed type systems". (Have you already discussed Krav Maga?) What is the task? If the task is to propagate port values on hardware interrupts, maybe C is the best choice.
 
@sehe The current problem is to translate a grammar to a parser.
 
@CaptainGiraffe The slope is slippery, but given the right parser generator C might do nicely
 
@sehe We have not discussed Krav Maga, we have however discussed Drinking cold beer in a 96*C sauna.
 
9:44 PM
(Arguably, it's using protheses)
@CaptainGiraffe Wait. Please disambiguate
 
@sehe The dude doesn't want a parser generator. I quote "That's cheating"
 
It is. But it's the only sane way. You can quote me on that.
 
@sehe That was my response as well.
 
Otherwise, just let him post the result on [CR] and we'll rip it to shreds :)
 
9:46 PM
If he hand-rolls a parser, I'd be surprised if I cannot make things crash at some input
 
Now, so I had to throw the dude some code, so I wrote a simple lexer with a parser in c++.
 
user1804599
With sufficient abstraction, a parser "generator" is just a function that returns a parser.
 
user1804599
And functions and abstractions are good.
 
user1804599
So fucking uuuuse them.
 
A print function, variables, if statements. Now dude tries to replicate it in C.
 
user1804599
9:49 PM
oh lol C XD
 
user1804599
hahaha RIP
 
The dude is new to C. I see stuff like void* f(){ struct s {} d; return &d;}
 
@sehe How could I write a better struct?
@sehe I get the argument in the case of sink values--e.g. in a constructor that takes std::string, take them by value and move them into the members. That makes sense to me.
@CaptainGiraffe Ouch.
 
glad to see the recent civilization 6 patch fixed the english leader abilities https://t.co/un22ccREQj
@R.MartinhoFernandes
 
@caps You can't. You should write a realistic piece of code that reflects what you want to know. And then, probably, use a proper micro benchmarking tool and/or inspect the assembly
@CaptainGiraffe Wow. That's. Good use of void* I guess :)
@CaptainGiraffe Just let him struggle if he wants. He'll hit the brick wall sooner rather than later.
 
9:57 PM
@sehe The dangling pointer was never a worry.
 
Not in this context.
It's a complete useless thing anyways. No one is gonna (usefully) dereference the empty struct.
 
The struct was non-empty of course.
 
Oh well. I see your point. His¹ code is gonna suck. And you can just sip your whiskey until he¹ knows it.
¹ Or she
 
I' cracking open the MacAllan
 
Patience is good in teaching. It's good to prepare the open mind. Sometimes you have to wait for the mentee to become in the right state of mind to be mentored.
 
10:01 PM
It's a dude. A really clever dude. But the dude is running ahead on cool stuff and not reading up on the fundamentals.
 
Also, I encourage people following (and testing) their own judgement
I've wasted E_NORMOUS amounts of time learning things backwards myself.
 
@sehe Fair enough. I'm just trying to understand this guideline.
And I don't feel like I do.
 
Ven
@sehe you mean her. Or their. :P
 
@caps Did you read my response? Was there anything you /do not/ understand there?
@Ven Indeed I do
 
Ven
Untrollingly though, the "state of mind" part rings a bell. Some people just don't want / can't learn at some specific moments
 
10:04 PM
People have to reach humility. This ALSO goes for the teachers
 
@sehe I'm pretty sure I started to learn English from a 8086 assembly manual.
 
Ven
Much more important for the teacher, even. Accepting to be taught stuff surely is a form of humility
 
40 mins ago, by sehe
@caps It's not always a problem, of course. It's only a problem due to aliasing (references...!) and/or missed opportunity for moves (e.g. "sinking" values from arguments or returning them)
In case you missed it (I just found it back, sorry for multitasking)
Also, consider just asking on SO (or finding the dupe yourself)
Also, I heartily recommend this answer:
10
A: How true is "Want Speed? Pass by value"

cdmhThere are no general rules for optmization. Pass-by-value can give some big wins in C++11 with move semantics, alongside copy elision. If you really want speed, Profile your code.

 
The same questioner also thinks a "language" is faster than another language. That was true 1992? 1995?
 
Depends solely on the code written in it. And the task at hand. And the environment. And the grace of the Olympians. Basically, it depends.
@caps Don't forget things compound (a lot) through template instantiations and aggressive inlining. I'd expect especially the aliasing guarantees to help compilers a lot there. Even more so if const folding is applicable.
Basically. Compilers are mighty beasts, but they thrive on pure, honest, food ("source") with high nutrients and low fat.
 
user1804599
10:15 PM
Purity is the most amazing guarantee you can give a compiler.
 
And they'll love you back
 
you and compiler will then produce a product of love
 
@caps this article by Andrew Koenig has a good sample of how aliasing matters when passing by const& drdobbs.com/cpp/optimization-calling-by-value-or-by-refe/…
I personally think the argument that passing by const& is premature optimization, and passing by value expresses intent is the best generic argument:
> But that's the problem: Regardless of what the programmer might have intended, what the programmer wrote is crystal clear. A programmer who intended to use the same value for v[0] each time through the loop would have defined x as double rather than as const double&.
The moment one defines a reference, one admits the possibility that that reference might refer to an object that might have different values at different times. (from [Some Subtleties Of Aliasing](http://www.drdobbs.com/cpp/some-subtleties-of-aliasing/240154618) )
I'd urge anyone to simply write obviously-correct code without hidden assumptions. Only start complicating/optimizing when needed/desired.
@caps I'm leaving for today. I hope I have startled you a bit into understanding it :)
 
Is there a standard way of describing "aggregate exceptions"?
Like, an exception that wraps a list of exceptions?
 
10:29 PM
Nope. Unless you think "Design Patterns" are standard. In which case, yes: Composite Pattern
I was gonna joke about this. But let's just let the observation stand at its own #STEM #DiversityInTech https://twitter.com/hadip/status/790983415088558080
 
I mean do I have to roll my own class
 
Gah. s/at/on/
@EtiennedeMartel Pretty sure Boost hath it
 
This project has a non-Boost policy.
So.
I'll have to roll my own.
 
Boost is proposing a library for stack traces too
@EtiennedeMartel Nothing too complicated. However, I do detect a code smell. Error handling != logging/tracing/auditing.
 
@sehe What the hell is this platform that allows this idiocy stand unrefuted?
 
10:32 PM
You mean, I'm doing Twitter wrong? FTR I was gonna joke, not to refute it.
But I realized my joke would probably not be accurate and simply distract from the observation.
 
I'm not used to twitter so I trust you are doing it right =)
 
@Morwenn was-asan-fixed?
 
@набиячлэвэли Nope.
Apparently it's fixed in the Ubuntu package for GCC 6.2.
 
But I'm kinda curious why the replies aren't "You're a fucking moron", It would fit into the 140 char limit.
 
it would be sad if u r cursing people online, but the sentence gets truncated because of the buffer length limit
 
10:38 PM
@CaptainGiraffe Sometimes, people don't notice smart things being said
@Telkitty There is an astounding irony in your abuse of English in that, unrationed, chat message
 
@sehe I believe you on aliasing, it's just a little hand-wavy to me. I can accept that it's true, but I can't regurgitate it beyond "because aliasing."
 
why? I am saving bandwidth >_<
 
@sehe Aliasing "guarantees"?
 
I linked you to several on-topic examples to make it not so hand-wavy.
 
@sehe I'll read these.
 
10:40 PM
@caps Copies are guaranteed not to alias.
@Telkitty You're not doing a good job.
 
Is it just me, or is this guy taking the pedantry a little too far?
1
A: Does the C++11 memory model allow hoisting relaxed atomic loads out of loops?

T.C.Forget about relaxed, there's no guarantee that an atomic store ever become visible to an atomic load in a different thread. The best you get is the normative encouragement in [atomics.order]/12 (and analogous wording in [intro.progress]/18): Implementations should make atomic stores visible ...

 
Any developper with much experience?
 
I might as well say that x++ is never guaranteed to finish executing...
 
10:43 PM
@jeremiahkartodimedjo dafuq?
 
Oh hi again, @S_alqsimi , Lorraine in the UK asks, which makes and models please? https://t.co/HWIKCB3RME
Brillant
 
What xD
Im new
 
@Mysticial I find it interesting that you should ask. Because I trust you to know at least the impact of atomics on optimizations
 
@jeremiahkartodimedjo None whatsoever. Try the Java room, maybe
 
10:45 PM
@sehe Obviously passing by value will be faster when you're going to copy the value. Taking by const& makes no sense when you are going to copy. The question is when you are just going to do const, read-only operations to the value.
 
Lol i dont like java
 
@caps If you're doing read-only operations, then const& is probably the way to do things.
 
But i would like to create a game in a team
 
@sehe Wait... how is that relevant?
 
There's more to it than just straight up copying/moving the value. Consider paste.ubuntu.com/23385844
 
10:47 PM
@jeremiahkartodimedjo This is not the time, nor the place.
 
@Mysticial I have summarily scanned that question. Maybe I should read it in full
@jeremiahkartodimedjo Kyrostat died
 
Do you know where i have to be?
 
@Morwenn Depends.
 
@sehe that is a case of constructing from the parameter
 
@jeremiahkartodimedjo Do you know? Are you looking for projects, see github et al.
 
10:48 PM
Can i just join in a project?
 
@LucDanton Yup. But if you spell it that way, it would make the function a function template, no? It can have tangible benefits to not do that
@jeremiahkartodimedjo Of course not. But you can /just/ offer help. Because that's what open source is about
 
Srry if i interrupt u all
 
We probably will let you live IFF you spell properly.
 
@sehe no, it’s spelled just fine
 
@sehe Come to think of it. Now that I've re-read the question. The OP's question isn't that obvious anymore. But still think it's in violation of the spirit of atomic if the compiler did actually hoist it out like that.
 
10:50 PM
well, asymmetry aside but there’s really no helping that
 
I do not prefer open source, i just need a project is a game with secure data encryption
 
@sehe Both of these Koenig pieces are really good. Thanks.
 
But if u can tell me how i can offer help, it would be gracefull
 
@caps It's a shame the magazine went out of print
@jeremiahkartodimedjo Did you ever visit github?
 
Yes, but never joined a project
 
10:52 PM
Surely you've found the issues. From there it's one step up to creating a fork+pull request.
 
Thanks! and may i ask one last thing?
 
Once you do, people will know you and can assess whether they want you on the project team. Don't expect to be accepted in short term. It may take a year of contributing.
 
Are you all experienced c++ developpers?
 
@jeremiahkartodimedjo sol.gfxile.net/dontask.html
 
10:53 PM
8 mins ago, by sehe
@jeremiahkartodimedjo None whatsoever. Try the Java room, maybe
 
But where is this room for?i thought u was kidding
 
You know, I'm going to guess you're really young. But really you should probably figure this out yourself. It's good to rely on your own judgement, and where you don't have it (yet), develop it!
 
Okay i get it, i will just continue programming my own games. i just wanted to experience working in a team
 
Judgement Developers, the Opinion Squad.
 
Anyways, thanks!
 

« first day (2202 days earlier)      last day (2741 days later) »