logoalt Hacker News

troupotoday at 7:56 AM1 replyview on HN

> no one makes their compilers deterministic

I was typing too fast. "No one makes their compilers nondeterministic.

> Even the most widely recognized and used compilers, like gcc, clang, even rustc, are non-deterministic by default.

Wat?

In which world are these compilers producing non-deterministic output if you run them again and again?

> It's fascinating that anyone on HN thinks that compilers converge on always being deterministic

It's called reality that is also very trivially verified.

> I thought we were supposed to know things about computers around here?

That's what I thought, too.


Replies

9rxtoday at 9:37 AM

> In which world are these compilers producing non-deterministic output if you run them again and again?

The one where deterministic iteration order (think use of unordered maps/sets, parallel execution, etc.) isn't considered a priority or is even seen as something to avoid as determinism here can lead to slower compiler times. Where there is use of heuristics that can have a "tie score" without effort to choose the winner deterministically. Where there is a need to support features like __DATE__ and __TIME__. So on and so on. It is a little out of the way so you've probably never heard of it, but its inhabitants call it "Earth".

show 1 reply