~/talk

Taking Elixir to the Metal with Rust

Talkat NDC London 2017 · 2017-01-16..01-20· [rust]
speakerdeck:scrogson
slides:none on file

Shows how to replace unsafe C NIFs with Rust using Rustler, including automatic term encoding, panic catching and a JSON example. A naive call using the Rust JSON crate blocks the BEAM for ~1.5s and spikes reductions; reworking the parser into a chunking approach with resource objects yields far better scheduler behavior (reports ~11,300 reductions instead of stalling). Alternatives demonstrated: spawn OS threads to return results asynchronously, or use dirty NIFs/dirty schedulers for long CPU or I/O work.

AI-written summary · about

  1. 0:00Start
  2. 7:34Why write a NIF?
  3. 10:02ERL_NIF_TERM
  4. 15:12Getting Started
  5. 15:31Using master
  6. 15:58Fetch Dependencies
  7. 16:30Add Rustler Compiler
  8. 16:51Configure Rust Crates
  9. 20:09Simple Approach
  10. 20:34decoder.rs
  11. 23:12Let's time our NIF
  12. 24:02Warning
  13. 26:37Thread Progress
  14. 27:40Don't Block the Schedulers!
  15. 28:41Counting Reductions
  16. 30:34json.ex
  17. 31:37NIF Resource Objects
  18. 33:20decode_iter
  19. 36:41Chunking Result
  20. 37:08Rescheduling
  21. 38:31Threaded NIFS
  22. 41:00Dirty NIFS
  23. 42:37Acknowledgements
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.