Aaron Patterson (tenderlove) is a Senior Staff Engineer working at Shopify where he is focusing on Ruby core and Rails core development.
We’re going to work on a Just-in-time (JIT) compiler for Ruby that’s written in Ruby! 💎
We’re going to start by building a JIT for Ruby from the ground up. First, we’ll learn how Ruby’s virtual machine works, then talk about the CPU itself. Finally, we’ll start building a JIT for Ruby in Ruby.
Chapters
0:00 Welcome!
1:53 About hexdevs
4:10 Sponsor
4:40 Agenda
5:40 Aaron Patterson (tenderlove)
7:18 Difference between Interpreters vs Compilers
9:37 What is a Just-In-Time Compiler?
9:55 Why TenderJIT?
14:39 Compiler Books
16:52 Contributing to Open Source
18:43 Code Execution and Machine Types
19:20 Stack-based machines and YARV (Ruby's VM)
21:26 Terminology
22:51 Control Frame Pointer (CFP)
25:26 Execution Context
25:54 Register Machines (x86, ARM, etc.)
29:30 Is Ruby a compiled language?
30:20 JIT, YJIT, and Ruby Speed
32:53 TenderJIT - a tool to learn how JIT works
33:33 C-Extensions usage and impact
34:41 x86 Instructions
36:00 More about JIT Compilers
40:00 Live Coding - Generating Machine Code with Ruby
45:41 Ruby Pattern Matching
47:01 From Stack Machine to Register Machine
48:20 Aaron's Cat Starts Snoring
48:53 Registers
52:15 InstructionSequence and YARV
57:10 The _END_ trick
57:21 Implementing "add" and "leave" instructions
1:02:10 How JIT Improves Execution Speed
1:07:27 Mixing Stack and Register Machines
1:11:11 TenderJIT and Ruby Benchmarks
1:14:31 How to Contribute to TenderJIT
1:16:20 irb new features (code completion)
1:21:14 Adding a new instruction on TenderJIT
1:31:22 Do I need to know Assembly to contribute?
1:32:07 Implementing Instruction: "newarray"
1:39:06 Debugging
1:45:40 RubyConf Tickets Giveaway
1:48:22 Q&A
1:53:30 Closing Remarks
This session is sponsored by Shopify.
★ About this event: https://www.hexdevs.com/open-source-t...