TRWTF is me
-
I just figured out what was causing my Cool2013 compiler to produce programs that crashed, seemingly at random. It was my "optimization" for
−expr
, which, in pseudocode, went like this:Note that integers are boxed in Cool, and the only register that can be cloned is register A. Cloning a value destroys the values in other registers.
Compute expr as an unboxed integer and place the result in register A Load the address of the template integer literal into register A Negate the value in register A Store the value of register B in the location of the first attribute of the location pointed to by register A Clone register A
So instead of negating a value, my compiler's version of unary minus negated the pointer to the integer box template and then stored an arbitrary value left over from a previous computation in this new, almost certainly invalid object.
Thank goodness for unit tests.
In the words of my professor, “Your optimizer produces correct code some of the time. Of course, the optimizer always producing a NOP for your entire program is correct some of the time, and it's a whole lot faster than what you're doing.”
-
@Ben L. said:
In the words of my professor, “Your optimizer produces correct code some of the time. Of course, the optimizer always producing a NOP for your entire program is correct some of the time, and it's a whole lot faster than what you're doing.”
I like this guy.
-
-
@Mcoder said:
@morbiuswilters said:
I like this guy.
Where's you baloon, morbius?
I removed it after somebody said it was annoying. I had my fun, though, and I never really intended to keep it permanently.
-
I, for one, really enjoyed the balloon and was hoping to have it appear by my non-avatar....
Also, I have never seen you buckle to peer pressure before. What have you done with the real Morbius?
@morbiuswilters said:
@Mcoder said:
I removed it after somebody said it was annoying. I had my fun, though, and I never really intended to keep it permanently.@morbiuswilters said:
I like this guy.
Where's you baloon, morbius?
-
Hey I didn't know about railroad diagrams. That's pretty cool.
-
@morbiuswilters said:
I removed it after somebody said it was annoying. I had my fun, though, and I never really intended to keep it permanently.
I got ya covered.
-
@Ben L. said:
Was that Dr Joe Newcomer?In the words of my professor, “Your optimizer produces correct code some of the time. Of course, the optimizer always producing a NOP for your entire program is correct some of the time, and it's a whole lot faster than what you're doing.”
-
Wait, I thought you were in High School..
-
@morbiuswilters said:
Wait, I thought you were in High School..
Yep. Class of 2013. I got bored so I also took some college courses, with the permission of the professor.
-
@Ben L. said:
@morbiuswilters said:
Wait, I thought you were in High School..
Yep. Class of 2013. I got bored so I also took some college courses, with the permission of the professor.Goddamn kids nowadays. Why can't you join a gang or beat up old people like we did when I was your age?
-
@alegr said:
@Ben L. said:
Was that Dr Joe Newcomer?In the words of my professor, “Your optimizer produces correct code some of the time. Of course, the optimizer always producing a NOP for your entire program is correct some of the time, and it's a whole lot faster than what you're doing.”
-
@joe.edwards said:
@alegr said:
I... what...@Ben L. said:
Was that Dr Joe Newcomer?In the words of my professor, “Your optimizer produces correct code some of the time. Of course, the optimizer always producing a NOP for your entire program is correct some of the time, and it's a whole lot faster than what you're doing.”
Why did I read that? Why did I read Green Bits on WAN?
-
@joe.edwards said:
@alegr said:
@Ben L. said:
Was that Dr Joe Newcomer?In the words of my professor, “Your optimizer produces correct code some of the time. Of course, the optimizer always producing a NOP for your entire program is correct some of the time, and it's a whole lot faster than what you're doing.”
Thank you, sir, I have found my new sig!
-
@Ben L. said:
Note that integers are boxed in Cool, and the only register that can be cloned is register A. Cloning a value destroys the values in other registers.
"Yes sir, we can make you a twin brother by cloning you, there's just a small detail, as soon as we do that, you're gonna die immediately."
...not really what I'd call "cloning". Is the compiler funny, or is it a standard thing to do in this operation, and the guy who named it was a funny one?
-
@SEMI-HYBRID code said:
@Ben L. said:
Note that integers are boxed in Cool, and the only register that can be cloned is register A. Cloning a value destroys the values in other registers.
"Yes sir, we can make you a twin brother by cloning you, there's just a small detail, as soon as we do that, you're gonna die immediately."
...not really what I'd call "cloning". Is the compiler funny, or is it a standard thing to do in this operation, and the guy who named it was a funny one?Generally, you don't store the only reference to persistent data in a scratch register.
-
@spamcourt said:
Hey I didn't know about railroad diagrams. That's pretty cool.
I've seen them before in SQLite's syntax documentation, not sure if somewhere else.But apparently it's a thing and not just the name they called them just there.
-
@Zecc said:
I first saw them here.@spamcourt said:
Hey I didn't know about railroad diagrams. That's pretty cool.
I've seen them before in SQLite's syntax documentation, not sure if somewhere else.But apparently it's a thing and not just the name they called them just there.
-
@Ben L. said:
@Zecc said:
I first saw them here.@spamcourt said:
Hey I didn't know about railroad diagrams. That's pretty cool.
I've seen them before in SQLite's syntax documentation, not sure if somewhere else.But apparently it's a thing and not just the name they called them just there.
I first saw them before you were born.
-
@boh said:
I first saw them before you were born.
@boh said:Filed under: Hacking Turbo Pascal 4 in 1990
If I were a pedantic dickweed I'd write "I don't know about spamcourt but I was born before that".
Tangentially: I've gone nostalgic for ZX Spectrum games and finally liberated the whole Blacktooth Empire a couple of days ago. I still haven't been able to collect more than 2 pieces of the Batcraft at a time though.
-
My Apple ][+ (bought 1979) came with UCSD Pascal and a copy of Jensen and Wirth: Pascal User Manual and Report, first published 1974. The syntax diagrams starting on page 11 of the fourth edition are as I remember them.
-
@flabdablet said:
My Apple ][+ (bought 1979) came with UCSD Pascal and a copy of Jensen and Wirth: Pascal User Manual and Report, first published 1974. The syntax diagrams starting on page 11 of the fourth edition are as I remember them.
TRWTF is the price Amazon charges for an obsolete book.
-
@Zecc said:
@boh said:
He was replying to me.I first saw them before you were born.
@boh said:Filed under: Hacking Turbo Pascal 4 in 1990
If I were a pedantic dickweed I'd write "I don't know about spamcourt but I was born before that".
Tangentially: I've gone nostalgic for ZX Spectrum games and finally liberated the whole Blacktooth Empire a couple of days ago. I still haven't been able to collect more than 2 pieces of the Batcraft at a time though.
-
-
-
@mikeTheLiar said:
@Ben L. said:
1994
Goddam I feel old.If it makes you feel any better, the unstoppable downhill slide towards death, irrelevance and nothingness that you started the moment you were born requires nothing of you to continue. You can just sit back and death will still find you and take you, just as surely as if you jumped in front of a train, except for an extra flicker of life so brief and tiny and irrelevant as to not even be visible when compared to the age of the universe.
And Ben is on that same downward trajectory to non-existence, except he is a but a gnat's fart behind you. When compared to the age of Things That Matter, you and Ben are--and always will be--trivially, horrifyingly young.
-
@morbiuswilters said:
Pseudo-profound bullshit.
I should have been a pair of ragged claws
Scuttling across the floors of silent seas.
-
@mikeTheLiar said:
@morbiuswilters said:
Pseudo-profound bullshit.
I should have been a pair of ragged claws
Scuttling across the floors of silent seas.+1