

Ruby Under a Microscope: Learning Ruby Internals through Experiment - lest
http://patshaughnessy.net/ruby-under-a-microscope

======
jstorimer
Before Pat announced he was writing an ebook, I was following the articles he
wrote on his blog. He has a real knack for making difficult concepts easy to
understand using diagrams and simple language. And on top of that, he asks
interesting questions. You might think that Ruby internals are a dull topic,
but everything I've seen him cover has fascinated me.

Because I've already learned so much from this articles, I was eager to buy
this when I saw the announcement in my inbox.

------
pat_shaughnessy
Thanks for posting this :) ...I'm happy to answer any questions anyone has.

~~~
Who828
Hey pat, how do you understand the internal code so well ? I read your free
chapter on Ruby's Hash table and I loved every bit of it. It would be great if
you can share the process you go through when you read the source code, so
maybe I can apply it in the future. By the way, congrats for the release !

~~~
petercooper
The code for MRI is.. idiomatic, but actually pretty easy to read. I last did
C full time in the 90s and so am mostly just a 'reader' now but it's not hard
to follow, although some of the _reasoning_ behind doing things a certain way
in MRI is unfathomable.. ;-)

~~~
JulianWasTaken
I don't understand the wording of your first sentence. Did you mean "idiotic"
or?

~~~
JonnieCache
<https://encrypted.google.com/search?q=define%3Aidiom>

~~~
JulianWasTaken
Yes, thanks. I know what idiomatic means, but the OP either does not or just
wrote an awkward sentence.

------
squidsoup
Is anyone aware of a similar book covering Python internals at this level of
depth?

------
Willy_nourson
Ah weird, I always assumed "modern" programming languages were bootstrapped
(for all the advantages that it implies), didn't know it's not the case for
Ruby. Good to know.

~~~
randomdata
I guess that depends on what you consider Ruby. MRI isn't, but Rubinius is.

------
vaneyckt
It's just raining amazing Ruby books lately. Last week there was Working With
TCP Sockets and now this. I'm having trouble finding time for them all :).

~~~
danneu
Cool, I just bought Ruby Under a Microscope and then looked up
<http://workingwithtcpsockets.com/> to buy that book, too.

I'm at a point in my Ruby career where I've begun peeking under all the
abstractions I use after hitting performance bottlenecks. Performance has even
led me to all sorts of new tools like using a SAX XML parser (using the Ox
gem) instead of trying to walk the XML DOM in memory with Nokogiri.

~~~
Argorak
Just out of curiosity:

Nokogiri has SAX capabilities as well
(<http://nokogiri.org/Nokogiri/XML/SAX/Document.html>). Any reason not to use
them, especially as Nokogiri also has native JRuby support?

~~~
danneu
It was just for fun. Both SAX APIs are sorta nebulous as it is to someone like
me who's been so used to an abundance of tutorials on the tools I regularly
use. Ox's SAX API was better, though.

I had just wanted to speed up my XML parser and stumbled upon a Nokogiri vs Ox
benchmark (<http://www.ohler.com/dev/xml_with_ruby/xml_with_ruby.html>). So I
tried Ox.

Here's my effort to benchmark Nokogiri vs Ox, DOM vs SAX parsing on an 80mb
XML file with 38k nodes: <https://gist.github.com/3977120>

    
    
        Ox DOM: 6 seconds (550mb)
        Ox SAX: 6 seconds (12mb)
        Nokogiri DOM: 13 seconds (900mb)
        Nokogiri SAX: 24 seconds (11.8mb)
    

I'm no benchmarking wizard, though.

~~~
Argorak
Thank you!

------
marizmelo
why not make available on Amazon as kindle version? I always think twice
before share my card info on random websites.

~~~
petercooper
I'd usually agree with a comment like this but in this case, it has so many
(useful) color diagrams that while it wouldn't be impossible to put on the
Kindle, I don't think you'd get an amazing experience. Could be wrong though!

~~~
marizmelo
Since kindle fire, the books can be posted in colors :)

~~~
petercooper
That's true, but I suspect the vast majority of Kindle users and buyers are
stuck on 6" greyscale screens which aren't great for diagrams or code without
a _lot_ of care. "Source code looks horrible on the Kindle edition!" is one of
the most common complaints I've seen on Kindle books so far, but it's
definitely getting better.

------
ryandelk
Great work, Pat!

------
elliotlai
"Ruby Under a Microscope" I was expecting some beautiful images ... nevermind,
my bad

~~~
petercooper
Enjoy this one: <http://micro.magnet.fsu.edu/birthstones/pages/ruby.html>

~~~
pat_shaughnessy
Nice! I think I have my design concept for RUAM part 2! :)

