
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.

Ruby Under a Microscope: An Illustrated Guide to Ruby Internals 1st Edition
Ruby is a powerful programming language with a focus on simplicity, but beneath its elegant syntax it performs countless unseen tasks.
Ruby Under a Microscope gives you a hands-on look at Ruby's core, using extensive diagrams and thorough explanations to show you how Ruby is implemented (no C skills required). Author Pat Shaughnessy takes a scientific approach, laying out a series of experiments with Ruby code to take you behind the scenes of how programming languages work. You'll even find information on JRuby and Rubinius (two alternative implementations of Ruby), as well as in-depth explorations of Ruby's garbage collection algorithm.
Ruby Under a Microscope will teach you:
- How a few computer science concepts underpin Ruby's complex implementation
- How Ruby executes your code using a virtual machine
- How classes and modules are the same inside Ruby
- How Ruby employs algorithms originally developed for Lisp
- How Ruby uses grammar rules to parse and understand your code
- How your Ruby code is translated into a different language by a compiler
Covers Ruby 2.x, 1.9 and 1.8
- ISBN-101593275277
- ISBN-13978-1593275273
- Edition1st
- PublisherNo Starch Press
- Publication dateNovember 22, 2013
- LanguageEnglish
- Dimensions7 x 0.88 x 9 inches
- Print length360 pages
What do customers buy after viewing this item?
- Most purchased | Highest ratedin this set of productsPractical Object-Oriented Design: An Agile Primer Using RubyPaperback
- Lowest Pricein this set of productsEffective Testing with RSpec 3: Build Ruby Apps with ConfidencePaperback
Editorial Reviews
About the Author
Well known for his coding expertise and passion for the Ruby programming language, Pat Shaughnessy blogs and writes tutorials at https://patshaughnessy.net/. He also develops Ruby applications at management consulting firm McKinsey & Co. Shaughnessy is a regular presenter on the Ruby conference circuit, and his articles and presentations have been featured in the Ruby Weekly newsletter, the Ruby5 podcast, and The Ruby Show.
Product details
- Publisher : No Starch Press; 1st edition (November 22, 2013)
- Language : English
- Paperback : 360 pages
- ISBN-10 : 1593275277
- ISBN-13 : 978-1593275273
- Item Weight : 1.48 pounds
- Dimensions : 7 x 0.88 x 9 inches
- Best Sellers Rank: #145,094 in Books (See Top 100 in Books)
- #6 in Ruby Programming
- #61 in Object-Oriented Design
- #127 in Microsoft Programming (Books)
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
General lessons are learnable here that apply to lots of languages too.
Me, being a Windows OS guy, I look to major references like Microsoft Press’ “Windows Internals” to understand how things really work – not just at the surface – but why something does what it does. For example, if the distributed processing calls (DPC) result in interrupts consuming the processor, I know I’m usually looking at a driver or hardware problem.
“Ruby – Under a Microscope” is much like “Windows Internals” in that the how and why of Ruby is revealed.
What should be clear from the idea of an in-depth, deep technical details book – this isn’t for the beginner, like Microsoft Press’ “Windows Internals” isn’t for the newbie Windows OS user. If you don’t know what DPCs are and what they do – knowledge of DPCs is pretty much useless. To get the full value from this book, you should already be an experienced Ruby programmer (or have depth in similar languages). What the experienced developer will get from this book is the details that will allow them to extract more power from Ruby, better understanding of why things happen, and how to better use Ruby to solve the really hard problems.
Now that we’re past the “who this book is for” part, there is one more thing to understand before you decide that this is of value to you: Exactly WHICH Ruby are we talking about? Yes, Ruby is available on nearly all platforms. However, this is because some hard working people wanted to make sure that the language was widely available, and these hard working people made it available on platforms other than what the original Ruby was developed for.
So, how do you know which version of Ruby this book is focused on? The book is focused on the Matz (Yukihiro “Matz” Matsumoto) Ruby Interpreter, written in C. Other implementations are discussed, and these are discussed in the context of how others implemented the language that Matz created in 1993.
The book treats Ruby as a science study, much like a scientist would study microbes (“…Under a Microscope”, get it?). Instead of looking at organisms, the book looks at the base elements of Ruby: The actual ‘C’ source code. If you’re a computer science major, this is nothing new. The source code is studied to understand what Ruby does to perform the tasks that you give it. As you go through the book and look at Ruby at the very base elements, you can gain a complete understanding of how computers really work. There is nothing more basic than the process of providing information to a computing machine and seeing how the actual process of creating tokens, parsing of tokens, compiling into an intermediate format, and then passing onto the virtual machine (YARV – Yet Another Ruby Virtual Machine) that interfaces at the machine level. Once the processing is complete, understanding how to receive the output, convert it back into something that the programming language can understand is absolutely vital to knowing why things work. And, probably most importantly, knowing what’s wrong when they don’t work.
This is the real goal of “Ruby: Under a Microscope”. Providing understandable information for the knowledgeable programmer to gain a deep understanding of what Ruby is, what it does, and how it attains the goals that it sets for itself. This opens the door wide open for those that want to add to the language with libraries and extensions – which is the real power of a successful language: Expansion by anyone with a great idea.
---
If you're curiosity for how things work (like me), you'll really enjoy this book. The seemingly "magic" things that Ruby does all have a clear and straightforward, step-by-step, explanation.
What I liked:
* The book is well organized and explains some very complicated topics in a very understandable way.
* Figures are repeated so you don't have to flip back and forth (a little thing but very helpful)
* Has a very computer-science-like feel to it. It's a fun read if you're a computer science geek like me.
What I didn't like:
* The chapter on JRuby is severely lacking in my opinion. Given that the other chapters did a nice deep dive on the given topic, I felt a little bit cheated on the JRuby chapter. This was more of a really broad overview of JRuby with one or two examples.
* The book explains a complicated topic in several chapters but you're left to put everything together on your own. I would have liked to have seen one additional chapter that took a sufficient Ruby program and did a full walk through of all the concepts you'd learned in the previous chapters; basically, a top to bottom overview chapter.
Who can/should read this:
* Anyone interested in programming languages or implementing your own programming language.
* Those who want to become better Ruby developers.
Prereqs:
* You'll need to know a little bit of C to understand the standard Ruby implementation examples but other than that, there's no prereqs. You don't really even need to know Ruby that well ( I don't ). If you don't understand what the piece of Ruby code is doing, it's easy to look up online to quickly figure out what it does.
Top reviews from other countries



