[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Book wanted: Metaprogramming in Ruby

Jay Levitt

11/6/2006 1:07:00 AM

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 Levitt
23 Answers

Wilson Bilkovich

11/6/2006 1:22:00 AM

0

On 11/5/06, Jay Levitt <jay+news@jay.fm> wrote:
> 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?
>

I agree that that would be a book worth writing.

In the meantime, have you seen this Ruby Quiz?
http://rubyquiz.com/q...

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.

Bil Kleb

11/6/2006 1:48:00 AM

0

Jay Levitt wrote:
>
> Anyone wanna write this next?

FWIW, at Agile 2006 Martin Fowler mentioned he
might write one on DSLs.

Later,
--
Bil Kleb
http://kleb.tadalist.com/lists/pub...

rubyfan

11/6/2006 10:03:00 PM

0

On 11/5/06, Jay Levitt <jay+news@jay.fm> wrote:
> 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?


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

James Gray

11/6/2006 10:14:00 PM

0

On Nov 6, 2006, at 4:03 PM, Phil Tomson 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-...

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

James Edward Gray II

Henrik Horneber

11/6/2006 10:34:00 PM

0

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

Matt Lawrence

11/6/2006 10:37:00 PM

0

Eric Armstrong

11/7/2006 1:40:00 AM

0

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.
:_)



Giles Bowkett

11/7/2006 5:02:00 AM

0

> > 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-...
>
> I'll get to the final two chapters pretty soon, since I'm beginning
> to have more time again...

I found this very handy.

--
Giles Bowkett
http://www.gilesg...

David Vallner

11/7/2006 11:42:00 AM

0

Eric Armstrong 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 Vallner

M. Edward (Ed) Borasky

11/7/2006 2:13:00 PM

0

Bil Kleb wrote:
> Jay Levitt wrote:
>>
>> Anyone wanna write this next?
>
> FWIW, at Agile 2006 Martin Fowler mentioned he
> might write one on DSLs.
>
> Later,
> --
> Bil Kleb
> http://kleb.tadalist.com/lists/pub...
>
>
Actually, if Martin Fowler wants to write another book, he should expand
"Refactoring" and translate it into Ruby. :)

Seriously, though, I'm not sure a whole book on metaprogramming,
Ruby-based or otherwise, is either necessary or useful at this point in
the technology cycle. There are quite a few articles on the subject.
What I'd rather see a book on is dealing with *concurrency* in Ruby.
Dual-core and quad-core chips aren't going away. :) Francis? You're our
resident expert, I think ...