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

Rustler

phonnz
March 03, 2021

 Rustler

Rustler is a library for writing Erlang NIFs in safe Rust code. That means there should be no ways to crash the BEAM (Erlang VM). The library provides facilities for generating the boilerplate for interacting with the BEAM, handles encoding and decoding of Erlang terms, and catches rust panics before they unwind into C.

The library provides functionality for both Erlang and Elixir, however Elixir is favored as of now.

phonnz

March 03, 2021
Tweet

More Decks by phonnz

Other Decks in Programming

Transcript

  1. Elixir • Functional language (10 years). • Erlang BEAM runtime.

    • Process order (M) • Macro system. • Let It Crash philosophy. • Concurrency. • Other languages best practices based.
  2. • C functions. • Transparent functions. • Shared Library. (SO,

    dll) • Runtime loadable. NIFs • Dynamically linked • Fastest way of calling C-code, Rust, Go.
  3. Rustler • Erlang NIFs • Safe Rust Code • No

    BEAM crash • Catches rust panics. • Supports Erlang as well • Decoding Rust Values • Encoding Rust values • Type composition • Safe reference passing.