From: Robert Feldt Date: 2002-02-21T16:30:08+09:00 Subject: Re: REBOL vs Ruby On Thu, 21 Feb 2002, Todd Gillespie wrote: > Robert Feldt wrote: > : This is interesting. What do you think of Lisp-style macros? I've only > : used them very briefly but from my understanding they seem very powerful > : and can be used to simplify programs (since you can describe your > : problem/solution in a language dialect tailored to it) and even make them > : more readable. But its a two-edged sword since the language is no longer > : "pure"/core so that you (or you-at-a-later-date or your > : followers/maintainers etc) must now understand a new dialect (or whole > : new language) to understand what the program does. > > If you look at that 'problem' in the larger scope, you see that the same > tool that lets Lisp programmers write their own variants of Lisp, the > macro, allows Lisp as a language to evolve quickly. When a new language > abstraction of technique comes around (like OO), Lisp can and > does implement the new idea overnight -- they don't need to step down a > level for the implementation language, like Ruby must step down to C. So > the full power of the language is available for that language's extension. > Yes, thats important. > As for readability, doesn't every code shop have their own collection of > in-house hacks and libraries? Don't you need to understand their API (a > dialect, if you will) to understand their programs? > You're probably right. I'm coming from a macros-hinders-readability viewpoint but more and more leaning towards they being important and powerful while not making a whole lot of difference regarding readability (readability is more up to how they are used). > : I've been playing with the idea of introducing macros to Ruby (I > : guess something in the style of Dylan's hygienic macros or the OOPSLA > > I say, rock on. > Yeah, but this is long-term... > What do you think about Dylan macros, BTW? I have heard that Dylan syntax > is directly convertible to s-expressions, which makes macros either easy > or possible. How would you apply them to Ruby? > I guess preprocessor like the Java Syntactic Extender (see Jonathan Bacrach at MIT) or Avi Bryants ELIDE system. But there are also some ideas in the new DrScheme/MzScheme environment that needs to be checked out. Haven't found much documentation on that one yet though. Regards, Robert