1. 15
    1. 9

      There must be some kind of Completeness Theorem for language design that you can’t have a language that is consistent, concise, and free from unexpected edge cases at the same time.

      1. 1

        Does Lisp have unexpected edge cases? Brainfuck seems to fit all three, as do many other esolangs. Does practicality imply unexpected edge cases?

        I’ve seen a lot of people say “complexity” can add holes / warts to a language, but I think in this case it was Rust’s decision to go all in on the ownership model. Pony, for example, chose differently, and it has a memory model that I find much easier to reason about. Deny capabilities like trn and iso express semantics that Rust can only emulate with ownership + unsafe.

        1. 2

          Brainfuck seems to fit all three

          Concise—really?

          Does Lisp have unexpected edge cases?

          Here’s one I’ve seen multiple people stumble over: ‘nil’ is the bottom type, while ‘null’ is the type whose sole inhabitant is the symbol ‘nil’.

    2. 5

      This is a good list of gotchas in Rust, but for anyone unfamiliar with Rust, these are very different from gotchas in other languages. These are gotchas that the compiler will refuse to compile, and will throw a relevant error message with a link to why it won’t compile.

      I think it’s important to note these are not gotchas similar to JavaScript or C++ gotchas, which are not caught by the compiler/interpreter ahead of time and cause unexpected behavior.

      Just wanted to put a disclaimer for anyone who is interested in learning Rust, but is put off by this list. It’s real, but it’s also not something you have to keep in your mind while working and the compiler will check it for you :)