[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Rather, DSSLs increase modularity, productivity

On Mon, 2003-11-17 at 10:53, Brent Fulgham wrote:
> > One of my biggest reservations about the newest crop of Handley-Milner
> > fpls is that they make useful metaprogramming almost impossible.
> Oh, I disagree strongly with this assertion.  For example:
> 1)  The C-- project is a compiler that converts "C--" input code to appropriate assembly
> instructions, and it's coded in Ocaml.  (http://www.cminusminus.org)
> 2)  ML (Meta-Language) was originally designed as a metaprogramming tool.
> 3)  Please read through Graydon Hoare's "One-Day-Compilers" talk (http://www.venge.net/graydon/talks/mkc/html/mgp00001.html) on implementing program generating programs in OCaml.  (Subtitle:  "How I learned to stop worrying and love static metaprogramming."

Interesting.  Thanks.

Perhaps it's useful to make a distinction between source-level compile
time metaprogramming and run time metaprogramming.  Source-level
metaprogramming as found in languages like ML is pretty useful and
enables a lot of the things that are done in dynamic languages.  

Run time metaprogramming, which tends to depend a lot on introspection,
seems to be very difficult or impossible to do in current static fpls. 
Iterating over the slots of an OCaml object to do generic prevalence
code, for instance, isn't possible in "userspace" in the language.

Whether this is due to real theoretical obstacles or just implementation
decisions isn't clear to me.

Miles Egan <miles@caddr.com>

Attachment: signature.asc
Description: This is a digitally signed message part