Learning how Ruby compiles etc


#1

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. :wink:

Thank you.
Tony


#2

On 1/3/07, Tony M. 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?

http://eigenclass.org/hiki.rb?ruby+internals+guide - guide to reading
ruby sources
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

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 :wink:


#3

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

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

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

– fxn


#4

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/ where you can look before you buy.

Regards, Morton