Languages implemented on Lisp?

Discussion of Common Lisp
tlareywi
Posts: 11
Joined: Fri Sep 26, 2008 10:53 am
Location: Seattle, WA. USA

Languages implemented on Lisp?

Post by tlareywi » Fri Sep 26, 2008 11:38 am

Hi all,

I'm interested in looking at some examples of language implementation on Common Lisp. Even toy languages would be fine (perhaps preferable). Mainly, I'm curious about the different strategies and patterns people employ to do this. I would guess that there are tons of DSLs on Lisp but a preliminary Google search didn't turn up much. Anyone know of some good references on this topic?

Thanks,
Trystan

PhazeDK
Posts: 3
Joined: Mon Sep 22, 2008 7:12 am
Location: Denmark

Re: Languages implemented on Lisp?

Post by PhazeDK » Fri Sep 26, 2008 12:55 pm

How about Python?

Paul Donnelly
Posts: 148
Joined: Wed Jul 30, 2008 11:26 pm

Re: Languages implemented on Lisp?

Post by Paul Donnelly » Fri Sep 26, 2008 2:37 pm


tlareywi
Posts: 11
Joined: Fri Sep 26, 2008 10:53 am
Location: Seattle, WA. USA

Re: Languages implemented on Lisp?

Post by tlareywi » Fri Sep 26, 2008 3:02 pm

Paul Donnelly wrote:There's Qi, and several Prologs.

http://www.lambdassociates.org/
http://norvig.com/paip/prolog.lisp
Wow, Qi looks really cool in particular. This should give me quite a bit to chew on. Thanks!

mijokijo
Posts: 5
Joined: Fri Dec 05, 2008 10:35 am

Re: Languages implemented on Lisp?

Post by mijokijo » Mon Jan 05, 2009 9:12 pm

I think you're lost.

dlweinreb
Posts: 41
Joined: Tue Jul 01, 2008 5:11 am
Location: Lexington, MA
Contact:

Re: Languages implemented on Lisp?

Post by dlweinreb » Tue Jan 06, 2009 4:22 am

Peter Seibel gave a lecture at Google where he showed a simple example of a DSL in Lisp.

http://video.google.com/videoplay?docid ... 5356213813

Shriram Krishnamurthy of Brown has a slide presentation showing a finite-state machine done nicely as macros. (It's Scheme but it's all the same idea.) See slide 36 in

http://www.cs.brown.edu/~sk/Publication ... eforePerl/

findinglisp
Posts: 447
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX
Contact:

Re: Languages implemented on Lisp?

Post by findinglisp » Tue Jan 06, 2009 10:20 am

dlweinreb wrote:Peter Seibel gave a lecture at Google where he showed a simple example of a DSL in Lisp.

http://video.google.com/videoplay?docid ... 5356213813

Shriram Krishnamurthy of Brown has a slide presentation showing a finite-state machine done nicely as macros. (It's Scheme but it's all the same idea.) See slide 36 in

http://www.cs.brown.edu/~sk/Publication ... eforePerl/
I did a similar state machine macro in CL after watching Shriram's talk:
http://www.findinglisp.com/blog/2004/06 ... macro.html
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

gcartier
Posts: 4
Joined: Tue Sep 02, 2008 5:22 am

Re: Languages implemented on Lisp?

Post by gcartier » Fri Jan 09, 2009 10:08 am

tlareywi wrote:Hi all,

I'm interested in looking at some examples of language implementation on Common Lisp. Even toy languages would be fine (perhaps preferable). Mainly, I'm curious about the different strategies and patterns people employ to do this. I would guess that there are tons of DSLs on Lisp but a preliminary Google search didn't turn up much. Anyone know of some good references on this topic?

Thanks,
Trystan
JazzScheme http://www.jazzscheme.org/ is a Scheme derived language whose kernel was implemented fully in C. During the last 2 years, we made the crazy bet of converting the kernel to 100% pure Scheme code using macros.

After an initial drop in performance of being about 95x slower, performance is now 2x faster than the old C-based kernel. Macros enabled us to access the underlying Scheme functionality with no performance penalty. An important part of the performance is also due to the excellent Scheme implementation that we are using. Gambit http://dynamo.iro.umontreal.ca/~gambit/ ... /Main_Page, on top of being extremely fast, gives complete access to every low-level untyped facilities needed to implement something as performance demanding as a language.

And in term of code, the kernel implementation that was about 150K lines of C code is now done and a lot more in just 15K lines of much clearer and easy to evolve lines of Scheme code.

So yes languages implemented in Lisp sure are possible!

Guillaume Cartier

qbg
Posts: 64
Joined: Mon Jun 30, 2008 1:05 pm
Location: Minnesota

Re: Languages implemented on Lisp?

Post by qbg » Fri Jan 09, 2009 10:23 am

I believe I remember reading on comp.lang.lisp that an old version of Haskell ran on CMUCL.

feeley

Re: Languages implemented on Lisp?

Post by feeley » Fri Jan 09, 2009 10:39 am

As part of my research and courses, I have been implementing various languages in Scheme using the Gambit Scheme compiler. Three compilers implemented this way stand out:

1) ETOS, an Erlang to Scheme compiler which generates code that is roughly as fast as the HIPE native code compiler for Erlang. Here's a paper on it: http://www.iro.umontreal.ca/~feeley/papers/etos.ps . Also there is a (old) web page with the code: http://www.iro.umontreal.ca/~etos/ .

2) SIX, the "Scheme Infix syntaX" is a C-like syntax supported by the Gambit reader. Gambit comes with macros which implement a semantics very close to C. For example:

% gsi
Gambit v4.4.0

> \ for (int i=1; i<5; i++) pp(i*i);
1
4
9
16
> ' \ for (int i=1; i<5; i++) pp(i*i);
(six.for (six.define-variable (six.identifier i) int () (six.literal 1))
(six.x<y (six.identifier i) (six.literal 5))
(six.x++ (six.identifier i))
(six.call
(six.identifier pp)
(six.x*y (six.identifier i) (six.identifier i))))

3) A student of mine wrote a fairly complete Java compiler in Scheme which compiled Java to Scheme.

Marc Feeley

Post Reply