Book wanted: Metaprogramming in Ruby

Now that Hal, David B, Curt, and others have some spare time:

I’m an old-school, procedural programmer. I skipped C++ and Java, and
went
straight from PL/I to Ruby. Wow, times have changed!

So I haven’t developed the idioms that powerful languages like Ruby make
possible: reflection, method_missing-isms, binding, continuations,
lambdas,
blocks, etc. My code still looks like it used to, only prettier.

I’ve seen some articles on metaprogramming online, but none are both (a)
soup-to-nuts walkthroughs and (b) Ruby-specific. Besides, I think this
is
a topic worthy of a book-length screed. Ideally, it’d assume basic
knowledge of Ruby syntax and of programming in general, but not of
dynamic
programming. Maybe write it with a C programmer in mind.

Anyone wanna write this next?

Jay L.

On 11/5/06, Jay L. [email protected] wrote:

soup-to-nuts walkthroughs and (b) Ruby-specific. Besides, I think this is
a topic worthy of a book-length screed. Ideally, it’d assume basic
knowledge of Ruby syntax and of programming in general, but not of dynamic
programming. Maybe write it with a C programmer in mind.

Anyone wanna write this next?

I agree that that would be a book worth writing.

In the meantime, have you seen this Ruby Q.?
http://rubyquiz.com/quiz67.html

Doing that without looking at the answers first will show you most of
the useful metaprogramming ropes. Coming straight from PL/I (JCL in
the house!) will be a bit of a cold splash, but I think it is a good
(if tough) intro.

A good basic walkthrough on meatprogramming can be the little section in
_why’s guide, or even better, teh tutorial he wrote on it here:
http://www.whytheluckystiff.net/articles/seeingMetaclassesClearly.html

On Nov 6, 2006, at 4:03 PM, Phil T. wrote:

It would also be nice if it covered
things like functional programming (kind of like the “Higher Order
Perl” book).

I’ve tried to translate a fair portion of the Higher Order Perl
material on my blog:

http://blog.grayproductions.net/articles/category/higher-order-ruby

I’ll get to the final two chapters pretty soon, since I’m beginning
to have more time again…

James Edward G. II

On 11/5/06, Jay L. [email protected] wrote:

soup-to-nuts walkthroughs and (b) Ruby-specific. Besides, I think this is
a topic worthy of a book-length screed. Ideally, it’d assume basic
knowledge of Ruby syntax and of programming in general, but not of dynamic
programming. Maybe write it with a C programmer in mind.

Anyone wanna write this next?

We do need an advanced Ruby text. I think a lot of what it would
cover would be metaprogramming. It would also be nice if it covered
things like functional programming (kind of like the “Higher Order
Perl” book). I’d like to be involved in writing some chapters for a
book like that (esp metaprogramming and DSL chapters)… but I wouln’t
want to write a whole book as it’s just way too much work for one
person (with not much return, really). However, “many hands make the
work easier” - if we got 4 or 5 people together to work on an
advanced Ruby book it would likely get done a lot faster and it
wouldn’t seem like an impossible task. Are there other potential
authors who feel the same way?

Phil

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I second the request for a book on metaprogramming.

Still, the links provided are a great start, thanks all!

Henrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFT7hipWrUo0vjtssRAjYPAJ9VmxM7VcaZVcrTYRrD6FcC595a/ACeKV2r
nYwqJJ3s5VkIV+4z29kntsA=
=cHwe
-----END PGP SIGNATURE-----

On Tue, 7 Nov 2006, Henrik Horneber wrote:

I second the request for a book on metaprogramming.

I thought the request for a book on meatprogamming in Ruby was quite
interesting as well.

– Matt
It’s not what I know that counts.
It’s what I can remember in time to use.

to have more time again…
I found this very handy.

Henrik Horneber wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I second the request for a book on metaprogramming.

Still, the links provided are a great start, thanks all!

+1 on both counts.

Anybody writes that book, I’m buyin’ in.
–and 5 or 6 authors is a /great/ idea.
Make it a tiny book–5 or 6 chapters, one chapter
on each of the cool topics.
:_)

Eric A. wrote:

–and 5 or 6 authors is a /great/ idea.
Make it a tiny book–5 or 6 chapters, one chapter
on each of the cool topics.

Umm, please no. I’d prefer a coherent in-depth text, preferrably one
that eschews “cool” as much as possible. Even if Ruby makes wome witty
hacks easy and lets them hobble along without breaking for quite a
while, metaprogramming is not an easy topic, even -with- the amazingly
direct access to the object model Ruby gives you it’s error-prone, and
I’d hate a superficial book that would make it look simpler than it is
and spawn the Ruby/meta equivalent of VB6.

David V.