~/talk

How to implement a RubyVM with PHP?

Talkat RubyKaigi 2024 · 2024-05-15..05-17· [ruby, compilers-and-language-design]
name:memory
links:none on file
slides:none on file

A Ruby VM written in PHP reads YARV binaries from disk, read binary YARV headers with fread/fseek/unpack, parses global-object and iseq offsets, implements readSmallValue and loadObject, and executes a tiny subset of bytecodes. The implementation handles only four opcodes for Hello World—putself putstring opt_send_without_block leave—while noting >50 metadata fields exist, ~100 opcodes are commonly used (≈200 total, +6 in 3.3). Repo is on GitHub and the demo runs Hello World and FizzBuzz.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 5:24What is RubyVM and YARV
  3. 12:25Reading Ruby core code
  4. 20:21Processing instruction sequences
  5. 27:40Implementing bytecode execution
  6. 33:44Demo of RubyVM in PHP
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.