1. 11

  2. 3

    Perfect Replayability sounds like a great language feature. Deterministic execution guarantees even with multiple threads, no undefined behaviour, no Heisenbugs.

    1. 1

      Replay provides this for web development.

    2. 2

      I believe that non-determinism is the bane of humanity.

      This kind of sounds like the evils of side effects. Pure functions are so much easier to work with and reason about … but almost all programs require some sort of I/O, which is a side effect. Likewise, you can’t have useful things like pre-emptive threading without non-determinism, just because you can’t predict when external events like keystrokes or network packets or hardware timeouts occur.

      From the related page on Perfect Replayability, though, it sounds like what’s being discussed isn’t getting rid of non-determinism, but recording non-deterministic behaviors so the program can be replayed identically for debugging. Which sounds wonderful!

      1. 2

        Their program’s outputs depend on the “order” of elements in a hash map. The author doesn’t want to change that, and I’m curious why.

        In my opinion, a hash map is intrinsically unordered, and if you “iterate over” a hash map then you should think about the results non-deterministically. If you call “head” on a hash map (what ever that means), proceed as if you received one of the hash map’s elements uniformly at random.