Wednesday, January 7, 2015

Episode 39: Rust

Download


Intro Topic: Listener Mailbag





News

Tool of the Show

Rust

  • Overview
    • A memory-safe interpretation of C++
    • Unsafe pointers are not allowed (e.g. x = 0x1234)
    • Type Inference
    • Boxes (memory shared between threads but owned by the creating thread)
    • Traits (interfaces which allow function bodies but no fields)
    • Two runtimes: native and green
      • In Native, each task is a thread
      • In Green, you specify a threadpool and each task is a coroutine
  • History
    • Personal project for a mozilla employee
    • Still in alpha mode (using stable releases is discouraged)
    • Very basic support for thrift for connecting to other languages
  • Pros
    • Uber smart compiler
    • Great standard library
      • Auto serialization to/from json/base64/hex
      • Army of useful collections (BTree, Trie, LRU, Arena, etc.)
    • GraphViz for creating dot files from rust collections
    • Many more
  • Cons
    • Slower than C++ (But not much)
    • Too early to use reliably
    • Third party libraries are lacking / immature