What Rust can teach us about Ruby
summary
Compares Ruby’s runtime pipeline—tokenize, parse, compile, execute—and MRI bytecode with Rust’s ahead‑of‑time compilation, showing how Rust’s monomorphization turns generic calls into specialized functions and cuts call overhead (example down from 82 to 30 instructions). Notes Ruby method lookup walking an ancestor chain (one real case had 25 ancestors), recommends Ruby under a Microscope, and contrasts Rust’s tooling and distribution (produces a binary, uses Cargo (Rust’s bundler)) and the tradeoff between Ruby’s dynamism and Rust’s static optimizations.
AI-written summary · about
chapters (31)
- 0:00Introduction
- 1:05What are abstractions
- 2:19Turtles
- 2:55Abstractions
- 4:32Operating Systems
- 7:02Learn other programming languages
- 8:19Sorry Koichi
- 8:44Ruby Under Microscope
- 9:19Ruby is slow
- 11:23Steps
- 11:37TwoTwo
- 13:34Different programming models
- 14:22ferrous
- 14:51Rust vs Ruby
- 16:35Ruby method lookup
- 17:13Ruby method lookup chart
- 18:32Ruby code
- 18:55Rust code
- 19:37Assembly code
- 20:30Class methods
- 21:58Assembly
- 22:20Optimizations
- 22:57Assembly instructions
- 23:14Eliminating methods
- 23:42Optimized code
- 24:47Traits
- 25:36Demo code
- 27:54Mix modules into functions
- 28:52Monomorphic
- 30:07Learning other languages
- 33:13All programming languages are cool








