
@theohonohan@graphics.social
Interested in the roots of design
My experience is that you have to talk to different people about undefined behavior differently.
Some people have drunk deeply from the well of symbolic logic. Once you say "this is stuff the compiler ASSUMES won't happen", they're like "omg then if it did happen, you have a contradiction, and then anything follows! nasal demons! cats and dogs living together!" and never write a C program again.
Some people are like "that's stupid, the compiler turns each line of C into a few assembly instructions, it's not rocket science. I know what's going to happen." To these people, you have to explain what an optimizing compiler is. Sometimes you take the trouble to convince them, and then while you're not looking they become unconvinced again. It's a process.
But I think most people are in between. They just kind of narrow their eyes and are like "I don't think nasal demons are actually a thing, level with me, what really happens?" You know, reasonable, pragmatic human beings.
So in Programming Rust, we talk about where most security bugs come from, and every once in a while we show weird things that can happen, using real code.
I said all that so I could say this: The code in our book is almost all under test. Tests run on every push. So we trigger undefined behavior regularly on this project. Ironic, I know. To my knowledge this hasn't caused anything unusual to come out of my nose, but I guess technically they could appear anywhere. If you see any nasal demons running around... could be us. Sorry.