Towards a Ruby compiler
summary
A prototype compiler called Ocelot turns Ruby into C by running the unit tests to record actual runtime shapes and method targets, using type induction and eval precience to specialize call sites into switch-based direct calls, inline instance variables into C structs, and inline static eval strings. Unexpected cases fall back to RB_FUN into the interpreter and emit warnings that drive test expansion; method_missing is supported by emitting explicit calls. Work status: type induction is almost finished, next step is C code generation.
AI-written summary · about
chapters (4)
- 0:00Start
- 0:21Ocelot: A Ruby Compiler
- 12:58Mocks
- 19:30Both compilers and processors can benefit from explicit knowledge of the targets of callsites.
related talks
01h 12mOpening Keynote – Yukihiro 'Matz' Matsumoto
38mRubyX: Compiling Ruby and it's effect on the community
39mMatz Q&A
32mExperiments in sharing Java VM technology with CRuby
33mRuby the Hard Way: Writing Bytecode to Optimize Plain Ruby
48mRapid Programming Language Prototypes with Ruby RACC
39mSteal This Talk: The Best Features Ruby Doesn't Have (Yet)
28mA Plan towards Ruby 3 Types
