Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby without the Syntax
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Syed Faraaz Ahmad
December 16, 2023
0
99
Ruby without the Syntax
Syed Faraaz Ahmad
December 16, 2023
Tweet
Share
More Decks by Syed Faraaz Ahmad
See All by Syed Faraaz Ahmad
BYOJ: Build your Own JIT (RubyConfTH 2023)
faraazahmad
0
66
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
100
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
230
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
72
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
Designing Powerful Visuals for Engaging Learning
tmiket
0
220
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Building AI with AI
inesmontani
PRO
1
680
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
Google's AI Overviews - The New Search
badams
0
900
Transcript
ruby without the syntax
Faraaz Ahmad Twitter: @Faraaz98 Github: faraazahmad
interpreted? / compiled?
Y E S
Compiled, then interpreted 1 + 2 putobject 1 putobject 2
opt_plus leave
Yet Another Virtual Machine a.k.a YARV putobject 1 putobject 2
opt_plus leave YARV 010101010101 100001010101 001010101010 101000010101 010100001011
W.W.Y.D. What Would YARV Do?
github.com/ruby/ruby
Ruby on Cocaine…
Ruby C API
Ruby: def foo; end YARV: definemethod foo C API: rb_define_global_function(
"foo", my_method, argc );
class.c
Top level methods are stored in the Kernel module >
puts 25 25 => nil > Kernel.puts 25 25 => nil
Top level methods are stored in the Kernel module >
def foo = 420 => :foo > Kernel.private_methods => [..., :foo, ...]
None
PseudoRuby Examples
Init the VM
Sum of 2 numbers
Sum of 2 numbers
Area of circle
Area of circle
Define module and class
You can do all of it (I think) rb_require(...); rb_load(...);
rb_raise( rb_eRuntimeError, "Error code %d", 404 ); VALUE gv; rb_gv_set("$x", gv); gv = rb_gv_get("$x"); iv = rb_iv_get(obj, "@x");
Comparison
Ship your Ruby program as a single binary
Resources http://silverhammermba.github.io/emberb/c/ http://github.com/faraazahmad/pseudoruby
But why?
But why not?
None
None
None
Mess-around driven development
Mess-around driven development
Mess-around be nice. have fun.
Thank you