Writing a Microservice in Rust
Minor nitpick:<p>> Immutability (const) by default<p>The author clearly knows this, but others may not, so: immutability and "const" aren't the same thing. Const typically prevents name rebinding (as the type system permits). Immutability is the presumption that the whole data structure can't be mutated by default (though there are usually ways to mutate cheaply--without bulk copying, that is--provided by most immutable data APIs).<p>Const works like this:<p><pre><code>  not_const int[] foo = [123, 456]
  const int[] bar = [456,789]
  foo = [1,2,3]     // no problem; rebinding is allowed if it meets the 'int' type constraint.
  bar = [1,2,3]     // compile error!
</code></pre>
Immutability, <i>as typically defined</i> (there's a bit of a semantic debate here sometimes) prevents changes to the contents of complex data structures:<p><pre><code>  mut int[] foo = [123, 456]
  not_mut int[] bar = [456,789]
  foo[0] = 789    // no problem; mutation is allowed so long as it's with valid types.
  bar[0] = 123    // compile error!
</code></pre>
Edit: missed a space.