# Learning how Ruby compiles etc

**URL:** <https://www.ruby-forum.com/t/learning-how-ruby-compiles-etc/81040>\
**Category:** Ruby\
**Created:** [January 3, 2007, 8:55am UTC](https://www.ruby-forum.com/t/learning-how-ruby-compiles-etc/81040 "2007-01-03T08:55:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [January 3, 2007, 8:55am UTC](https://www.ruby-forum.com/t/learning-how-ruby-compiles-etc/81040/1 "2007-01-03T08:55:35Z")

</div>

Hi,

feeling quite at home now with the Ruby way of programming and  
with the Ruby language, I would be interested in some more  
internals. What happens when I call “ruby myapp.rb”, i.e. how  
is the compiler/interpreter working?

Further, my experience in C is about nothing. I know the  
C language (yes, I even understand pointers and to a certain  
extend memory allocation), but have no experience.  
Where can I learn more about what I need to know to understand  
Ruby’s C-API and how to extend Ruby with it?

So what do you recommend reading if I want to dig deeper in  
programming?

I know my question is not very specific and you may think  
“get a clue and study IT at the university”, but that is not  
an option at the moment. 😉

Thank you.  
Tony

---

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [January 3, 2007, 9:47am UTC](https://www.ruby-forum.com/t/learning-how-ruby-compiles-etc/81040/2 "2007-01-03T09:47:39Z")

</div>

On 1/3/07, Tony M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> feeling quite at home now with the Ruby way of programming and  
> with the Ruby language, I would be interested in some more  
> internals. What happens when I call “ruby myapp.rb”, i.e. how  
> is the compiler/interpreter working?

[eigenclass.org](http://eigenclass.org/hiki.rb?ruby+internals+guide) - guide to reading  
ruby sources  
[http://rhg.rubyforge.org/](http://rhg.rubyforge.org/) - ruby hacking guide, translation in  
progress. If you know japanese look for the original version.  
some of the articles at [redhanded.hobix.com](http://redhanded.hobix.com)

> Further, my experience in C is about nothing. I know the  
> C language (yes, I even understand pointers and to a certain  
> extend memory allocation), but have no experience.  
> Where can I learn more about what I need to know to understand  
> Ruby’s C-API and how to extend Ruby with it?

Programming Ruby has a chapter on extending, and there is a readme in  
the sources somewhere (readme.ext?).

> So what do you recommend reading if I want to dig deeper in  
> programming?

Those sources will be helpful to see how the language is used. If you  
don’t understand something, look it up in a book or on the web,  
eventually ask someone to explain. (I can’t recall a good English book  
on C now, the one I used is in Czech 😉

---

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [January 3, 2007, 10:15am UTC](https://www.ruby-forum.com/t/learning-how-ruby-compiles-etc/81040/3 "2007-01-03T10:15:43Z")

</div>

On Jan 3, 2007, at 9:46 AM, Jan S. wrote:

> [http://rhg.rubyforge.org/](http://rhg.rubyforge.org/) - ruby hacking guide, translation in  
> progress. If you know japanese look for the original version.  
> some of the articles at [redhanded.hobix.com](http://redhanded.hobix.com)

Does YARV change this substantially? Or perhaps it doesn’t except for  
eval.c?

– fxn

---

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [January 3, 2007, 11:57am UTC](https://www.ruby-forum.com/t/learning-how-ruby-compiles-etc/81040/4 "2007-01-03T11:57:58Z")

</div>

On Jan 3, 2007, at 2:55 AM, Tony M. wrote:

> Further, my experience in C is about nothing. I know the  
> C language (yes, I even understand pointers and to a certain  
> extend memory allocation), but have no experience.  
> Where can I learn more about what I need to know to understand  
> Ruby’s C-API and how to extend Ruby with it?
> 
> So what do you recommend reading if I want to dig deeper in  
> programming?

If you’re going to dig into the C internals of Ruby, you will  
probably want to own a serious reference book on C. I recommend:

Harbison & Steele. “C: A Reference Manual”, Fifth Edition, (C:ARM5,  
ISBN 0-13-089592X), Prentice Hall February 2002.

It’s very well written and has a first class index. I know of no  
better English language reference for C. There is a website for it:  
[http://careferencemanual.com/](http://careferencemanual.com/) where you can look before you buy.

Regards, Morton
