

Ruby MRI Source Code Idioms #1: Accessing Data Via Macros - rjsamson
http://patshaughnessy.net/2013/1/23/ruby-mri-source-code-idioms-1-accessing-data-via-macros

======
haberman
MRI is the first language interpreter that I got deeply familiar with and it's
a pleasure to read. It was really nice to be able to find the answer to
questions like "how does Ruby decide when to trigger a thread switch" by
spending just a few minutes going to the source.

~~~
pat_shaughnessy
Absolutely - it is a pleasure to read. Someday I'd like to learn how another
language is implemented, maybe JavaScript or something like Haskell, but I'm
afraid the language source code will be much more difficult to understand than
Ruby's is.

~~~
dysoco
You can maybe start with a Scheme parser, it's quite simple.

~~~
pat_shaughnessy
Interesting idea - thanks for the suggestion!

~~~
pimeys
SICP - chapter 4.

[http://mitpress.mit.edu/sicp/full-text/book/book-
Z-H-25.html...](http://mitpress.mit.edu/sicp/full-text/book/book-
Z-H-25.html#%_chap_4)

One of the best chapters in any book I've ever read. So mindblowing.

Or if you prefer the video form, here:

[http://ocw.mit.edu/courses/electrical-engineering-and-
comput...](http://ocw.mit.edu/courses/electrical-engineering-and-computer-
science/6-001-structure-and-interpretation-of-computer-programs-
spring-2005/video-lectures/7a-metacircular-evaluator-part-1/)

[http://ocw.mit.edu/courses/electrical-engineering-and-
comput...](http://ocw.mit.edu/courses/electrical-engineering-and-computer-
science/6-001-structure-and-interpretation-of-computer-programs-
spring-2005/video-lectures/7b-metacircular-evaluator-part-2/)

~~~
pat_shaughnessy
Yup, (re)reading SICP is definitely on my list!

------
doktrin
Very interesting indeed, sir. I've personally also found a lot of joy in
diving down into C implementations (in my case, the JNI, although Ruby is my
language of choice).

You've certainly inspired me to take a closer look at the MRI, as well as
macros in general. Thanks!

------
danso
Cool work, again, Pat. Makes me wish I was back in school and could justify
spending more time on looking at the internals and finding that satisfaction
in knowing how things truly work under the hood.

~~~
pat_shaughnessy
Thanks! Yea for some reason learning how things work is often more satisfying
to me than building stuff... I guess I'm more of a scientist than an engineer?

