Ruby under a microscope
by Pat Shaughnessy · first published 2014
78% recommend20% neutral2% critical
Why HN recommends it
Approachable tour of how Ruby works internally, covering parsing, the class structure and the YARV virtual machine, without requiring C knowledge. Suits Ruby developers curious about interpreters.
Summarised by Claude from recommending comments
"An under-the-hood look at how the Ruby programming language runs code. Extensively illustrated with complete explanations and hands-on experiments. Covers Ruby 2.x"-- "Ruby is a powerful programming language with a focus on simplicity, but beneath its elegant syntax, the language is performing countless unseen tasks. Ruby Under a Microscope gives developers an inside, hands-on look at Ruby's core, using simple diagrams coupled with clear explanations. Author Pat Shaughnessy takes a scientific approach, laying out a series of experiments with Ruby code to demonstrate how things work. Shaughne
Affiliate links. As an Amazon Associate I earn from qualifying purchases.





…System" [1] to be an excellent starting point, it's written by database veterans James Hamilton and Micheal Stonebraker and references other much deeper works. I've always liked Pat Shaughnessy's work, Ruby under a Microscope was a fantastic introduction to MRI 2.0. I really hope to see more works like these. [1] http://db.cs.berkeley.edu/papers/fntdb07-architecture.pdf
on “Following a Select Statement Through Postgres Internals (2014)” ↗A few books I read for fun this year: - Armada: Ernest Cline - Very disappointing and predictable - Library of Souls: Ransom Riggs - Easy but engrossing book - Ruby Under a Microscope: Pat Shaughnessy - I find his style of explaining things very accessible - Being Mortal: Medicine and What Matters in the End: Atul Gawande - It's a hard subject to think about but helped me to understand…
on “Ask HN: Books you read in 2015?” ↗> My objective is to better understand how computers work, how ruby works... Check out Pat Shaughnessy's Ruby Under a Microscope [0]. It gives a nice overview of the internals of MRI. It doesn't cover a who lot of the C code, but references plenty of it and where it can be found in the source code of MRI. Grab the book, the source…
on “Ask HN: Improve C language skills after K&R?” ↗There's also this wonderful book [1] covering similar ground for Ruby. An extract from a review gives a flavour: "Ruby Under a Microscope" does something fairly ambitious. It attempts to write a system internals book in a language that non computer scientists can readily understand. While there are numerous code snippets and examples to…
on “Python's Innards: Introduction (2010)” ↗I would recommend reading/implementing the below: 1. 'Write a Interpreter in Go' by Thorsten Ball 2. 'Write a Compiler in Go' by Thorsten Ball 3. 'Crafting Interpreters' by Bob Nystrom 4. 'Ruby under a Microscope' by Pat Shaughnessy
on “Ask HN: Technical Summer Reading List” ↗…accomplishment. If you're ever at a Rubyconf, go to his talks. Also love the speed work he's been doing with generational GC. For a primer, Pat Shaughnessy has a great talk you should check out, also Ruby Under a Microscope is a good dive into Ruby.
on “What's New in Ruby 2.1 [pdf]” ↗In fact, such a book has been written before already: http://patshaughnessy.net/ruby-under-a-microscope
on “C for Rubyists” ↗Anyone interested in this kind of content should see Pat Shaughnessy's Ruby Under a Microscope book: http://patshaughnessy.net/ruby-under-a-microscope It's the closest thing we have to a new Ruby Hacking Guide. It's a somewhat gentler, more approachable treatment of the subject matter, but no less awesome. Shaughnessy also has a number of blog posts on his site that dive into the same kind of de
on “Ruby hacking guide” ↗…experience left me in a bad place. Now after all these years, Ruby feels like a breath of fresh air, and the texts that I have come across on the subject - Design Patterns in Ruby, Practical OOD in Ruby, Ruby under a Microscope etc. have increased my interest in the language. But more and more frequent articles on Ruby's decline are pretty disheartening.
on “Python Is Eating the World” ↗I just finished 3 books about internals and I really enjoyed them: - Ruby Under a Microscope - Database internals - Writing An Interpreter In Go Are there any other good books on internals of any technology out there? I don't mind if it's a language or a tool. I just think it's pretty interesting…
on “Ask HN: Any Good Books on Internals?” ↗Ruby Under the Microscope: http://patshaughnessy.net/ruby-under-a-microscope The CS Detective: https://nostarch.com/csdetective Mazes for Programmers: http://www.mazesforprogrammers.com/ A Curious Moon: https://bigmachine.io/products/a-curious-moon/ xchg rax,rax: https://www.xorpd.net/pages/xchg_rax/snip_00.html
on “Ask HN: Most interesting, mildly impractical, well-written books on software?” ↗Ruby Under a Microscope is the first and only technical book I will finish; if you like Ruby and are curious about how things work under the hood it's a joy to read. You need to look for something that actually interests you.…
on “Books that changed my career as a software engineer” ↗This guide is interesting but extremely out of date. I recommend Ruby Under a Microscope[1] though it is also out of date as well (but less out of date than the Ruby Hacking Guide) 1. https://nostarch.com/rum
on “Ruby Hacking Guide” ↗Hi, thanks for the comment and encouragement! If you're looking for books on the internals of Rails, this one could be right up your street: http://patshaughnessy.net/ruby-under-a-microscope If you're looking for more general but advanced books there are loads of fantastic ones - some of my favourites are Eloquent Ruby, Design Patterns in Ruby, Metaprogramming Ruby and there's Crafting Rails App
on “Anyone Can Ride Rails - should I write this book?” ↗Yes - Ruby's internal workings are very mysterious to most people. While the C source code behind Ruby is open source, it's hard to read and understand for most people. In Ruby Under a Microscope, I explain how Ruby works internally… without assuming you know anything about C programming. Why study Ruby internals in the first place? Here are my reasons (from the book's preface): - By studying…
on “Ruby Under a Microscope: Learning Ruby Internals through Experiment” ↗