Sunday, March 29, 2015

Rust: fib

Rust is an interesting language. It is not a primitive one, like Go where we don't have ADTs, pattern matching and generics (but we do have Nils). And it's advertising as a safe and performant system language. Today is the very first day I'm looking at it. Let's "smoke" test it with Fibonacci :)


Debug: 3.44 seconds, release: 1.66 seconds. This is not very impressive, but pretty fast indeed.
  • C# - 1.26
  • D (DMD) - 1.3
  • F# - 1.38
  • Nemerle - 1.45
  • Rust - 1.66
  • Haskell - 2.8
  • Clojure - 9
  • Erlang - 17
  • Ruby - 60
  • Python - 120
It's very interesting how it'll behave in concurrent Fibonacci test.

The compiler is quite slow: it takes 2-3 seconds to build this tiny program.

No comments: