Syntax error: unmatched thing in thing from std::nonstd::__ map
November 18, 2013 3:44 AM Subscribe
HCI people discover bugs by receiving a concerned email from their therapist. Systems people discover bugs by waking up and discovering that their first-born children are missing and “ETIMEDOUT ” has been written in blood on the wall.The Night Watch - James Mickens [SLPDF]
Okay, I was ready to get fighty about the dismissal of HCI in that quote, but that article is fucking hilarious, so no, no fighting today. We'll save that until the weather forecast inevitably reads "RIVERS OF BLOOD ALL DAY EVERY DAY."
posted by 256 at 4:58 AM on November 18, 2013
posted by 256 at 4:58 AM on November 18, 2013
This is the best thing.
For example:
For example:
Indeed, the common discovery mode for an impossibly large buffer error is that your program seems to be working fine, and then it tries to display a string that should say “Hello world,” but instead it prints “#a[5]:3!” or another syntactically correct Perl script, and you’re like WHAT THE HOW THE, and then you realize that your prodigal memory accesses have been stomping around the heap like the Incredible Hulk when asked to write an essay entitled “Smashing Considered Harmful.”posted by The Michael The at 5:01 AM on November 18, 2013 [4 favorites]
Ooo, where do I buy my Smashing Considered Harmful t-shirt?
posted by bitslayer at 5:15 AM on November 18, 2013 [6 favorites]
posted by bitslayer at 5:15 AM on November 18, 2013 [6 favorites]
Really to be properly RESTful instead of the article I should get a 500 code and consider it someone else's problem...
posted by Artw at 5:23 AM on November 18, 2013 [1 favorite]
posted by Artw at 5:23 AM on November 18, 2013 [1 favorite]
Spell-checkers are useful.
Errr. Krackens?
posted by chavenet at 5:30 AM on November 18, 2013 [1 favorite]
Errr. Krackens?
posted by chavenet at 5:30 AM on November 18, 2013 [1 favorite]
I HAVE NO TOOLS BECAUSE I’VE DESTROYED MY TOOLS WITH MY TOOLS.
posted by localroger at 6:07 AM on November 18, 2013 [23 favorites]
posted by localroger at 6:07 AM on November 18, 2013 [23 favorites]
localroger, that was my favorite line, too. Very funny, very true piece.
posted by wenestvedt at 6:28 AM on November 18, 2013
posted by wenestvedt at 6:28 AM on November 18, 2013
He also wrote The Slow Winter, which you should also read immediately.
posted by mhoye at 6:29 AM on November 18, 2013 [9 favorites]
"Of course, pride precedes the fall, and at some point, you realize that to implement aggressive out-of-order execution, you need to fit more transistors into the same die size, but then a material science guy pops out of a birthday cake and says YEAH WE CAN DO THAT, and by now, you’re touring with Aerosmith and throwing Matisse paintings from hotel room windows, because when you order two Matisse paintings from room service and you get three, that equation... and that's not nearly the best bit.
is going to be balanced."
posted by mhoye at 6:29 AM on November 18, 2013 [9 favorites]
mhoye: You have made me wish that, instead of this already excellent post, we had a post about how awesome James Mickens is.
Times were good, assuming that you were a white man in the advertising business, WHICH MY FATHER WAS NOT SO PERHAPS I SHOULD ASK HIM SOME FOLLOW-UPposted by 256 at 6:42 AM on November 18, 2013
QUESTIONS BUT I DIGRESS.
That has brought back horrible yet wonderful memories of writing a file system for a systems engineering course. Possibly the only thing more maddening than systems engineering is writing embedded software. Worst experience ever - in which you wish you had a file system to log to, or even just crash, instead you spend hours, days, or weeks wondering just which incantations/tears/threats are necessary to get the cross-compiler to work, so that you can then start testing your code (which will inevitably fail in 'interesting' ways - at best, a blinking light not quite blinking correctly, and you wondering where 2 gigabytes of data just went).
And seconding 'The Slow Winter'. excellent piece.
posted by combinatorial explosion at 6:43 AM on November 18, 2013 [1 favorite]
And seconding 'The Slow Winter'. excellent piece.
posted by combinatorial explosion at 6:43 AM on November 18, 2013 [1 favorite]
Excellent writing! Thanks for posting!
...and Go Blue!
posted by JoeXIII007 at 6:45 AM on November 18, 2013 [1 favorite]
...and Go Blue!
posted by JoeXIII007 at 6:45 AM on November 18, 2013 [1 favorite]
I sincerely hope James Mickens has watched the clip of the two very helpful Russian guys and knows how to open a can without tools (I know, strictly speaking a rock is a tool), otherwise he might starve.
posted by manoffewwords at 6:51 AM on November 18, 2013
posted by manoffewwords at 6:51 AM on November 18, 2013
A friend of mine, upon reading the link, said "I laughed until I cried."
I did, too.
posted by seyirci at 6:57 AM on November 18, 2013
I did, too.
posted by seyirci at 6:57 AM on November 18, 2013
You can’t just place a LISP book on top of an x86 chip and hope that the hardware learns about lambda calculus by osmosis.
posted by kokaku at 6:59 AM on November 18, 2013 [8 favorites]
posted by kokaku at 6:59 AM on November 18, 2013 [8 favorites]
Metafilter: it’s like an art show or a meeting of the United Nations. There are tea breaks and witticisms exchanged in French; wearing a non-functional scarf is optional, but encouraged.
posted by Reverend John at 7:06 AM on November 18, 2013 [8 favorites]
posted by Reverend John at 7:06 AM on November 18, 2013 [8 favorites]
There are so many good quotes in here that I'd be hesitant to pick one as representatively AWESOME, but if I did, it would be the one about the LISP book.
I know some people on Windows and have heard amazing stories about processor bugs that need to be worked around. The most recent one was about a cache coherence issue in a particular multicore ARM chip where there was no single code path in which a particular memory value went from non-null to null -- and yet, that was exactly what the processor was reporting.
I actually like debugging, but only from solid ground. I can't imagine doing it while simultaneously engaged in a log rolling competition.
posted by Slothrup at 7:08 AM on November 18, 2013 [2 favorites]
I know some people on Windows and have heard amazing stories about processor bugs that need to be worked around. The most recent one was about a cache coherence issue in a particular multicore ARM chip where there was no single code path in which a particular memory value went from non-null to null -- and yet, that was exactly what the processor was reporting.
I actually like debugging, but only from solid ground. I can't imagine doing it while simultaneously engaged in a log rolling competition.
posted by Slothrup at 7:08 AM on November 18, 2013 [2 favorites]
Mickens eBooks?
posted by Mooseli at 7:11 AM on November 18, 2013 [1 favorite]
posted by Mooseli at 7:11 AM on November 18, 2013 [1 favorite]
mhoye: Thanks for that, The Slow Winter is indeed excellent.
However, when you arrived at your erstwhile house and found a pile of heirloom ashes, me, and a dingo with a chewed-up Rosetta Stone box, you would be less than pleased, despite my protestations that negative scientific results are useful and I had just proven that Spanish-illiterate dingoes cannot extinguish fires using mind power.posted by xqwzts at 7:21 AM on November 18, 2013 [1 favorite]
Note to our Metafilter non-technical compatriots: for a list of people who you probably want to be fixing your computer, click the link titled "N users marked this as a favorite" above.
posted by procrastination at 7:23 AM on November 18, 2013 [15 favorites]
posted by procrastination at 7:23 AM on November 18, 2013 [15 favorites]
RE: The Slow Winter, I didn't make it through the second paragraph before laughing in a sudden, involuntary way that made my mouthful of oatmeal fall back toward my windpipe and almost choke me to death.
NEW FAVORITE.
posted by wenestvedt at 7:28 AM on November 18, 2013
NEW FAVORITE.
posted by wenestvedt at 7:28 AM on November 18, 2013
I actually like debugging, but only from solid ground. I can't imagine doing it while simultaneously engaged in a log rolling competition.
What is this "solid ground" of which you speak?
posted by localroger at 7:31 AM on November 18, 2013 [1 favorite]
What is this "solid ground" of which you speak?
posted by localroger at 7:31 AM on November 18, 2013 [1 favorite]
Solid Ground is when the ground is Somebody Else's Problem
posted by LogicalDash at 7:50 AM on November 18, 2013 [17 favorites]
posted by LogicalDash at 7:50 AM on November 18, 2013 [17 favorites]
My favorite . . .
posted by whuppy at 7:54 AM on November 18, 2013 [4 favorites]
I’m glad that people are working on new kinds of bouncing icons because they believe that humanity has solved cancer and homelessness and now lives in a consequence-free world of immersive sprites.. . . works on so many levels.
posted by whuppy at 7:54 AM on November 18, 2013 [4 favorites]
This is so great. I actually saw a real life instance of something just like this from a systems programmer the other day on twitter after reading the source code to grub:
The systems programmer has read the kernel source, to better understand the deep ways of the universe, and the systems programmer has seen the comment in the scheduler that says “DOES THIS WORK LOL,” and the systems programmer has wept instead of LOLedposted by ndfine at 8:03 AM on November 18, 2013 [3 favorites]
I've had to build a kernel for an embedded device, so this rings very true. Running all-weekend tests on the flash filesystem to expose corruption issues. Spending a week tracking down an occasional boot issue because the goddamn contractor misconfigured the memory clock by 10 ns. And so on.
SYSTEMS HACKERS SOLVE THE BEAR MENACE.
posted by RobotVoodooPower at 8:19 AM on November 18, 2013 [1 favorite]
SYSTEMS HACKERS SOLVE THE BEAR MENACE.
posted by RobotVoodooPower at 8:19 AM on November 18, 2013 [1 favorite]
Yep, the TOOLS quote was my favorite too, and the one that I think would make the best T-shirt.
posted by benito.strauss at 8:36 AM on November 18, 2013
posted by benito.strauss at 8:36 AM on November 18, 2013
Doesn't Microsoft have enough money to buy a Lauterbach ?
posted by rfs at 8:43 AM on November 18, 2013 [1 favorite]
posted by rfs at 8:43 AM on November 18, 2013 [1 favorite]
"I HAVE NO TOOLS BECAUSE I’VE DESTROYED MY TOOLS WITH MY TOOLS."
Works on so many levels. Printed and posted on the wall at work. (with attribution of course, so that others may find this great essay.)
posted by Hicksu at 8:54 AM on November 18, 2013 [2 favorites]
Works on so many levels. Printed and posted on the wall at work. (with attribution of course, so that others may find this great essay.)
posted by Hicksu at 8:54 AM on November 18, 2013 [2 favorites]
It was really, really funny until he started talking about C++, when it turned into a straightforward list of true facts. (The werewolf fantasies were added with C++11, and if you haven't had those yet, you should contact your compiler vendor.)
posted by Western Infidels at 8:59 AM on November 18, 2013 [4 favorites]
posted by Western Infidels at 8:59 AM on November 18, 2013 [4 favorites]
I considered my undergrad education completed when I brought home a floppy disk with a binary image that I coded and booted my OS on my parents computer in front of them. A buffer overrun issue kept me in the lab for 26 hours straight a week before that.
This essay should be required reading before getting into upper division Comp Sci classes.
posted by The Power Nap at 9:07 AM on November 18, 2013
This essay should be required reading before getting into upper division Comp Sci classes.
posted by The Power Nap at 9:07 AM on November 18, 2013
And yet, after a long day of debugging HCI code, there is always hope, and there is no true anger; even if you fear that your drop-down list should be a radio button, the drop-down list will suffice until tomorrow, when the sun will rise, glorious and vibrant, and inspire you to combine scroll bars and left-clicking in poignant ways
Even as a mostly-HCI coder I pretty much have to cop to this being essentially accurate
posted by ook at 9:11 AM on November 18, 2013
Even as a mostly-HCI coder I pretty much have to cop to this being essentially accurate
posted by ook at 9:11 AM on November 18, 2013
This man has lived my life.
posted by killThisKid at 9:19 AM on November 18, 2013
posted by killThisKid at 9:19 AM on November 18, 2013
When I was an undergrad, if you were interested in operating systems you took a course called OS Lab where you would get a chance to build a small operating system on bare metal as a way to put into practice what you had learned in the operating systems theory class.
The OS lab was in a separate room from all the other labs in the school and unlike the other labs that closed for the night, the OS lab was open 24 hours. The target machines were Sun 2's with two old serial terminals attached to them and the big old black and white Sun monitors...they were also the machines we used to develop everything. Good times!
One day, several of us were working in the lab, and had already been up for 2-3 days at that point to get as much functionality in our OSes as we could. I had gone pretty far and was messing around with getting the main frame-buffer driven screen and keyboard to act as a third terminal, in addition to the two physical serial terminals.
Just then, a friend stopped by the lab with another buddy of his. My friend was not a CS major and his friend was an IT major. I said "Hey, check this out, when I type, it actually puts the text on screen. It even scrolls!". The IT major guy just sort of shrugged his shoulders in a kind of "Yeah, so what?" kind of way.
Before I could say anything, one of guys on another team, who had not gotten as far, picked up one of the serial terminals in frustration, shaking it, and shouting "GODDAMNIT! IS IT TOO MUCH TO ASK FOR THE CHARACTER I'M TYPING! IS IT TOO MUCH TO ASK!!!" and was basically tackled to the ground by his team member.
At that point, my friend and the IT guy started slowly backing away out of the lab.
It was also at that point that I knew this was the career path for me!
posted by delicious-luncheon at 9:29 AM on November 18, 2013 [34 favorites]
The OS lab was in a separate room from all the other labs in the school and unlike the other labs that closed for the night, the OS lab was open 24 hours. The target machines were Sun 2's with two old serial terminals attached to them and the big old black and white Sun monitors...they were also the machines we used to develop everything. Good times!
One day, several of us were working in the lab, and had already been up for 2-3 days at that point to get as much functionality in our OSes as we could. I had gone pretty far and was messing around with getting the main frame-buffer driven screen and keyboard to act as a third terminal, in addition to the two physical serial terminals.
Just then, a friend stopped by the lab with another buddy of his. My friend was not a CS major and his friend was an IT major. I said "Hey, check this out, when I type, it actually puts the text on screen. It even scrolls!". The IT major guy just sort of shrugged his shoulders in a kind of "Yeah, so what?" kind of way.
Before I could say anything, one of guys on another team, who had not gotten as far, picked up one of the serial terminals in frustration, shaking it, and shouting "GODDAMNIT! IS IT TOO MUCH TO ASK FOR THE CHARACTER I'M TYPING! IS IT TOO MUCH TO ASK!!!" and was basically tackled to the ground by his team member.
At that point, my friend and the IT guy started slowly backing away out of the lab.
It was also at that point that I knew this was the career path for me!
posted by delicious-luncheon at 9:29 AM on November 18, 2013 [34 favorites]
I'm an embedded developer, and I can tell you this man has seen the elephant.
posted by Harald74 at 9:37 AM on November 18, 2013 [3 favorites]
posted by Harald74 at 9:37 AM on November 18, 2013 [3 favorites]
Oh god, this so much:
posted by Mr. Bad Example at 9:37 AM on November 18, 2013 [5 favorites]
When it’s 3 A.M., and you’ve been debugging for 12 hours,When I discovered Python, I wept for joy.
and you encounter a virtual static friend protected volatile
templated function pointer, you want to go into hibernation and
awake as a werewolf and then find the people who wrote the
C++ standard and bring ruin to the things that they love.
posted by Mr. Bad Example at 9:37 AM on November 18, 2013 [5 favorites]
I started poking at the Linux kernel recently, and nothing has gone terribly wrong... yet. Now I'm kinda apprehensive about what I'm getting myself into.
posted by Standard Orange at 9:40 AM on November 18, 2013
posted by Standard Orange at 9:40 AM on November 18, 2013
Best. Post. Ever.
VM's have made kernel mucking much more pleasurable. I started in the days of reboot, oh shit, restore, etc. and serial debuggers and the like.
Now it is mostly oh, well, revert to snapshot.
posted by Bovine Love at 9:50 AM on November 18, 2013 [3 favorites]
VM's have made kernel mucking much more pleasurable. I started in the days of reboot, oh shit, restore, etc. and serial debuggers and the like.
Now it is mostly oh, well, revert to snapshot.
posted by Bovine Love at 9:50 AM on November 18, 2013 [3 favorites]
Syntax error: unmatched thing in thing from std::nonstd::_ _
map<>const basic_string< epic_
mystery,mongoose_traits < char>, _ _default_alloc_>
qft >
posted by forforf at 10:05 AM on November 18, 2013 [4 favorites]
map<>const basic_string< epic_
mystery,mongoose_traits < char>, _ _default_alloc_
qft
posted by forforf at 10:05 AM on November 18, 2013 [4 favorites]
This guy needs to be writing SF for pay.
posted by Slithy_Tove at 11:10 AM on November 18, 2013 [2 favorites]
posted by Slithy_Tove at 11:10 AM on November 18, 2013 [2 favorites]
He should cowrite the next Laundry book. The scariest twist is: it's not a novel, but a memoir.
posted by Apocryphon at 11:11 AM on November 18, 2013 [5 favorites]
posted by Apocryphon at 11:11 AM on November 18, 2013 [5 favorites]
Wow this is amazingly quotable. Bristling with funny-cos-it's-trues.
posted by jcruelty at 11:18 AM on November 18, 2013 [2 favorites]
posted by jcruelty at 11:18 AM on November 18, 2013 [2 favorites]
the systems programmer has seen the comment in the scheduler that says “DOES THIS WORK LOL"I successfully avoided spitting out the food that I was chewing, but it was a close thing.
Anyway, yeah, C++ STL syntax error descriptions are the worst:
No signature of function matches parameter #3 const & std::vector<std::allocator<<size_type, std::basic_string>, std::crap>>::push_back(const _Tx &, wchar_t * const)::Blah::std::crap<std::std::std::std::thing & _Ty)[<<error-type>>] const size_type, std::vector<std::allocator<<size_type, std::basic_string>, std::crap>>::push_back(const _Tx &, wchar_t * const)::Blah::std::crap<std::std::std::std::thing & _Ty)[<<error-type>>]::iterator(pos_t, std::operator?=()), std::basic_istringstream<const _Tx &, const std::allocator<<std::basic_string<wchar_t>>>>......<()>>::time_t * const, must use C-style cast or reinterpret_cast<const & std::vector<std::allocator<<size_type, std::basic_string>, std::crap>>::push_back(const _Tx &, wchar_t * const)::Blah::std::crap<std::std::std::std::thing & _Ty)[<<error-type>>] const size_type, std::vector<std::allocator<<size_type, std::basic_string>, std::crap>>::push_back(const _Tx &, wchar_t * const)::Blah::std::crap<std::std::std::std::thing & _Ty)[<<error-type>>]::iterator(pos_t, std::operator?=()), std::basic_istringstream<const _Tx &, const std::allocator<<std::basic_string<wchar_t>>>>......<()>>::time_t * const>Oh, you mean I forgot a semicolon? Thanks.
posted by Flunkie at 11:38 AM on November 18, 2013 [9 favorites]
The funny part is that is published as a PDF. Have any of you looked at the underlying structure of a PDF file? I'm convinced Adobe hires systems developers who have overran their buffers.
posted by srboisvert at 11:50 AM on November 18, 2013 [1 favorite]
posted by srboisvert at 11:50 AM on November 18, 2013 [1 favorite]
Adobe Reader is, in fact, shot through with buffer overrun bugs which is why it PDF considered a security risk in some environments.
posted by localroger at 12:13 PM on November 18, 2013
posted by localroger at 12:13 PM on November 18, 2013
Which is why I'm too antsy to even click on the original FPP link and RTFA...
posted by saulgoodman at 1:05 PM on November 18, 2013
posted by saulgoodman at 1:05 PM on November 18, 2013
The point at which I started to really hate C++ was when I found that it was really helpful to syntax-highlight the compiler errors. On the other hand, Clang seems to do a much better job of giving helpful errors than, say, gcc does.
posted by doop at 2:13 PM on November 18, 2013 [1 favorite]
posted by doop at 2:13 PM on November 18, 2013 [1 favorite]
I have been there, for a suitably small value of there. The 3AM pizza, with networks of machines simultaneously flipping out into so many boxes of dysfunctional sand and the only clue to the low-level network driver error being a string of impossible characters that my teeny-tiny embedded debug macro had blatted (by design, because there was no stack or system service left in death) straight into video memory. The file control block data structure, which had just caused something amusing in Venusian to be written to the boot sector of of the test machine's hard disk, mostly due to it now containing what appeared to be the RTC system time word in the head/cylinder/sector buffer. The comment saying "DON'T LOOK, JUST TRUST".
But I made a good decision back then. Having come up through Z80 (haiku) and 8086 (Segments? You what?) to 68K (hurrah!) and 386 (not pretty, but not broken as badly as it might have been), I had along the way consumed K&R and was OK with C (it's just a macro assembler, right?). Then I cracked open Stroustrup, and gazed into the abyss.
If that was going to be my future - and being a reasonably good assembler hack with pretensions probably wasn't - I did not want. Time to do something else.
Nothing I have read here today makes me doubt the sanity of that decision.
posted by Devonian at 6:39 PM on November 18, 2013 [2 favorites]
But I made a good decision back then. Having come up through Z80 (haiku) and 8086 (Segments? You what?) to 68K (hurrah!) and 386 (not pretty, but not broken as badly as it might have been), I had along the way consumed K&R and was OK with C (it's just a macro assembler, right?). Then I cracked open Stroustrup, and gazed into the abyss.
If that was going to be my future - and being a reasonably good assembler hack with pretensions probably wasn't - I did not want. Time to do something else.
Nothing I have read here today makes me doubt the sanity of that decision.
posted by Devonian at 6:39 PM on November 18, 2013 [2 favorites]
and being a reasonably good assembler hack with pretensions probably wasn't
I have done pretty well for myself in that vein, but I was lucky to find a really narrow niche.
Meanwhile I came back from lunch today to find the embedded system flashing syntactically correct Perl (lol) instead of, like, the system display it was supposed to be showing. Turned out to be a system memory pointer had a value like 7, for real.
posted by localroger at 7:08 PM on November 18, 2013 [2 favorites]
I have done pretty well for myself in that vein, but I was lucky to find a really narrow niche.
Meanwhile I came back from lunch today to find the embedded system flashing syntactically correct Perl (lol) instead of, like, the system display it was supposed to be showing. Turned out to be a system memory pointer had a value like 7, for real.
posted by localroger at 7:08 PM on November 18, 2013 [2 favorites]
An old classmate of mine from Berkeley holds the distinction of having found major bugs in two different pieces of simulation software used in Berkeley undergraduate CS courses.
The first was in LogiSim, a graphical program for designing logic circuits from logic-gate primitives. We all had to build 16-bit MIPSlike CPUs with this thing by dragging around gates and wires. This was itself no small task as you had to figure out wire routing yourself and god help you if you hadn't left room for that last component in your ALU. The bug: LogiSim had a feature to simulate wire delay, but the Boolean flag in the code that enabled this wasn't actually wired up to the checkbox in the UI and had defaulted to true. The course staff had to re-evaluate everyone's designs and sheepishly handed out the five points for being able to clock your virtual CPU at 8 Hz instead of 1 Hz (which was all anyone had managed to do with wire delay turned on).
The second was way more insidious: in upper-division Operating Systems, my friend's team had an executable that only ran on their simulated machine (nachos, for anyone else who used that thing) when it had a debugging printf statement in a certain location. Removing the statement led to a crashing program. It turned out that the executable loader routine provided by nachos had an off-by-one in the main loop it used to copy object code into memory. The executable in question turned out to be an integer multiple of 1024 bytes in size when the debug statement was removed, so the second loop that copied the remaining bytes after the main loop finished didn't run and a whole kilobyte of program text just didn't get loaded. Most programs don't really handle this well.
I should forward these essays to Steven... I'm sure he'd sympathize.
posted by spitefulcrow at 7:41 PM on November 18, 2013 [6 favorites]
The first was in LogiSim, a graphical program for designing logic circuits from logic-gate primitives. We all had to build 16-bit MIPSlike CPUs with this thing by dragging around gates and wires. This was itself no small task as you had to figure out wire routing yourself and god help you if you hadn't left room for that last component in your ALU. The bug: LogiSim had a feature to simulate wire delay, but the Boolean flag in the code that enabled this wasn't actually wired up to the checkbox in the UI and had defaulted to true. The course staff had to re-evaluate everyone's designs and sheepishly handed out the five points for being able to clock your virtual CPU at 8 Hz instead of 1 Hz (which was all anyone had managed to do with wire delay turned on).
The second was way more insidious: in upper-division Operating Systems, my friend's team had an executable that only ran on their simulated machine (nachos, for anyone else who used that thing) when it had a debugging printf statement in a certain location. Removing the statement led to a crashing program. It turned out that the executable loader routine provided by nachos had an off-by-one in the main loop it used to copy object code into memory. The executable in question turned out to be an integer multiple of 1024 bytes in size when the debug statement was removed, so the second loop that copied the remaining bytes after the main loop finished didn't run and a whole kilobyte of program text just didn't get loaded. Most programs don't really handle this well.
I should forward these essays to Steven... I'm sure he'd sympathize.
posted by spitefulcrow at 7:41 PM on November 18, 2013 [6 favorites]
This is really great, thanks.
And, yeah, I love C++ (especially the STL), I've used it every day for 10+ years, but it is evil. The really amazing thing about this:
and you encounter a virtual static friend protected volatile
templated function pointer
...is that only one pair of those is contradictory (virtual and static)! You could totally have a volatile pointer to a templated protected friend virtual function. Wouldn't even be remarkable. Ah, the delicious madness.
posted by equalpants at 7:44 PM on November 18, 2013 [2 favorites]
And, yeah, I love C++ (especially the STL), I've used it every day for 10+ years, but it is evil. The really amazing thing about this:
and you encounter a virtual static friend protected volatile
templated function pointer
...is that only one pair of those is contradictory (virtual and static)! You could totally have a volatile pointer to a templated protected friend virtual function. Wouldn't even be remarkable. Ah, the delicious madness.
posted by equalpants at 7:44 PM on November 18, 2013 [2 favorites]
a templated protected friend virtual function.
Please translate this into assembly language so I can understand it kthx.
posted by localroger at 7:49 PM on November 18, 2013 [1 favorite]
Please translate this into assembly language so I can understand it kthx.
posted by localroger at 7:49 PM on November 18, 2013 [1 favorite]
…or into English for the liberal arts grads.
posted by wenestvedt at 7:52 PM on November 18, 2013
posted by wenestvedt at 7:52 PM on November 18, 2013
A volatile function pointer is a nightmare waiting to happen. The rest of it is just obsfucating the eschaton.
posted by inpHilltr8r at 7:58 PM on November 18, 2013 [2 favorites]
posted by inpHilltr8r at 7:58 PM on November 18, 2013 [2 favorites]
Please translate this into assembly language so I can understand it kthx.
posted by axiom at 8:45 PM on November 18, 2013 [19 favorites]
jmp
posted by axiom at 8:45 PM on November 18, 2013 [19 favorites]
http://stackoverflow.com/questions/1087600/pointers-to-virtual-member-functions-how-does-it-work
Yeah, it's really not a lot more than a plain old function call.
virtual = somewhere there is a table of function addresses ("vtable"), and the first X bytes of each object are a pointer to that table (usually)
member function pointer = just an index into the vtable (again, usually)
So from your object look up the vtable, then use the member function pointer to choose a function from that table, and that's your address. Set up parameters and call it.
Volatile just means don't keep a value in a register too long, always read it from memory immediately before use. (Because of memory mapping and/or threads.) The rest of those keywords are all compile-time.
posted by equalpants at 9:27 PM on November 18, 2013 [2 favorites]
Yeah, it's really not a lot more than a plain old function call.
virtual = somewhere there is a table of function addresses ("vtable"), and the first X bytes of each object are a pointer to that table (usually)
member function pointer = just an index into the vtable (again, usually)
So from your object look up the vtable, then use the member function pointer to choose a function from that table, and that's your address. Set up parameters and call it.
Volatile just means don't keep a value in a register too long, always read it from memory immediately before use. (Because of memory mapping and/or threads.) The rest of those keywords are all compile-time.
posted by equalpants at 9:27 PM on November 18, 2013 [2 favorites]
Well, I was writing up what equalpants just did, so I'll just finish up with pointing out that instead of
it should probably be something like
because the vtable lends itself to indirect addressing, and you'd expect to
posted by benito.strauss at 9:32 PM on November 18, 2013
jmp
it should probably be something like
jsr ($3000)
because the vtable lends itself to indirect addressing, and you'd expect to
rts
from a function. Have we finished completely killing the joke?posted by benito.strauss at 9:32 PM on November 18, 2013
Nachos. God, yes, I've used Nachos.
posted by jjwiseman at 10:41 PM on November 18, 2013 [1 favorite]
posted by jjwiseman at 10:41 PM on November 18, 2013 [1 favorite]
"templated protected friend virtual function"
posted by LogicalDash at 5:25 AM on November 19, 2013
- Templated: made by filling in a form that was already written for you
- Protected: has stuff no one else can see
- Friend: special access to the Protected stuff in some other function or class or whatever
- Virtual: Not actually a function, just a pointer to one. Presumably the function pointed-to is a templated protected friend function?
posted by LogicalDash at 5:25 AM on November 19, 2013
jmp
it should probably be something like
jsr ($3000)
Surely
it should probably be something like
jsr ($3000)
Surely
jmp $0x7posted by atbash at 8:35 AM on November 19, 2013
Honest question: in the specific case of systems programming, where I'm assuming that things like the relatively greater type safety that C++ offers aren't as relevant as they would be in application programming, does C++ help facilitate large-scale code organization to a large enough extent to make introducing all that extra complexity worth it? What's the tipping point in project size where it becomes worth it to use it over C?
posted by invitapriore at 9:36 AM on November 20, 2013
posted by invitapriore at 9:36 AM on November 20, 2013
Honest question: in the specific case of systems programming, where I'm assuming that things like the relatively greater type safety that C++ offers aren't as relevant as they would be in application programming, does C++ help facilitate large-scale code organization to a large enough extent to make introducing all that extra complexity worth it? What's the tipping point in project size where it becomes worth it to use it over C?
There's debate over that. Linux creator Linus Torvald's is vocally of the opinion that one should never use C++ for systems programming specifically and probably would be happy if it was never used for any other type of programming either.
But overall there is no agreed upon tipping point. Decisions are not made in a vacuum. Torvald could allow some usage of C++, but he hates it and has a lot of sway so the Linux Kernal probably doesn't use any C++. At this stage in the life of Linux it probably wouldn't make a ton of sense to add C++ anyway, because consistency is pretty valuable in projects. As for new projects, they might use C++ if the team members are more familiar with C++ than C, even if the project is small. Most of the complexity of C++ is optional, after all, and can be avoided if desired.
Some groups, including Microsoft, have even taken non-Systems languages (C# in MS's case) to create experimental operating systems. Microsoft's attempt is called Singularity, but there are others that use different managed languages such as Java.
posted by Green With You at 1:36 PM on November 20, 2013
There's debate over that. Linux creator Linus Torvald's is vocally of the opinion that one should never use C++ for systems programming specifically and probably would be happy if it was never used for any other type of programming either.
But overall there is no agreed upon tipping point. Decisions are not made in a vacuum. Torvald could allow some usage of C++, but he hates it and has a lot of sway so the Linux Kernal probably doesn't use any C++. At this stage in the life of Linux it probably wouldn't make a ton of sense to add C++ anyway, because consistency is pretty valuable in projects. As for new projects, they might use C++ if the team members are more familiar with C++ than C, even if the project is small. Most of the complexity of C++ is optional, after all, and can be avoided if desired.
Some groups, including Microsoft, have even taken non-Systems languages (C# in MS's case) to create experimental operating systems. Microsoft's attempt is called Singularity, but there are others that use different managed languages such as Java.
posted by Green With You at 1:36 PM on November 20, 2013
Fact is, the Linux kernel is fairly object oriented already. It's just all done by hand in C & it's not clear what the benefit would be to port all the rest to C++. Some readability improvements perhaps.
Porting to a language like Rust (which attempts to do away with memory errors via a strong type system which prevents you from shooting your own feet off (unless you really, really want to) )might make sense though.
posted by pharm at 8:49 AM on November 22, 2013
Porting to a language like Rust (which attempts to do away with memory errors via a strong type system which prevents you from shooting your own feet off (unless you really, really want to) )might make sense though.
posted by pharm at 8:49 AM on November 22, 2013
"for a list of people who you probably want to be fixing your computer"
procrastination, I fear you have underestimated the number of MetaFilter non-technological compatriots who would find this brilliant and astonishingly funny writing while not understanding a word of the subject matter. (Don't call me to tune your piano, either!)
posted by Anitanola at 9:29 PM on November 23, 2013
procrastination, I fear you have underestimated the number of MetaFilter non-technological compatriots who would find this brilliant and astonishingly funny writing while not understanding a word of the subject matter. (Don't call me to tune your piano, either!)
posted by Anitanola at 9:29 PM on November 23, 2013
Christ, now I understand why you people play Dwarf Fortress to relax.
posted by Eideteker at 7:11 AM on November 26, 2013 [6 favorites]
posted by Eideteker at 7:11 AM on November 26, 2013 [6 favorites]
« Older Home James, and Don’t Spare the Horses | Lost Roots: The Failure of For-Profit Couchsurfing Newer »
This thread has been archived and is closed to new comments
posted by empath at 3:59 AM on November 18, 2013