« first day (675 days earlier)      last day (4291 days later) » 

6:00 PM
@Mehrdad Member pointers have far more problems than simply being a somewhat simplified version of another construct.
 
Man everybody's so serious today
 
@Mehrdad So what? while (condition) statement is equivalent to if (condition) do statement while (condition); and hence technically redundant, but I still like while better.
 
I am completely utterly lost.
 
eh, LINQ is cute, but I don't really feel it's comparable
 
You guys suck.
 
6:00 PM
@DeadMG [<strike>citation</strike>expansion needed]
 
I gave a nice long list of them.
 
@rubenvb uh, thanks...
 
@jalf Does building a LINQ based theorem solver count? I did that once.
 
@DeadMG Yes, but my first input on the appeal to authority was pointing out that your "X sucks" was also an appeal to authority, but with the implication that you were an authority. It is nice to see that you've admitted that you really don't know what you were/are talking about though. :-)
 
@JerryCoffin Right. But it's not actually an appeal to authority.
 
6:01 PM
@DeadMG Ah, I forgot you don't like you reasoning applied to other situations, never mind.
 
@R.MartinhoFernandes hah, nice
 
it can only be an appeal to authority if I say "It sucks because I say it sucks"
simply stating that it sucks is not an appeal to authority
 
Before everyone goes completely bat-shit crazy again, @DeadMG summed his reasons up right here:
16 mins ago, by DeadMG
well, let me see
 
@Mehrdad What are you talking about? printf and fprintf has nothing to do with pointer to members.
 
6:02 PM
@FredOverflow Yeah, that's my point. @DeadMG was saying bind() sucks because you can't use it in any way except for its only intended purpose, which goes against what we both just said.
 
@DeadMG Repeating your previous unsupported claims doesn't qualify as "logic".
 
ok, this is getting boring. If you're going to make boring and pointless arguments in here, please do it elsewhere ;)
 
@DeadMG sigh if you didn't get it then never mind...
 
@Mehrdad No. The point is that pointer to members have such an absurdly restricted purpose that they are effectively worthless.
 
What's wrong with member pointers? They are technically needed for providing higher-level constructs, right?
 
6:03 PM
@DeadMG Yeah, same with printf(), but it's not worthless in C.
 
@FredOverflow No.
 
sbi
@Mehrdad After I made you aware of your mistake, I had a meeting and lunch break immediately afterwards. That amounted to almost four hours, until I came back to my computer and saw the message I had typed, but never sent. Wouldn't four hours in which you didn't react to my comment be enough of that "little waiting" you expected of me? Did it really have to be 8 hours?
And look at my answer: Despite it coming only 10mins after James', and saying, essentially, the same (albeit not as eloquently, I have to give him that), he has 15 times my votes. Some or even all of that might well be due to voters being uncertain due to your comment and downvote.
 
@DeadMG You mean now that we have lambdas? Or even before that?
 
@Mehrdad No. printf is not worthless, it has exactly the same worth as fprintf(stdin, ...), which is not worthless.
 
@sbi link?
 
6:04 PM
@sbi Yeah, because I was asleep... a reasonable wait would've involved multiple situations, not just 1 :\
 
@FredOverflow JON SKEET IS ENGLISH?
 
sbi
@FredOverflow Just follow the references.
 
@Collin What did you think?
 
@FredOverflow Well, if you want to get very technical, it would have been even before that, although the practicality of doing so would have been... unpleasant.
 
@FredOverflow I guess I didn't think anything, but the accent surprised me
 
6:05 PM
@DeadMG Never mind, no point in arguing...
 
@Collin Yep. Works in Cambridge, I think.
 
@DeadMG Actually, I'm pretty sure fprintf(stdin, ...) is pretty well worthless. At the very least, you need to use stdout.
 
@JerryCoffin haha, never noticed that.
 
@sbi Are you gonna sue Mehrdad for rep now?
 
just copied it from his previous statement
 
6:06 PM
LOL whoops, typo.
 
@FredOverflow huh?
 
@Collin I thought Jon Skeet was a pirate, and I was very surprised that he never said RRRRRRRRRR.
 
@JerryCoffin Logically, the appeal to authority fallacy is based upon the presumption that the authority cannot provide justification. Else, every single reference to every single scientific paper, ever, would be an appeal to authority. So would every single legal reference, reference to the Standard, etc.
 
2 mins ago, by sbi
And look at my answer: Despite it coming only 10mins after James', and saying, essentially, the same (albeit not as eloquently, I have to give him that), he has 15 times my votes. Some or even all of that might well be due to voters being uncertain due to your comment and downvote.
 
@FredOverflow Clickfail.
 
sbi
6:07 PM
@FredOverflow No, I won't. I'm not really after anymore nowadays.
 
but referring to the Standard is not an appeal to authority fallacy, because the Standard can provide a good reason why what it says is true: because it's the fuckin' Standard, as it were.
 
@R.MartinhoFernandes Damnit, that seems to happen to me ever more often :(
 
@sbi Anyway, it seems to me like you're kind of overreacting. Like I said, if my goal was to revenge downvote you as you claimed, I would've done it more stealthily, and certainly not commented on the fact that I did so. :P Instead of judging people after 1 instance and getting irritated at the rep you lost, just... chill. Life is good. :) I even deleted my own answer.
 
@DeadMG The fuckin' standard? Do you mean the Kamasutra?
 
Clang: Who the hell are you anyway, giving out orders like this?
ISO 14882: What, are you dense? Are you retarded or something? Who the hell do you think I am? I’m the Goddamn C++ Standard.
2
 
6:09 PM
@Mehrdad He is probably a bit stressed out from fathering and stuff ;)
 
@FredOverflow Hahaha I see
 
@DeadMG Not really. It's probably easiest to think of things in terms of mathematical proofs. In C++, the standard is the set of axioms that define the system under which we're working.
 
The (social) world does not work in terms of math.
 
sbi
@Mehrdad Actually, originally I only posted one tiny message referring to the "incident", and forgot about it afterwards. It was you who had to post several paragraphs defending your position, rather than just saying "nope, no revenge, brainfart of mine, corrected now, I am sorry".
 
@JerryCoffin The exact justification is immaterial. The point is that it can't be an appeal to authority fallacy if the authority provides a justification for it's position, which you could promptly attack/debate/whatever.
 
6:12 PM
I think we are going to need collective lounge therapy very soon :)
 
what, doesn't clang on osx have std::function? :(
 
I mean, I could refer to a scientific paper on A* JPS, but that's not appeal to authority because the paper provides a justification for A* JPS if you check it.
 
sbi
@FredOverflow My therapy will be a retreat to a few rounds of Q3A. :)
 
@sbi Yeah, and you announced your conclusion to everyone in chat, making me look like an idiot when in fact I just made a mistake...
 
@FredOverflow That is potentially NSFW.
 
sbi
6:14 PM
Sigh. I will not answer anymore. And if you don't stop, I'll just plonk you. `k?
 
Why? It's a robot, not a woman.
 
I mean, I would understand if someone looked over my shoulder and gave me shit.
 
sbi
@EtiennedeMartel Potentially?
 
Bin it, please.
 
sbi
1 message moved to bin
 
6:14 PM
@Mehrdad look at the argument going on right now and tell me that "looking like an idiot" in this chat is in any way unusual or something to worry about
4
 
I don't want to have to do some explaining to a coworker.
@sbi Thank you.
 
Anyone know how to get rid of a -Wmissing-field-initializers warning?
 
@jalf touche...
 
@FredOverflow Hmmm.
 
@R.MartinhoFernandes Are you aroused? :)
 
6:16 PM
No.
 
lol
 
@FredOverflow because some people might not want to have to explain to their coworkers/spouse/children/whoever else are around why it is not NSFW... It looks unsafe at a glance -- a glance that many people might want to avoid attracting in the first place
 
sbi
@FredOverflow Yeah, great argument. Let's all paste pix of Japanese tentacle sex comics, because, you know, it's not real women getting raped there, so who could complain looking over our shoulders?
2
 
@rubenvb -Wno-missing-field-initializers?
 
@R.MartinhoFernandes you should wonder about the meaning of his smiley after his sentence
 
6:16 PM
@jalf binning is fine with me, just wanted to share the funny picture, even if it was for just a minute
 
@sbi Maybe that's legitimate rape?
 
@FredOverflow you could just link to it :)
 
@DeadMG Not true -- in a mathematical system (for example) axioms are simply those rules we agree on up-front. There can be (are) many systems with entirely different sets of axioms. Neither is necessarily right or wrong -- they just define different systems.
 
@R.MartinhoFernandes besides that. It seems like a C99 warning, held over in C++11 mode...
 
@sbi OK! Just a sec...
 
6:17 PM
@sbi There are japanese tentacle rape sex comics? Why didn't anybody tell me this before?
 
sbi
@jalf Since (N)SFW is all about the looks, if it doesn't look SFW, it isn't.
 
Why are you guys in the lounge during work, anyway?
 
@JerryCoffin "Because the axiom explicitly states it" is not the only possible justification you can use for your position. There can also be things like "Because I proved it from the axioms".
 
@FredOverflow Why not?
 
hahaha
 
6:18 PM
@FredOverflow Slacking.
2
 
If any time travellers happen to be reading this, could you just pop by 2017 or so and pick up a C++ compiler for me? Hopefully it'll implement more of the language than what we have today
 
Getting paid for chatting doesn't sound like being in the interest of your boss, just saying.
 
sbi
@StackedCrooked Oh, so you're a connoisseur of such things, huh?
 
@FredOverflow because otherwise the room would be dead
 
@jalf You mean, a copy of VS?
 
6:19 PM
@jalf no it would not
 
@R.MartinhoFernandes Über Slacking.
 
@sbi I bet Google is.
 
@FredOverflow Why not? As long as you do your job, what does he care? Is it in his interest if you get up to get a cup of coffee?
 
@jalf Sure, do you want it on GreenRay disc or USC stick?
@jalf I don't drink coffee.
 
@FredOverflow but many people do. My point is that during a normal workday people do a lot of things that aren't "constructive"
 
6:20 PM
sounds like a reason to close ;)
 
ranging from lunch break to drinking coffee to visiting Facebook or chatting here
 
sbi
@FredOverflow If even I have learned about that in the last decade, you can rest assured that there must be very little additional effort the universe could have put into this to raise the possibility that you heard of such things.
 
Stupid ridiculous warning.
 
@R.MartinhoFernandes well, right now I'm complaining about Clang's missing std::function
 
@sbi I'm not really into all that Manga and Anime stuff. I still don't know the difference, by the way.
 
6:20 PM
and MSVC's missing variadic templates, obviously, but that goes without saying
 
It's warning about this line: build_element(const file& source, const file& object = {})
 
Can't you just put Clang and VS in a blender?
 
the single brace isn't enough.
 
@jalf As far as I'm aware, the VS source code is just so sucky, they can't fix it quickly enough :P
 
sbi
@FredOverflow Nor do I. Note how I said "Japanese tentacle sex comics" — that's because I don't know the correct term under which that is published.
 
6:21 PM
@jalf not unusual at all, I do it a lot.
 
@FredOverflow MS could use the Clang frontend and tie it into its own optimizer and stuff.
 
@rubenvb write build_element(const file& source, const file& object = file())
 
Maybe you should update.
 
@FredOverflow Manga and Anime != tentacle rape comics.
 
6:21 PM
are the brackets { } in that line allowed by now?
 
@rubenvb You could put each on a DVD and then put the DVDs in the blender.
 
sbi
@rubenvb Have clang emit C code, as Comeau did.
 
manga and anime are simply styles of comics and animation, respectively, AFAIK.
 
@Papergay yes.
 
it's a format, not a type of content.
 
6:22 PM
yahoo
 
@ecatmur guess that's the cleanest. Stupid it works for other types though.
 
@deadmg you know right
 
some manga/anime will be about boring tentacle rape, but most are probably just as boring as Western comics and animation without tentacle rape
 
@Papergay GCC 4.7 and Clang 3.1 only though.
 
@DeadMG Okay, trusting your expertise here.
 
6:22 PM
@DeadMG AKA, comics and cartoons.
 
yay I have gcc 4.7
 
People like, for some reason, to name them differently because of their geographic origin.
 
@Papergay Always do :P
 
@R.MartinhoFernandes I did. I've tried with the version that comes with xcode (based on something 3.1-ish), as well as the latest one I could get from macports (also 3.1). You'd think that was good enough, no?
 
@DeadMG The only non-boring comics are about tentacle rape?
 
6:23 PM
lol
 
I might be doing something wrong, of course
 
@Collin hmmm....
 
@MooingDuck Bringing back an old comment but I just remembered: there's another reason not to use lambdas, even if you have C++11 -- code size. Every new lambda generates entirely new code, whereas bind() can reuse the same piece of code. If you're calling something like stable_sort, every lambda can create like 10 KB of code (it's happened to me). It's definitely something significant, especially for the Chromium authors, who freak out about every extra 10 KB that doesn't need to be there.
 
@rubenvb it's because there isn't a constructor. You could write const file& object = {{}, {}}
 
6:23 PM
@jalf It does sounds like it.
 
great, now -Weff-c++ is complaining about the member initialization list in the constructor I didn't write.
 
@Collin What exactly is "tentacle rape", anyway? Raping a tentacle? Being raped by a tentacle? Humans raping humans having tentacle features?
 
compiling with -std=c++11 and I've tried with and without -stdlib=libc++
 
@FredOverflow You guys brought it up
 
@jalf what OS?
 
6:24 PM
#include <functional>?
 
@R.MartinhoFernandes actually the only thing that they have in common is that they are printed on paper
 
I know it sounds ridiculous, but...
 
@rubenvb osx
 
@Mehrdad Or you might do something productive instead of focusing on silly things like code size.
 
@jalf oh, that should just work.
 
6:25 PM
@Mehrdad the compiler should take care of that.
 
@CatPlusPlus Pretty much this.
 
@Mehrdad 10kb? What do your lambdas do? And which compiler is this?
 
@ecatmur Well, at this point, it doesn't.
 
@Mehrdad Nobody sane gives a crap about binary size.
 
Dammit accidental delete.
 
6:25 PM
@Mehrdad Could you please stop bringing up valid arguments? I was enjoying the unfounded discussion a lot more.
 
@jalf Uh, it was just [](size_t a, size_t b) { return data[a].foo < data[b].foo; }; the compiler was MSVC 10
 
compared to the size of art assets, it's minimal
 
Sounds like a borken compiler.
 
If Chromium wasn't so fixated on linking everything statically, code size wouldn't matter at all.
 
Tell us its name so we can avoid it in the future.
 
6:26 PM
@DeadMG I do. C++ hello world is 500kb, so C++ is useless to me.
 
@CatPlusPlus I don't see how it matters anyway.
 
But I guess you have to freak out about 10kB if your linking process takes 2 hours and consumes 8GB of RAM.
 
@FredOverflow Meh. Just write your own I/O routine instead of iostream.
 
@DeadMG I think the MSVC linker has trouble outputting static libs larger than 2GB.
 
sbi
Today in Berlin.
 
6:26 PM
@CatPlusPlus You're acting like there would be only 1 lambda in the whole code base.
 
@DeadMG On Linux C++ hello world only 9kb, by the way.
 
@sbi Could be worse.
 
@DeadMG I do when I'm trying to distribute it.
 
@sbi Oops
 
100-so MB executables work as well as 10kB ones.
 
sbi
6:27 PM
@DeadMG Yeah, only 6 injured, and none of them badly, from what I heard.
 
@CatPlusPlus I'm not saying they should (or shouldn't) worry about code size -- that's another discussion. But they do, and lambdas are a mighty easy way to blow up code size significantly.
 
@rubenvb and std::function is supposed to be in <functional>, agreed?
 
yeah, I was thinking that it looks mostly on the tracks
 
Is that a high speed train of some sort?
 
And I'm saying that they're silly.
 
6:28 PM
@jalf Yep.
 
@jalf lol yeah :P
 
@sbi I see a railroad junction. Did someone leave the switch in the "middle" position?
 
And possibly using broken compilers.
 
@Collin does that look like a HST?
 
If you use MSVC for C++11, it's your own damn fault.
 
6:28 PM
@Collin Doesn't look like it. If it was, the train would be in much worse a condition than that.
 
nothing wrong with MSVC for C++11.. as long as it's only a few bits
 
@rubenvb I live in the US.. very few trains for us
 
I guess I just hate boring low level details. vOv
 
@R.MartinhoFernandes MSVC 10. Also realize that every lambda has a different data type, so the linker has to be REALLy clever to merge them (if you know of a compiler that can merge subtly-different lambdas, let me know)
 
@Collin HST looks more streamlined, with the lead in a bullet-shape.
 
6:29 PM
@Mehrdad Visual Studio can merge template instantiations with identical assembly output.
 
I haven't noticed GCC increasing code size significantly when using lambdas.
 
@CatPlusPlus If you say that you'd better have proof that GCC handles this better
 
sbi
@Mysticial They say the switch malfunctioned for some reason. I think the train was meant to switch to a different track, but only the first two cars made it. On the same line there was a lightning stroke on Monday, and they are also investigating whether this could have made the switch fail.
 
@sbi But I would imagine that everybody on that train will enter trains with mixed feelings from now on.
 
6:30 PM
@DeadMG But they aren't identical, only nearly so. The data types are the same, but not everything is.
 
@StackedCrooked Ah, I know what you mean now. Actually, part of my problem is that I wasn't sure if I was looking at the back or the front
perhaps there's no difference
 
@Mehrdad I really don't care if it does. It has better support for the language.
 
@StackedCrooked shinkansen-all-the-things
 
@Mehrdad Then do like std::sort<..., std::function<bool(...)>>(..., lambda);
 
Wait, someone went and flagged stuff in the bin?
 
6:30 PM
@Mehrdad I just made a similar test under MSVC10. The binary size was exactly the same
 
@CatPlusPlus "I don't care" isn't terribly convincing
 
@EtiennedeMartel I know, I lolled.
 
55,808 bytes in both cases
 
What did you test, exactly?
[](size_t a, size_t b) { return data[a].bar < data[b].bar; }
[](size_t a, size_t b) { return data[a].foo < data[b].foo; }
was what I had.
 
@EtiennedeMartel Maybe it was flagged before binning.
 
6:31 PM
in a debug build
 
@sbi Couldn't you design the connection between train wagons in a way that they automatically disconnect when pulled in a non-straight angle or something?
 
sbi
@FredOverflow There were about 50 people, they say. They were all very lucky. Those half a dozen delivered to hospital had contusion, bruises, and (the driver) a shock.
 
@CatPlusPlus Maybe.
 
@sbi I would imagine everybody having a shock. Only the driver?
 
@Mehrdad I have no intention of convincing optimisation freaks about anything.
 
6:31 PM
@Mehrdad well, show me a complete example and I'll try that. But since I didn't know what data, bar and foo were, I couldn't try your example
so I used a lambda which just compared two vectors for equality
 
@Mysticial Branch prediction fail!
2
 
@jalf We should have std::foo and std::bar for these kinds of discussions.
 
@Mehrdad Short lambdas are supposed to be inlined so the type is unlikely to matter here.
 
@jalf I'll try to come up with one, sure. This was when it happened.
 
Woo finally Ghostery for Chrome supports "block new things by default".
 
6:33 PM
@jalf Who cares about the size of debug builds? The bigger, the better, because more data for the debugger to be able to help you!
 
Lol 20kB saved on 5 lambdas.
 
@R.MartinhoFernandes: Er, I don't care if it's unlikely... the fact is that it did happen to me, and the lambda was pretty short. Probably happened because stable_sort calls it a lot.
 
@FredOverflow I assumed that if anything, a debug build would favor the "simple" solution which avoided lambdas
 
@CatPlusPlus does it also block chrome by default?
 
sbi
@FredOverflow maybe. I don't think you'd want that, though, because then you'd have half a runaway train heading nowhere. Also most trains (including the one on the picture) passengers can walk through. In fact, I regularly sit next to, or stand on top of the connection between two cars. You'd condemn everybody to a certain bloody death, when those cars decouple.
 
6:34 PM
Just tried with release builds too. 9216 bytes for both versions
 
@Mehrdad I'm not saying it won't happen. I'm saying that if it happens it's not because of the types being different. They'll be inlined and the type is gone at that point.
 
@R.MartinhoFernandes Ah, ok, sure.
 
@jalf 57,344 for both lambdas.
 
Haha someone downvoted me.
Finally divisible rep.
 
comment one out and I got 54,784 bytes
release mode x64
 
6:35 PM
It's been a long time.
 
sbi
@Collin It's the common city train here in Berlin. I guess when they go fast, they probably go about 60km/h, I doubt they can get faster than 80km/h. ICBWT.
 
@CatPlusPlus Divisible rep? Wait, you were pissed that your rep was a prime?
 
By 5, silly
 
so at most, I'm seeing 2.5KB for such a lambda.
could probably get less if I dynamically linked CRT, but that's kinda pointless.
 
"stopped working" is such a wonderful diagnostic... I'm going to blame it on solar rays traveling back in time from a solar flare scheduled to erupt in 3.7 days. — Marc B 17 secs ago
 
6:37 PM
@CatPlusPlus I'm looking for something to downvote. Got any suggestions?
 
At my job I did some tests using GCC 4.6 to compare speed of lambda captured as template argument and functor (class with operator()) captured as template argument. The fastest was passing the functor as a temporary: e.g. foo(MyFunctor());. Lambdas were significantly slower (20% or so). Perhaps it has improved in GCC 4.7.
 
@sbi Ah okay, that's not the case in Hamburg for the the "intra Hamburg" trains :)
 
sbi
Huh? Who is searching the bin for days old messages to flag them?
 
Of course no comment left, so I don't know if I got something wrong, or is it just an idiot.
 
#include <algorithm>
#include <vector>
struct Foo { int x, y; };
int main()
{
std::vector<Foo> v; v.push_back(Foo());
std::vector<size_t> indices;
for (size_t i = 0; i < v.size(); i++) { indices.push_back(i); }
std::stable_sort(indices.begin(), indices.end(), [&](size_t a, size_t b) { return v[a].x < v[b].x; });
std::stable_sort(indices.begin(), indices.end(), [&](size_t a, size_t b) { return v[a].y < v[b].y; });
}
 
6:38 PM
@sbi By the way, can you bin messages in the bin again? :)
 
@EtiennedeMartel I don't pay attention to anything outside these days.
 
@FredOverflow It's bins all the way down.
 
@Mehrdad Output size?
 
@jalf Take out the second sort, and the size decreases by 2 KB.
 
So, anything outside .
It's all terrible, anyway.
 
6:39 PM
@DeadMG Originally 8K; if you do only one of the sorts, it's 12K; if you do both, it's 14K. (/MD /O2)
 
sbi
@FredOverflow The old S-Bahn trains you can't walk through either. But that train is one of the newer ones, and those contain of segments of 4 cars that you can walk through.
@FredOverflow ??
 
@Mehrdad That's still only 3k/lambda. I only got 2.5k/lambda. Quite far from 10k/lambda.
 
@sbi You know, you can move messages from the Lounge to the bin. Does that also work with messages from the bin? :)
 
@CatPlusPlus I was talking about your stuff.
 
You can't move stuff into the room it is in.
@FredOverflow Binning is not a chat feature. It's what we call to "moving stuff to the bin room".
You can move back and forth though.
 
sbi
6:40 PM
@FredOverflow Yeah, you can move those, too. I think you need admin rights in the source room, and writing permissions in the target room, though.
 
And moving checks for self-assignment? ;)
 
@EtiennedeMartel Well, I said 'anything outside ' didn't I.
 
@DeadMG Yeah, because it's not my original example... that's a pretty large program, and it was using strings, I believe, not ints. 3K is still pretty damn big for such a small difference. bind() barely grows any bigger.
 
hmm, how would you create a std::function type matching a specific function? Something like std::function<decltype(&somefunc)>?
 
@Mehrdad Show bind code.
 
Ell
6:41 PM
@jalf wouldn't that work?
 
@jalf You'd need a remove_pointer in there too.
 
@Mehrdad If you like bind so much, why don't you marry it?
 
@CatPlusPlus I want to downvote one of your posts so that you no longer get rep divisible by 5. Wasn't that obvious?
 
I am just new for gcc working on gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) I am getting error when I am including conio.h please help me?
 
@EtiennedeMartel I really don't care.
 
6:41 PM
conio.h is a windows header, isn't it?
 
It's Borland header.
 
@jalf DOS, I believe.
 
@DeadMG Or just don't apply &?
 
Well, originally at least.
 
@DeadMG close enough :)
 
6:42 PM
@CatPlusPlus Damn, how can I derive pleasure from the pain of others if there is no pain involved?
 
I dont know
 
It's been a library on its own for a long time.
 
@AnujJindal conio.h is not standard. Please burn your book from the 80s, okay?
 
@FredOverflow Dunno if that would work, trewthfully
 
@AnujJindal What are you using conio.h for?
 
6:42 PM
@AnujJindal well, the header is not available on Linux. You'll have to find another one which does what you need :)
 
@AnujJindal I'm guessing you got a course that told you to use conio.h?
 
Also fuck your lambdas. 2012-08-21 20:41 1 112 683 hello.exe
 
for getch()
 
Ell
anyone played slender yet? its freee?
 
@DeadMG or just remove the &, I guess?
 
6:43 PM
@AnujJindal Who told you about conio.h? A tutorial? A book? A teacher?
 
hmm, that works
under clang, at least
 
1 min ago, by FredOverflow
@DeadMG Or just don't apply &?
@jalf Why wouldn't it work?
 
@FredOverflow dunno, I just wasn't sure what the correct way to do it was :)
 
btw
 
Ell
6:44 PM
lololol
 
Fred
didn't you say that C++'s "Hello, World" was 500kb?
 
@LuchianGrigore null-terminate my what? Is that part of the joke?
 
My hello world is bigger.
 
@DeadMG With MinGW under Windows, yes. With VS it's just a couple of kb.
 
@FredOverflow He accidentally a word.
 
6:44 PM
crap
 
@FredOverflow Ah, with mingw. Hence my confuzzlement.
@R.MartinhoFernandes ALL THE MEMES in one picture.
 
 
@CatPlusPlus What's that?
 
main = putStrLn "hello" :v
 
@LuchianGrigore By the way, who is FREQ88888? :)
 
6:45 PM
@Sijin Reminds me of the days I worked for a web company.
 
I got it
it is not part of the C standard library
 
It's 14 KB whether or not you include the second sort(). Pretty significant if you're sorting by different fields... the lambda grows by 2-3 KB for every single field (if not for every lambda), whereas this one only depends on data types, and shares most of the common code.
#include <algorithm>
#include <vector>
#include <boost/phoenix.hpp>
struct Foo { int x, y; };
using namespace std;
using namespace boost::phoenix;
using namespace boost::phoenix::placeholders;
int main()
{
vector<Foo> v; v.push_back(Foo());
 
@FredOverflow how did you compile? Cause mine's 14 kB. MinGW-w64 x64.
 
Code on ideone thanks.
Ideone, not editeone.
 
6:47 PM
@rubenvb I don't remember anymore, it's been years, sorry.
 
@StackedCroo lol, totally...there were a bunch of these types of posters...but this one was really funny and I had it saved
 
@FredOverflow probably forgot -Wl,-s ... strip unnecessary symbols.
 
13
Q: GCC C++ "Hello World" program -> .exe is 500kb big when compiled on Windows. How can I reduce its size?

zeroDivisibleI just recently started learning C++ - I am using nuwen's version of MingW on Windows, using NetBeans as an IDE (I have also MSDN AA Version of MSVC 2008, though I don't use it very often). When compiling this simple program: #include <iostream> using namespace std; int dog, cat, bird, f...

 
@Mehrdad the additional code for using lambdas instead, I mean
 
@FredOverflow Well then I guess either newer GCC or MinGW-w64 solves that problem quite effectively.
 
6:48 PM
std::stable_sort(stuff.begin(), stuff.end(), std::bind(&X::foo, std::ref(data)[std::placeholders::_1]) < std::bind(&X::foo, std::ref(data)[std::placeholders::_2]));
std::stable_sort(stuff.begin(), stuff.end(), std::bind(&X::bar, std::ref(data)[std::placeholders::_1]) < std::bind(&X::bar, std::ref(data)[std::placeholders::_2]));
no compilo
 
@jalf 8 KiB is crap that's always there. Up to the 12 K mark should be for stable_sort, and the rest for bind
 
@LuchianGrigore Honestly, I thought the first one was better :)
 
@jalf at least according to my quick experiment.
 
doh, I screwed that edit up
 
@jalf Ah I just saw
 
6:50 PM
@Mehrdad what takes up the additional space when you use lambdas instead of bind though?
 
Inlined lambdas.
 
@jalf My understanding is that every lambda generates entirely new code, so whatever gets inlined into the lambda gets duplicated for every sort() I call, and the entire lambda gets probably inlined into the sort itself, making it worse.
 
@rubenvb There's -s on the main driver, you don't have to use -Wl.
 
@CatPlusPlus well, yeah, whatever :P
 
@Mehrdad but the lambda should be literally just a few instructions. Certainly not kilobytes... Unless it calls other functions which get inlined into the lambda
in which case it's not really a question of "lambdas are bloated", but simply "you asked the compielr to optimize, so it optimized for speed at the cost of executable size"
 
6:51 PM
@jalf Unrolled non-tail recursion?
 
which kind of invalidates the whole discussion, because then the size difference should go away if we just optimize or size instead
 
@jalf No, it generates entirely new code for stable_sort, which is templated on the lambda type, and is huge
 
Have you tried disassembling it to see what all the junk is?
 
@Mehrdad That's called "inlining" and it's supposed to happen. It makes it execute faster.
 
6:53 PM
@DeadMG Exactly. If we tell the compiler to optimize for speed, and we give it additional opportunities to optimize (by inlining more aggressively, for example), then we shouldn't be surprised to see additional inlining occur, at the cost of executable size
 
If you compile to output both assembly and source together, it's easy to tell what each piece of assembly is.
 
@jalf Optimize it for size, does it make a difference?
 
New test, use /Os
 
Lots of "I don't always" in here.
 
6:53 PM
@Mehrdad Why wouldn't it? Why would the compiler have an "optimize for size" flag, if it did nothing?
 
@Mysticial did you ever try to compile y-cruncher with clang?
 
@bamboon nope. Only VC++, ICC, and GCC.
 
well
I got an over 50% reduction in size for the x86 version
 
Anyway, when you get bored obsessing about shaving kilobytes of executables by not using one of the best language features C++ introduced recently, here's something interesting for a change: a 500MB presentation about Halo netcode.
 
@jalf Just because it "does something" doesn't mean it does exactly what you want whenever you want. Just try it.
 
6:54 PM
@Mehrdad I don't have a complete test case to try it on. You're the one wondering what effect it has, why don't you try it? :)
 
51,712 for two lambdas with /Os
 
@CatPlusPlus Time to use the absurd bandwidth I have here.
Chrome estimates I'll be done downloading in 10 minutes. Hmm.
 
aaand.. exactly the same size with just one of them.
 
@FredOverflow I might, but since all my classifiers are fuzzy neural nets, a few undefined inputs don't matter much :)
 
how the compiler achieved that, IDK.
 
6:56 PM
Please post the code outside. Pleeeaaaaase!
 
bin it! bin it!
 
put codez on ideone/pastebin/liveworkspace plix.
 
Haha ok thanks
 
I clicked "relocate" and DeadMG binned it.
HUH.
 
@CatPlusPlus i pwn u, noob
 
6:57 PM
the puppy is the cat
the cat is the puppy
They are one and the same.
 
naw
 
That actually explains a lot
 
What you said makes no sense, and you should stop smoking this thing.
 
I think Haskell is as bad as Java
 
would you object to me using std::bind instead of boost?
 
6:57 PM
@jalf Did you see the test case? It grows by 1.5 K per every stable_sort(<lambda>) even with /O1.
 
@jalf I couldn't make it compile.
 
@DeadMG get some judgement
 
/O1 is not optimising for size.
 
@sehe No, really. When you think about it, they're basically the same thing.
 
@CatPlusPlus WTF?
 
6:58 PM
Lol.
 
@DeadMG yeah sure. makes sense
/Os ?
 
@sehe No, think about it.
 
@sehe No, that's only a partial thing. /O1 is the full one.
 
Not this again.
 
Java is garbage-collected OOP taken about a billion miles further than it should be.
 
6:59 PM
When in bed, should you optimize for speed or for size?
 
Haskell is garbage-collected functional taken about a billion miles further than it should be.
 
It's clear you don't have all the cards in your deck. Why do you insist on playing?
 
@DeadMG I have. I am not willing to grant you a gross simplification like that, just because you can come up with a dozen points where they are actually very similar. They are not the same thing. PERIOD.
 
@R.MartinhoFernandes Hey. Not my fault someone else accused me of being the cat :P
 
@DeadMG Java didn't take anything even far enough.
 
6:59 PM
@Mehrdad Who said anything about /O1?
 

« first day (675 days earlier)      last day (4291 days later) »