Speakerline
Speakers
Proposals
Events
Tags
Edit a proposal
Adam Cuppy
Ahmed Omran
Alan Ridlehoover
Amit Zur
Andrew Mason
Andrew Nesbitt
Andy Andrea
Andy Croll
Asia Hoe
Avdi Grimm
Ben Greenberg
Bhavani Ravi
Brandon Carlson
Brittany Martin
Caleb Thompson
Caren Chang
Chiu-Ki Chan
Christine Seeman
Cody Norman
Devon Estes
Eileen Uchitelle
Emily Giurleo
Emily Samp
Enrico Grillo
Espartaco Palma
Fito von Zastrow
Frances Coronel
Hilary Stohs-Krause
Jalem Raj Rohit
Jemma Issroff
Jenny Shih
Joel Chippindale
Justin Searls
Katrina Owen
Kevin Murphy
Kudakwashe Paradzayi
Kylie Stradley
Maeve Revels
Maryann Bell
Matt Bee
Mayra Lucia Navarro
Molly Struve
Nadia Odunayo
Nickolas Means
Noah Gibbs
Olivier Lacan
Ramón Huidobro
Richard Schneeman
Rizky Ariestiyansyah
Saron Yitbarek
Sean Moran-Richards
Shem Magnezi
Srushith Repakula
Stefanni Brasil
Sweta Sanghavi
Syed Faraaz Ahmad
Tekin Suleyman
Thomas Carr
Tom Stuart
Ufuk Kayserilioglu
Valentino Stoll
Victoria Gonda
Vladimir Dementyev
Title
Tags (comma-separated, max 3)
Body
# Abstract Ruby was designed to make programmers happy. One of the features that makes it possible is a comprehensive _metaprogramming_ tooling. What is metaprogramming? How is it implemented in Ruby? Let's take a look under the hood of the simplest meta-technique–`method_missing`–and discover what lies behind it. And to make this investigation more _meta_-exciting we'll try to re-write it from scratch but in Ruby! So, don't be afraid of C code) # Details Let's discuss first what _metaprogramming_ is: - by example: from well-known DSLs to crazy syntax hacking. _Metaprogramming is all around us._ - by definition: "Metaprogramming is ..." - by structure ("What does metaprogramming consist of?"): code generation, syntax extensions, introspection/reflection (the latter one, of course, is not meta itself but heavily used for). A quick overlook of meta tooling we have in Ruby (open classes, dynamic dispatch, etc.). The main part of the talk–`method_missing`. In my opinion, `method_missing` is the first meta-technique which every Ruby developer got familiar with. But it turned out to be not that simple. Let's dig into it! Our first stop is _dynamic dispatch_ and how it's implemented in Ruby. A quick overview of Ruby object model. **Question #1**: When do we get to `method_missing`? The answer could surprise you (a little bit). That's just a warmup. **Question #2**: Is `method_missing` slow? **Spoiler**: it depends. That's where the most interesting part of talk starts: we found something interesting–`method_missing` behaves differently in different situations. Why so? Let's try to read through all the C source code to find the truth. That's a joke. C code just won't fit the slides) I know a better way – **let's implement our own dynamic dispatch in pure Ruby**! (By the way, using different metaprogramming techniques along the way). There gonna be three (or four) iterations: form the naïve one, without any optimization, to the high-level one with caching techniques and monkey-patching awareness. That's how I'd like to demonstrate that Ruby is an excellent piece of software, with brilliant _hidden gems_ inside. As a bonus (=more practical) part of the talk I'd like to demonstrate one meta-technique related to the main topic – **lazy method missing**. The primary goal of this talk to shed light on the internals of some Ruby features, to make it easy to understand, how Ruby VM works, and share a handful of practical tips. Explaining Ruby core through pure Ruby makes this talk relevant to Rubyists of any level! # Pitch This talk covers two topics: Ruby metaprogramming and Ruby internals. The first one is an everyday tool and the second one is a _forbidden forest_ for most Ruby developers. Learning Ruby internals is hard: it's a 25 years C codebase with dozens of 1000+ LOC files! What makes us happy requires a lot of effort and doesn't look _attractive_ at all. On the other hand, understanding how things work could help you to become a better developer. The goal of this talk is to make the gap between the Ruby source C code and the "happy" Ruby code as small as possible. **Learn Ruby through Ruby!**–the motto of my talk.
Back to Speaker Directory