I'm looking for some info on why lisp is so good for implementing domain
specific languages. Does anyone know of any good websites on the topic?
Lowell
Lowell Kirsh wrote:
> I'm looking for some info on why lisp is so good for implementing domain
> specific languages. Does anyone know of any good websites on the topic?
http://www.paulgraham.com/onlisp.html
also, check "defmacro" and "destructuring-bind" in the CLHS.
The idea is that you can invent a domain language which follows the
syntax of lisp (sexprs, keywor args, optional args) and then inside
defmacro translate it as necessary to the ugly nuts and bolts of the
vanilla CL implementation for said domain language. No lex, no yacc, and
the translation into vanilla CL gets compiled to boot.
if you do not want to go with a lispy syntax, you still get the source
reduced to symbolic form (by the reader) making lex unnecessary, you
just need to cook up a finite state machine to xlate from your language
to the necessary implementing CL.
And in either case you can drop snippets of domain language into your
source anywhere you like, and within the domain language code drop into
vanilla CL if that is desirable, all painlessly.
i know i am leaving out a lot of deets, but all this makes sense once
you grok macros. see link above.
kenny
--
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Lowell Kirsh <······@cs.ubc.ca> writes:
> I'm looking for some info on why lisp is so good for implementing
> domain specific languages. Does anyone know of any good websites on
> the topic?
The uniformity of the syntax:
- special forms (language primitive syntax),
- language and user defined macro
- language and user defined functions
all have the same form:
(<keyword> <argument>...)
(And implicitely in that list are macros that allow you to design new
control structures seamlesslingly integrating with the language
special forms.)
--
__Pascal Bourguignon__ http://www.informatimago.com/
Voting Democrat or Republican is like choosing a cabin in the Titanic.
Pascal Bourguignon <····@mouse-potato.com> wrote in message news:<··············@thalassa.informatimago.com>...
> Lowell Kirsh <······@cs.ubc.ca> writes:
>
> > I'm looking for some info on why lisp is so good for implementing
> > domain specific languages. Does anyone know of any good websites on
> > the topic?
>
> The uniformity of the syntax:
>
> - special forms (language primitive syntax),
> - language and user defined macro
> - language and user defined functions
>
> all have the same form:
>
> (<keyword> <argument>...)
Also, it might be the sort of thing like the natural-language-like
interfaces to databases covered in Winston & Horn's Lisp book. I
haven't been quite interested in that yet, but he has examples of
saying, "Print the size and weight of the red screwdrivers" and it
constructs some procedure to do that.
And it might include reader tricks like Clawk (Awk syntax in Lisp):
http://lemonodor.com/archives/000040.html
But I unfortunately haven't played with this sort of stuff.
MfG,
Tayssir
Lowell Kirsh <······@cs.ubc.ca> writes:
> I'm looking for some info on why lisp is so good for implementing
> domain specific languages. Does anyone know of any good websites on
You may want to check the paper "Lambda: the Ultimate Little Language"
by Olin Shivers.
Paolo
--
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Recommended Common Lisp libraries/tools (see also http://clrfi.alu.org):
- ASDF/ASDF-INSTALL: system building/installation
- CL-PPCRE: regular expressions
- UFFI: Foreign Function Interface
"Paolo Amoroso" <·······@mclink.it> a �crit dans le message de
···················@plato.moon.paoloamoroso.it...
> Lowell Kirsh <······@cs.ubc.ca> writes:
>
> > I'm looking for some info on why lisp is so good for implementing
> > domain specific languages. Does anyone know of any good websites on
>
> You may want to check the paper "Lambda: the Ultimate Little Language"
> by Olin Shivers.
What Olin means by "Scheme has the most sophisticated macro system of any
language
in this [lisp] family".
He also wrote about implicit backquoting : (< ,(vector-ref fv i))
Is this possible in lisp ? in a standard way.
--
___________________________________________________________
Christophe Turle.
(format nil ···@~S.~S" 'c.turle 'wanadoo 'fr)
http://perso.wanadoo.fr/turle/lisp/utilities.html
Lowell Kirsh wrote:
> I'm looking for some info on why lisp is so good for implementing domain
> specific languages. Does anyone know of any good websites on the topic?
It's very straightforward to build new domain-specific syntax without
the need to manage a large toolset of distinct lexers, parsers and
interpreters/compilers. Instead, it's all seamlessly built into the
language, and it's relatively simple to mix different domain-specific
extensions in one program. However, it's still hard to make them combine
well - orthogonality doesn't come for free. Nevertheless, you get to the
heart of such issues much quicker than in other approaches, which also
all have that same problem.
Furthermore, with macros it's actually simpler to build compilers than
interpreters for your domain-specific abstractions, which probably gives
you some efficiency advantages. As far as I can see, other approaches
seem to favor interpreters - but I could be wrong here.
Pascal
--
Tyler: "How's that working out for you?"
Jack: "Great."
Tyler: "Keep it up, then."