[plt-scheme] [RE] What is all the fuss about how to write DSLs in Lisp?

From: Williams, M. Douglas (M.DOUGLAS.WILLIAMS at saic.com)
Date: Thu Jun 7 10:49:39 EDT 2007

In my case, I look at both the simulation collection and the inference
collections that I've developed in PLT Scheme to be examples of
domain-specific languages (DSLs) - an internal DSL, to use Martin
Fowler's terminology.  Both implement a domain-specific language on top
of PLT Scheme - a simulation language in the first case and a rule-based
language in the second.  These are more problem-solving domain oriented
than application domain oriented.  I would say the real power is in the
underlying PLT Scheme implementation itself.  That is, I can provide a
veneer of domain-specific syntax and functionality and rely on the
underlying language implementation to provide the depth needed to solve
real problems within these domains.  Maybe a term like domain-specific
language extension is more appropriate here.
 
The advantage of this approach of embedding a DSL in PLT Scheme is, at
least to me, pretty obvious.  I get the domain-specific problem solving
abstractions that can be applied to solve specific problem instances.
And, I can use the richness of the underlying implementation to the
extent desired to round out the problem solving application - anywhere
from simply printing (or plotting) the results to a full-blown graphical
application.
 
The disadvantage in this case is probably just as obvious.  You have to
know the underlying language - PLT Scheme - to use the DSL.
 
I rarely write a simulation or rule-based system for its own sake.  They
are generally a part of a much larger system.  I also often develop
knowledge-based simulations thatuse elements from both problem-solving
domains.  This is not a problem when the separate DSLs are embedded in
the same language framework.
 
Doug
 
On 6/7/07, Grant Rettke <grettke at acm.org
<http://list.cs.brown.edu/mailman/listinfo/plt-scheme> > wrote:
> What is all the fuss about how you can write DSLs in Lisp?
> 
> Everyone from thought-leaders to blog-posters to grandma's are talking
> about how Lisp is so great for DSLs.
> 
> About what are these people talking about? Because no one of said
> people actually elaborate on any of this, of course, which leads me to
> question their claims.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070607/36d4f72d/attachment.html>

Posted on the users mailing list.