In fact, such a book has been written before already: http://patshaughnessy.net/ruby-under-a-microscope
Also of interest might be this series of blog posts currently being written: Reconstructing Ruby in C [0]
[0] http://www.halogenandtoast.com/reconstructing-ruby-our-first...