Matz Save Me From Your Followers!

chromatic on 2006-09-20T21:19:22

Am I just super angry and vitriolic today, or does anyone find Metaprogramming Refactoring fairly undersatisfying?

But it's not until Ruby entered the common programmers mind that Metaprogramming actually starts to become common place.

My goodness, did that quote fall through time from maybe 2010 or 2012 when Ruby has usable documentation and has actually entered the common programmer's mind?

I also love the way how the rite of passage for Tcl programmers is writing an efficient control flow operator, for Haskell programmers is calculating the Fibonacci sequence, for Perl programmers is writing a templating system, for Java programmers is writing XML to avoid writing Java, and for Ruby programmers is evidently defining a bunch of functions and symbols and data structures and calling them a DSL.

(My theory? Vitrolic but correct.)


Wow!

pdcawley on 2006-09-21T11:57:56

That's pretty damned clueless. And the comments aren't exactly enlightening either.

It was quite depressing to realise how many folks at Railsconf Europe seemed to be under the impression that Ruby was something really special because it has 'yield'.

I'm not saying it's not special, it's a great language, but not necessarily for the reasons the frothers think it is.

Re:Wow!

fishbot on 2006-09-21T13:05:46

I particularly enjoy this: (emphasis his)

"This can be done in Lisp too. Has been possible for many years before both Perl and Ruby. The point is that Ruby is getting so much traction for (so called) real programming which means that metaprogramming is now accessible to the masses, as I argue it wasn't when confined to Perl and Lisp."

Clearly the problem all along is that Perl and Lisp confined their features to the language itself, rather than projecting them onto the masses. Ruby = Accessible because Real, Real because of Traction.

Re:Wow!

ferreira on 2006-09-21T15:32:04

Ruby = Accessible because Real, Real because of Traction.

Let's try again. Now with extra concentration. "Matz Save Me From Your Followers!"

metaprogramming

rjbs on 2006-09-21T22:10:37

I went to a talk on metaprogramming in Ruby a few OSCON's ago. There had been so much mumbling in the Ruby community about how it was the way that Rails had changed the fundamental constants of the programming universe, and how it would keep doing so. I figured it was worth an hour of my time.

The room was packed to the gills, but I ended up being sorely disappointed, even with my relatively low expectations. It was just some clever playing around with features found in any reasonably dynamic language. The worst part was that what we were shown was built entirely around the equivalent of string eval. What? I guess it's easier to hack out something that writes Ruby code and then compiles it, but why not actually construct classes you need? I'm not convinced tha the "metaprogramming" they showed us did anything that a clever Sub::Exporter configuration could do, and that never evals strings...

Ruby is a great language, but as far as I've seen it's because of its elegance, not its innovation.

Re:metaprogramming

Aristotle on 2006-09-21T22:49:08

The Ruby buzz is the sound of a bunch of Java programmers finally discovering how cool Perl is.

Re:metaprogramming

chromatic on 2006-09-22T02:45:54

I've seen similar talks and examples. I can do the string eval trick in C, if I have a compiler and linker available. That by itself is not so impressive to me in any language that lets you load foreign code at runtime.

That said, Perl's other metaprogramming facilities are a bit clunky. Typeglobs and symbolic references and no true metamodel make things ugly, if not difficult. Ruby has a syntax advantage with its blocks and its class metamodel as well as its fundamental object orientation of primitives.

Re:metaprogramming

rjbs on 2006-09-22T09:21:57

Oh, absolutely! Worse, to me, than typeglobs and symbolics refs are the little things that only can happen at compile time.

What really strikes me, though, is how often I see metaprogramming stuff implemented as Ruby source generation instead of Ruby object generation. Oh well; at least I know I can do things cleanly, if I want.

Re:metaprogramming

Aristotle on 2006-09-22T15:20:42

I can do the string eval trick in C, if I have a compiler and linker available.

Oh? Really?

Re:metaprogramming

ask on 2006-09-27T07:40:25

Yeah, I went to that talk too and I badly regretted sitting in front where I couldn't get out.

  - ask