Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Helix: Ruby Native Extensions Without Fear

Helix: Ruby Native Extensions Without Fear

Helix makes writing Ruby classes in Rust safe and fun. Find out how!

Godfrey Chan

April 26, 2017

Transcript

21 slides
  1. Ruby is slow… – Usually it doesn’t matter – Most

    workload are I/O bound – But occasionally it does…
  2. “Best of both worlds” – Native extensions – JSON gem

    – Very fast – Transparent to the user – Date, Pathname, etc…
  3. Meet Rust – Like C: compiled, statically typed, very fast

    – Unlike C: enjoyable to use, guarantees safety – “If it compiles, it doesn’t crash” – Same guarantee as Ruby, but without GC
  4. Zero-cost abstractions™ – In Ruby: tension between abstractions and performance

    – Symbol#to_proc, Enumerable#map, etc – In Rust: no such tradeoff – Compiler is magic
  5. The vision – Keep writing the Ruby you love… –

    …without the fear of eventually hitting a wall – Start with Ruby – Move to Helix when appropriate
  6. Good use cases – Use Rust libraries – Leverage Rust

    web browser tech – Mailer, Background job, Action Cable
  7. Roadmap – Greenfield project – Drop-in replacement – Reopen class

    – Ship to production – Binary distribution – Non-traditional use-cases – Performance parity with C – Miscellaneous features and QoL improvements

More Decks by Godfrey Chan

Other Decks in Programming