~/talk

Implementing Virtual Machines in Ruby (and C)

Talkat RubyConf 2016 · 2016-11-10..11-12· [ruby]
slides:none on file

Shows a concrete VM design and several runnable implementations: a simple opcode set (push add print exit) with a dispatch loop, a Ruby version that compiles opcodes to direct calls, and a tiny C interpreter that compiles dispatch tables. Demonstrates a working loop counting 13 down to 0, sandboxing by blacklisting methods, and experiments with indirect/direct threading and JITting machine code. Uses 20 lines of C for the core demo, uses Fiddle/FFI and malloc and claims a theoretical 100-fold speedup for threaded dispatch.

AI-written summary · about

  1. 0:00Introduction
  2. 0:56Machine Philosophy
  3. 2:53Emulation
  4. 5:11What is a VM
  5. 7:16What is a computer
  6. 13:00C
  7. 15:51Program Interpretation
  8. 17:22Optimize Dispatch
  9. 20:10Blacklist
  10. 22:53Interpreter
  11. 25:10Dispatch Loop
  12. 30:10Dispatch Compilation
  13. 33:15Virtual Machine V1
  14. 40:05Register Machines
  15. 43:35Ruby assembler
  16. 46:45Books
~/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.