« first day (702 days earlier)      last day (4249 days later) » 

12:00 PM
for example, in most contexts, you can just fill in the type that is deduced for auto
 
@ltjax and some cannot. I mean, sure, you can always generate a C++03 program which does the same thing, but the code would be very different, and it would not look equivalent
 
@StackedCrooked: how does that help?
 
Yeah, 'just'.
 
Can't you use Boost instead and get lambdas in C++03?
 
sbi
@ltjax I don't see that it would help, but it would work according to your spec. :-/ You have C++11 code (which C++03 code is), and you can compile it with a C++03 compiler.
 
12:02 PM
@sbi: my "spec" was autos/lambdas
those are not in c++03
 
@ltjax vendors are still struggling to build a compiler which generates machine code for all C++11 features. I think a compiler which generates C++03 code instead is pretty far down on their list of priorities
 
sbi
@ManofOneWay I suppose lambdas are rather easy to emulate in C++03 anyway. Just create function objects. Tedious, yeah, and grepping for lambdas is probably absolutely impossible, but the translation in itself should be fairly straightforward.
 
@sbi: exactly - so I thought using something like the clang toolchain for that would be feasible
and someone might have already done that
 
sbi
@jalf It's not the code-generating backend that's their problem, it's the frontend.
 
@sbi Sure, but my point is that as long as they're busy with the frontend, creating a new backend which generates C++03 code is probably not a top priority
 
sbi
12:04 PM
@ltjax Yeah, clang was the first I had in mind, too.
 
@ltjax There are features of C++11 that require ABI changes.
at least for some existing ABIs
 
@jalf, yea, but presumably, autos and lambdas do not
 
which, I assume, are the ones you want to preserve ABI compatibility with
@ltjax So are you asking about converting any C++11 code to C++03 code, or are you asking about converting only auto and lambdas to C++03?
 
sbi
@jalf I suppose no commercial vendor will actually spend time on a C++03-generating backend — no matter what their progress is in other areas. If you need something like this, clang is likely your only hope.
 
And does the generated code have to be readable/understandable? Does it have to follow the structure of the source program?
 
12:05 PM
autos and lambdas primarily
it shouldn't change much else
 
@ltjax What does "primarily" mean in this context? Do you need more than those two features converted, yes or no?
 
yes, but the more, the better, of course
 
sbi
@ltjax If so, then obviously none of us here right now has heard about it.
 
@ltjax Why is it the more the better? You either need those two features, or you need more than those two features
 
okay, that's all I really wanted to know, thanx
 
sbi
12:07 PM
@ltjax If, yes, you need more, then those two wont suffice.
 
If you can't even tell us what your question is, answering it is kind of difficult
 
I think a tool that programmatically rewrites lambda is prone to generate some pretty iffy code, by human standards.
 
My Mobile Broadband app is using 1.2GB of memory
 
@LucDanton: why? just write functors as sbi already mentioned. It's just tedious to do the capturing
 
I think it may be leaking.
 
sbi
12:08 PM
Maybe, @ltjax, you start all over, this time trying to tell us what problem your are trying to solve, rather than asking about the dead end you ran into when you tried to solve it?
 
@ltjax Because the code must be out of line. What about a lambda inside a lambda inside a function template?
 
@LucDanton it would be a template functor?!
 
Which one?
 
@LucDanton Ahab? Reminds me of Old Testament only. King Ahab?
 
both lambdas
 
sbi
12:09 PM
@jalf Damn, I missed that part.
 
@sbi he said mobile broadband app :)
 
@sbi, I'm not trying to solve any concrete problem. I'm just interested in it
 
@sehe From Moby Dick, although it is named after the biblical character apparently.
 
@DeadMG :)
 
which isn't much more specific, but at least refers to a piece of software
 
12:10 PM
Nothing to see here.
 
@ltjax So your'e asking if anyone has written a hugely complicated program to solve a problem which no one, not even yourself, actually has?
Hopefully the answer you got didn't surprise you too much ;)
 
@jalf surprisingly cool stuff based on clang pops up all the time
 
@TonyTheLion Under multiplication (actually, procreation; dutch works better here)
 
I wouldn't actually be surprised if this did indeed exist
 
sbi
Ah, come off, @jalf. It's a legitimate question, and many here would like to discuss the feasibility. It's just that @ltjax came across as if he (thought he) needed it for some project.
 
12:12 PM
it's more for roadmapping concerns really
like autos and lambdas are the prominent changes that VS2010 supports, and if you were to switch a code-base to that, but later needed to go back, such a tool might be very valuable
 
@sbi doesn't clang have a C-emitting backend through llvm?
 
@ltjax I suspect that any roadmap which involves such a tool is going to be a monumental disaster. ;)
 
not that anyone wants to go back, but its easier to convince the higher-ups if such a tool is available
 
sbi
@sehe That might well be. I know very little about llvm.
 
@ltjax It also supports rvalue references, which would be extremely painful to convert
 
12:14 PM
@ltjax I haven't seen it mentioned yet, so: BOOST_AUTO, BOOST_MOVE, BOOST_FOREACH and (perhaps) Boost Phoenix for lambdas.
 
there are quite a few C++ compilers that have C backends
@sehe, yea, I'm aware of all of those, thanx
 
And if you were to rely on such a tool, it would have to generate readable code, which is pretty mcuh the one thing I can guarantee that generated code is never going to be :)
 
@ltjax Next time, you'll want to mention that. Also, what then is your question, if you knew the answers?
 
@sehe: I didn't ask about them
I asked about the language features
 
C++ compilers that target C are not intended for their output to be read by humans. If you want a tool that accepts C++11 and output something not for humans, you want a C++11 compiler.
 
12:15 PM
@ltjax auto/lambdas -> BOOST_AUTO and Phoenix?!
 
@ltjax I never intended to help, muahaha.
 
@ltjax Wait. That then completely fails to make sense. Baffled. C++11 has a new standard because it is not the same
 
@ltjax but their purpose is not to be able to rewrite your code in C, and if you tried to use them for that, it would be a catastrophe
 
@jalf, I'm pretty such clang can generate readable code, or at least modify readable code to a minimal extend
 
That's libclang and it's purpose is not to generate code, IYAM
That's AST manipulation and code roundtripping
 
12:16 PM
Hahahahaha no. Compiler backends are not interested in generating readable code.
 
but they might be interested in giving you meaningful error diagnostics, which is why libclang keeps that info around
 
Yes, so?
 
you have access to the original code, and you don't need to modify it, hence not necessarily decreasing readability
if you were to write a backend that just removes lambdas and autos
 
@ltjax but would you be willing to bet your product's code base on it? ;) Converting lambdas to functors is a pretty intrusive change, which would not be pretty. And as I said, getting rid of rvalue references would require a huge rewrite of pretty much everything. Which would be unreadable
 
Are you still interested in clarifying your own (original?) question? 'cause otherwise - plonk
 
12:19 PM
Why the hell would you want to remove lambdas and autos.
 
@jalf, I agree on rvalue references, which is why I didn't mention them explicitly
 
@CatPlusPlus Because they are in your parking spot?
 
@ltjax but if you want to do what you say you want to do, then you have to deal with them too. They're used a lot under the hood in the standard library, for example. And your code likely calls into the standard library, so it relies on rvalue refs
 
Enjoy your codebase with randomly named types.
It will be so readable.
 
I think Lambda145 is a nice method
 
12:21 PM
that's what you get in VS2010 error reporting anyways, can't be much worse
:)
<unnamed-lambdaX>
 
I see basically two answers to your question: Any plan or roadmap involving actually using or relying on such a tool: run away screaming. As a purely academic exercise: what you're asking is possible, and could be interesting to work on... but just not very useful in practice
 
Not useful at all.
 
@ltjax er, yes. Having to maintain code containing randomly named types is a lot worse than having to maintain code which during compilation generates randomly named types ;)
 
why not?
 
Also stop using crappy outdated compilers.
 
12:22 PM
public class KpiService {
    private static KpiService instance = null;

    public static KpiService getInstance() {
        return instance;
    }

    public KpiService() {
        instance = this;
    }
    /* SNIP */
}
^ Hahaha today's dWTF -- please discuss :>
 
@CatPlusPlus, we want to, but we can't force our customers who rely on a VS2005 ABI
 
Sucks to be you
 
if you has such a tool, you could maintain and develop it in VS2010 and ship it with a VS2005 ABI
 
well... if you are truly stuck with a C++03 compiler, but want to make use of C++11 code base... I guess I can see the desire for a conversion tool...
 
@thecoshman It wouldn't be a C++11 codebase. It would be a C++03 dialect.
 
12:23 PM
It's silly and just maintaining well-written 03 codebase will be much less effort.
 
@ltjax but you'd be adding a lot of complexity to the build process, and have a very high likelihood of introducing nasty bugs. And then there are all the compiler changes which are nothing to do with C++11, but simply bug fixes and such. There is a lot of code which simply behaves differently in VC2010 than in VC2005
 
that's just your opinion
 
@ltjax no, it's sanity calling out to you ;)
 
All this mess just to get auto and lambdas, I don't understand.
 
you don't have to like it.
I don't think it's insane
 
12:25 PM
If you have to deliver VC2005-compatible code you're going to have to write it and maintain it in VC2005. There is no sane way around that. You'll just have to figure out an upgrade path. How and when can you migrate your customers to something newer
 
@sehe Is that Java? Oh dear god how embarrassing
 
@LucDanton well, an 03 code base and use an 11 library
 
You can't use 11 library.
 
either way, it's a stupid thing to do
 
@ltjax but it is. :) Once again, how will you debug code which you wrote in VC10, and which works fine in VC10, but which triggers nonconformant behavior in VC8?
 
12:26 PM
@thecoshman Well no. No ABI compatibility.
 
Will you debug the VC10 code? That doesnt' exhibit the bug. Will you debug the generated VC80 code? That's going to be nasty and painful
 
@jalf: in VS08, this is why I want minimal changes
 
@CatPlusPlus thus the desire for a tool to convert the code to 03
still, it is a stupid thing to try to chase, just get with the times and use 11
 
Trying to backport C++ code to a compiler 5 year older than the one you're testing with (and automatically at that) is stupid.
 
I never said we're only testing in VS10
 
12:28 PM
Why are we even talking about this.
 
@CatPlusPlus indeed, yet I am sure some one, some where, is trying to do exactly that
 
@ltjax and once again you are not going to get minimal changes. Most uses of auto can be trivially replaced. Lambdas can be replaced fairly automatically, but the code would look very different, and be a pain to follow. And then there are all the other changes which sneak in anyway, because they're used in the standard library, or in other third-party dependencies
 
you need to be aware of subtle differences, no matter if you are using auto/lambdas
 
there's no way you're going to get it to work
 
.. they said
 
12:29 PM
:)
 
@DeadMG challenge accept... wait a minute... screw it, I don't that crap
 
You donned that crap, alright. This was apparent from the avatar a while now
 
At the end of the day, what would this buy you? You'd have to spend most of your time working in VC8 with the generated code, so you wouldn't get much use out of lambdas or auto anyway. So why introduce all that complexity to get them? The end result would just be that the code you have to maintain gets less readable (even if it's only a little bit less readable) than it is today, and the likelihood of encountering nasty compiler bugs would go up dramatically.
 
TIL there’s a loaded, unsecured shotgun in the trunk of every Linux. — Konrad Rudolph 9 secs ago
 
I was hoping the conversion would be relatively painless. either way, there's no way to know without a conversion tool and results or a counter-example where it just doesn't work
 
12:33 PM
@jalf just use vim+make. As long as the code generation step inserts proper #file/#line directives, it should be relatively transparent working with error messages :) <choke/>
 
@sehe northern talk, don't worry
 
No way? Except common sense, maybe. Also, you're free to build it. I'm just not sure there is much of a market for it.
On the upside: it should be a breeze to implement with a recent libclang. Just prepare for long build times and a lot of 'WTF' moments regarding build configuration changes
 
@thecoshman 'northern gebrish' I take it.
 
@LucDanton gerbrish, IIRC
 
@LucDanton you could say that
 
12:36 PM
@ltjax Not true. Most of what we're saying is known. We can't know exactly how painful it would be, but there's no way around the simple truth that: (1) you would have to pass your code through two compilers instead of one, which means that the likelihood of encountering compiler bugs increases (if either compiler fails to handle the code, you have a problem), and the testing cycle would get longer, as you have to compile the code twice, and then debug in a different IDE than you wrote it in
Those are real, unavoidable problems which follow logically from what you want to do
 
@jalf Strikingly resembling my own response to that
@jalf Allthough you could use the same IDE for debugging. Just use a compiler that honours #file/#line directives for debug info (which, I think, is all of them)
 
we're already passing our code though multiple compilers. one more ain't gonna hurt much :)
 
@ltjax ouch. Why do you do that?
 
because management
:-/
 
Then the only answer you need is what I already suggested: run away screaming
And find a job where you're not surrounded by idiots :)
 
12:40 PM
it's all trade-offs man
 
@jalf they exist?
 
@ltjax so what are the advantages? :p
 
I'd prefer complicating the toolchain over being stuck without autos and lambdas in my day job
that might just be my personal preference
 
inb4 "20x your salary" argument
@ltjax I'd prefer simplifying the toolchain to achieve exactly the same
 
I am aware of the dangers and all
 
12:41 PM
@ltjax yes, but that's what I'm saying: there is a third option: get autos, lambdas and a sane build chain, and get rid of incompetent management. Find another job
 
Another option is Boost.
 
I don't get why you would prefer to work with obfuscated code
 
boost isn't allowed....because...well
management
 
12:42 PM
Another option is not working with C++ on your job.
 
Headhunter etc.
 
we kinda ended up replicating a lot of boost, because thats allowed
 
28 mins ago, by ltjax
@sehe, yea, I'm aware of all of those, thanx
 
@ltjax but you would be stuck without autos and lambdas in your day job, because most of your day job woudl be spent in VC8 debugging this obfuscated code :)
 
@CatPlusPlus WIN
 
12:43 PM
@sehe I didn't take that to mean it was off the table though.
 
@ltjax Copying is the most efficient way to replicate boost. Also, the only sane approach
 
@jalf, that might happen, but it might not - depending on how good the tool is
 
@LucDanton I took it to mean: "This is not a rational discussion - I'm not actually asking what I asked" :)
 
Passive resistance against NIH is to IH.
 
@CatPlusPlus some people want to do C++ on the job though.
 
12:44 PM
Can't see why.
 
@LucDanton Invent copying boost code :)
 
Because abstraction is free
 
Because Java sucks.
 
har har
 
unlike in any other language
well, non-native
but there aren't too many jobs in other native languages
 
12:45 PM
Because there's little to almost no companies that use Haskell.
 
I'd rather work with languages that don't produce nightmare codebases.
Well, I do.
Somewhat.
 
@ltjax No, there is nothing the tool can do about it. Because the real problem is not how it generates code for lambdas. The real problem is that while you write your code, you target one compiler, and when you run it, it goes through a 7 year old compiler which, to be honest, is buggy as shit in comparison. So the code you wrote stops working in all sorts of interesting ways, and you have to debug it
 
@ltjax Well apparently, abstraction is well nigh impossible. Abstraction, ok, but not if you mean modern, useful, productivity enhancing abstractions :)
 
@CatPlusPlus Android?
 
@TonyTheLion No.
 
12:46 PM
So Android codebases are good?
 
I don't believe a word of it.
 
Not the lambdas, but all the C++03-compatible code which looks fine and works fine under VC10, but which misbehaves when compiled with VC8
 
@jalf Good point
 
@jalf, but we have that anyways - just without getting anything positive out of it
 
12:46 PM
But C++ codebases tend to be worse.
 
we have to compile the code with vs2008 either way, while we develop in vs10 almost exclusively
 
Because the language allows it.
 
@ltjax that would be a reason to improve the situation, not prevent it from improving
 
so you think I'm looking for a technical solution to a sociological/political problem?
 
Outdated compilers, shitty practices for PERFORMANCE, no Boost.
Yes, you do.
 
12:49 PM
not exactly. I think your company has some fundamental and crippling political problems, btu I also think you're looking for a short-sighted technical band-aid to the technical symptoms that are caused by the political problems
I think that your technical "solution" is going to cause you far more technical problems than you have today. It's a band-aid, it treats a few of the symptoms by adding enough complexity to guarantee that the underlying problems only get worse in the long term
 
Your codebase sucks and your practices suck more.
 
@ltjax well, put it this way. It's like some guy took a massive shit in a public toilet and blocked it up, and then the guy after had this shits, and just had to lay it on top. And you come along and think you'll give it a quick flush, washing the decks with shit, and then think you might be able to do a rather large shit to help push the lot through
 
that's a lot of shit
 
That's a shitty analogy.
 
oh great, that get's the star!
 
12:52 PM
Anyway, I for one don't ever want to work with C++ for money.
 
Unless I'm in complete charge of the project.
 
The Cat has spoken. :P
 
@TonyTheLion lol
@CatPlusPlus surely that extends to everything?
 
My projects are the best.
 
12:54 PM
lol
 
@TonyTheLion sizably NSFW
 
@sehe sensually NSFW
 
@thecoshman of course
 
@sehe what do you mean by that exactly?
 
12:56 PM
@thecoshman oh, you have no taste. shitty jokes kinda gave that away :)
 
@TonyTheLion ¬_¬ it's a rather large posterior
 
@TonyTheLion I don't know for sure, but the first .4 seconds appeared to show a rather sizable behind
 
@sehe I'm sort of stuck stating silly sequences of alliteration
 
@jalf the microsoft disease: over-engineering your way out of trouble just yields more convoluted problems
@thecoshman that's associated with... alzheimer, no? Something like that
 
@sehe oh like that
 
1:00 PM
@sehe alliteration associated with alzheimers, astonishing!
 
lol
New 0day for IE in the wild
how unsurprising
 
@thecoshman Actually;
Frontotemporal dementia (FTD) is the clinical syndrome caused by degeneration of the frontal lobe of the brain. The degeneration may extend to the temporal lobe. FTD is the clinical manifestation of frontotemporal lobar degeneration, and the second most common pre-senile dementia after Alzheimer's disease. Signs and symptoms FTD is traditionally difficult to diagnose due to the heterogeneity of the condition. This heterogeneity means the signs and symptoms can vary dramatically between patients. Symptoms are classified into three groups which underlie the functions of the frontal and tem...
@thecoshman Some scientists suggest that Ravel composed his (repetitive) Bolero because of the same condition. He was just 'compelled' to create the same thing over and over. Somehow
 
lolololol
it's all about the assonance... waaaait
 
and then it went quiet
hi @JerryCoffin
 
1:15 PM
@TonyTheLion Hi Tony. How are you this afternoon?
 
Hola
 
@sehe Ah, hello to you to.
 
@JerryCoffin I'm alright.
 
@TonyTheLion Although they'd never admit it, my guess is that most of the people who'd really object to this would be women angry at being reminded that they're old enough that men don't really want to look at their butts any more.
 
@JerryCoffin *o :)
 
1:28 PM
@JerryCoffin the appeal of a butt is not so dependent on the age of said butt
 
Wut. TMI
 
what?
I'm not going to ask for a girls age before I decide if she is hot or not
¬_¬ though I might ask for confirmation if they are looking a bit too young
 
@thecoshman What's your perspective, horizon then? "is not so dependent on the age of said butt" - I feel Jerry was probably referring to ages 45-100?
@thecoshman "are you 18?" - "Yes" - "Oh damn. Too old for me"?
 
@sehe ¬_¬ I think I confused you
 
sbi
@JerryCoffin Actually, most of the people who object to things like that object on behalf of others, whom they suspect to object.
> Pardon me using this Latin-derived language, but political correctness is absolute cognitively-challenged bovine excrements. — sbi
 
1:33 PM
@sbi sigh, here you go
 
sbi
@thecoshman It's not like you have to star that, you know?
 
@sbi "Pardon me using this Latin-derived language.." wut?
 
@sbi hardly
@Neil taken from 'pardon my French' (I assume)
 
@sbi Personally, I prefer “horse manure”
 
@thecoshman Ah
 
sbi
1:35 PM
@Neil "Pardon me French, but political correctness is absolute stupid bullshit."
 
@sbi You sound like a conehead now
 
@JerryCoffin haha
 
@sbi s/me/my/
 
@sbi Yes, the "won't you think of the children" argument. I think most of the time it's a cover for something entirely different. I always laugh at the parent's groups who object to specific TV shows because of all the references to sex -- and have watched them carefully enough that they can tell you the exact count.
 
Beldar Conehead:
An owner's manual to a Ford Lincoln Mercury Sable.
Highmaster:
Ford Lincoln Mercury Sable?
Beldar Conehead:
A personal conveyance named after its inventor, an assassinated ruler, a character from Greco-Roman myth and a small furry mammal.
Highmaster:
Ah.
 
sbi
1:37 PM
@sehe I remember some movie from the 80s(?), where the male protagonist desperately wants to bed that woman (like every other male, and finally succeeds. However this woman can only ever have/enjoy/want sex to the sounds of Ravel's Bolero. But this is the age of record players, so the guy has to jump out of bed and restart the damn records every few minutes... I am hazy on the details, and I forgot the movie's title, but I do remember that scene.
 
@thecoshman He's speaking in "pirate".
 
sbi
@thecoshman Oh fuck off, "pardon me French" is pretty idiomatic; even me, despite being a bloody furriner, knows that. (And, yes, I know the correct phrase would be "I know that", but you and me — sic! — know that nobody says that, maybe with the exception of the queen.)
@KonradRudolph I prefer "bovine excrements". "Horse manure" is so 1800s.
 
@sbi wow. weird
@thecoshman Most definitely not. I'd say it is far more likely (statistically at least) you confused yourself:
12 mins ago, by thecoshman
@JerryCoffin the appeal of a butt is not so dependent on the age of said butt
 
@JerryCoffin A pirate walks into a bar and orders a beer. The bartender notices he's got a large steering wheel in his pants and inquires. The pirate replies, "Aargh, it's driving me nuts."
 
sbi
@Neil I have no idea what a "conehead" is.
 
1:41 PM
 
sbi
@Neil I actually had the guys in my office looking at me, because I LOL'ed.
 
@sbi Mission accomplished.
 
Well, gotta get kids to school. See you all later.
 
sbi
@Neil Watching this muted, I still have no idea what a conehead is.
 
@sbi I guess you wouldn't watching the video. :) Rather, you probably feel more confused than before.
It is a movie inspired by a famous Saturday Night Live skit about this family which played with the idea that they were illegal aliens, but like, outer space aliens
They had this strange habit of describing things thoroughly in order to convey an idea which to most people would be easy to comprehend
 
1:45 PM
2
Q: Random sequence iteration in O(1) memory?

4ZMSay you want to iterate over a sequence [0 to n] in a random order, visiting every element exactly once. Is there any way to do this in O(1) memory, i.e. without creating an [1..n] sequence with std::iota and running it through std::random_shuffle? Some kind of iterator spitting out the sequence...

 
sbi
@JerryCoffin That's a very Merkin thing, BTW. It's even here on SO.
 
@sbi the pope
 
sbi
@Cheersandhth.-Alf And there's @TimPost, too:
That is a conical thing on his head, right?
 
@sbi hey, I get it all the time, I see no reason why I cannot give it back
 
sbi
1:53 PM
@thecoshman Yeah, but you get it because you're wrong, not because you're idiomatic.
 
@sbi ¬_¬ you win this round mr monkey (SCNR)
 
sbi
Unscrews pirate's head.
 
@sbi rough day?
wait... why does that not sit right...
 
@sbi I've read shamefully none of Disc World 'stuff'
 
sbi
1:57 PM
@thecoshman That was obvious in your violation of the Unwritten Rule.
 
@sbi ¬_¬ do I have to read the article, and can you just tell me
 
sbi
@thecoshman I have explained this numerous times here. You can read the piece about the librarian, or you can search this room's annals.
 
@sbi sigh... brb
 
@thecoshman it's not really important. But if you want to be in on discworld in-jokes, you'll probably have to read it that article at the least ;)
 

« first day (702 days earlier)      last day (4249 days later) »