Random snippets from work

Things which will probably make sense only to other computer people.


One of the things I do at work is code readability reviews, which are the intense initial reviews that everyone has to get before they’re allowed to check anything in. (Style correctness, etc) I just noticed that one of the people doing Python readability reviews is Guido van Rossum.


From a thread at work:

> So this is undefined behavior, and the compiler is free to do
> _anything_, including always returning 0x1234

Language lawyers and compiler people are always threatening to do
things like this when standards call for undefined behavior, but they
never actually do it. The world would be a much more fun place (and
we’d probably find more latent bugs) if gcc had a –psychotic mode.

Truer words were never spoken.

Advertisement
Published in: on September 28, 2006 at 12:31  Comments (13)  
Tags: ,

13 Comments

  1. You work with the guy who does Python?
    That’s pretty awesome.

  2. You work with the guy who does Python?
    That’s pretty awesome.

  3. Oh, that’s beautiful.
    And just think of the uses – finally, a way to demonstrate, without question or reservation, that it doesn’t matter what that module returns, no matter what it will always make the programs behavior worse, just by turning on –psychotic and seeing that the resulting code runs better than the original..

  4. Oh, that’s beautiful.
    And just think of the uses – finally, a way to demonstrate, without question or reservation, that it doesn’t matter what that module returns, no matter what it will always make the programs behavior worse, just by turning on –psychotic and seeing that the resulting code runs better than the original..

  5. If Guido the one suggesting –psychotic mode, or the one suggesting that the compiler could return 0x1234? I’ve always suspected him to be the former sort of guy, it would warm my heart to hear that he was the latter.

  6. If Guido the one suggesting –psychotic mode, or the one suggesting that the compiler could return 0x1234? I’ve always suspected him to be the former sort of guy, it would warm my heart to hear that he was the latter.

  7. He was neither. This was a totally separate thread. 🙂

  8. He was neither. This was a totally separate thread. 🙂

  9. Ok, so the Guido thing was just as a point of reference? 🙂
    A –psychotic mode really would be handy, especially for writing portable code…

  10. Nah, just a separate story.
    As far as the psychotic mode: Someone else on the thread claims that an older version of gcc would start to play nethack when it encountered behavior that was exceptionally out-of-spec. I have no idea if that’s true, but I deeply hope that it is.

  11. …And apparently the nethack story is true, in gcc1.34.

  12. that just rules. 🙂

  13. I was wondering why I was having portability issues with that version of the toolchain…Also, I would love –psychotic mode. Kids these days just don’t get it when you tell them it is nondeterministic: [real exchange at work]
    “…but the version of the compiler we use doesn’t do any of that, it does what we expect.”
    “What do we ship, binary or source?”
    “Source”
    *pointed stare*
    “oh…” *wanders off*
    *sigh*


Comments are closed.

%d bloggers like this: