• What does Rust's “unsafe” mean?

    Rust is an in-development0 systems programming language with a strong focus on no-overhead memory safety. This is achieved through a powerful type system (with similarities to Haskell), and careful tracking of ownership and pointers, guaranteeing safety. However, this is too restrictive for a low-level systems language, an escape hatch is occasionally required. Enter the unsafe keyword.

    1. The code in this post compiles with rustc 0.12.0-pre-nightly (aa0e35bc6 2014-07-22 00:26:21 +0000)

    Read more
  • Error handling in Rust: a k-NN case study

    After posting a Rust translation of some k-nearest neighbour code, I got a few comments asking “how would you handle errors if you wanted to?”. This is the perfect chance to briefly demonstrate a few idioms.

    Read more
  • Comparing k-NN in Rust

    In my voyages around the internet, I came across a pair of blog posts which compare the implementation of a k-nearest neighbour (k-NN) classifier in F# and OCaml. I couldn’t resist writing the code into Rust to see how it fared.

    Read more