[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
choosing a language for your audience or macros vs syntax?
Before the Ruby talk, i brought my Ruby book to Matz who graciously signed it.
His talk clearly addressed the language design issues that lead to Ruby. Ruby has call/cc (page 297), but it does not have macros.
Before the first Lightweight languages workshop, i would have found this very strange. Schemes i know of have both, but few other languages have either, but maybe now call/cc is more popular in other languages.
Matz thought macros were too hard for average programmers, but call/cc was worth implementing.
This got me thinking about JScheme. JScheme, is a simple Scheme dialect in Java, that has macros but no true call/cc. This seemed like the easiest thing for us to implement. There are 40 lines of code devoted to macros. These are the Common Lisp hurt yourself macros that Lisper's are familiar with. See Paul Graham's book, "On Lisp". You can have Scheme hygienic macros and a nice module system by loading a 3,000 line Scheme library.
JScheme only support the most obvious call/cc that Java supports directly (basically Java's throw) because anything else would take a lot of work.
We went for macro's because we were culturally used to them and felt we could live without full call/cc more easily, and macros were basically free because we needed them to implement the special forms anyway.
Does Ruby's call/cc take a lot of work to implement?
I suspect macros would be a lot of work because of the syntax, but i suspect that culturally, macros were not important, for lack of experience. After all, Ruby makes a lot of things easier to program, so maybe that's enough.
Are macros just the easiest thing to leave out, because it is even harder than call/cc in a language with Ruby's syntax?
Syntactic extension carries a lot of issues with it, but isn't it essential for growing a language?
http://www.research.avayalabs.com/user/wadler/steele-oopsla98.pdf