[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] ANN: new egg, Stacktor
From: |
Graham Fawcett |
Subject: |
Re: [Chicken-users] ANN: new egg, Stacktor |
Date: |
Tue, 19 Feb 2008 09:21:40 -0500 |
Neat!
Mark, you may not believe this, but a few months ago I started writing
a stack-based language in Chicken, and the first name I chose for it
was 'Quacktor'. Great minds think alike, and fools seldom differ...
Also, John Cowan has worked on a Joy egg, if I'm not mistaken; you
might find that interesting.
What I was trying to work out, personally, was a nice way of
transforming a postfix, fixed-arity language into decent
lexically-scoped expressions, e.g.:
20 dup print + 30 *
might translate into
(lambda (b) (let ((a 20)) (print a) (* 30 (+ 10 b))))
...so that I did not have to maintain an explicit stack, and could get
Chicken to compile it to something efficient. It worked out pretty
well, IIRC, though my examples were pretty short.
I also had a nice SCHEME: form, so you could do stuff like
REQUIRE: http-client
SCHEME: http-get ( url -- body ) (http:GET url) ;
: main "http://callcc.org/" dup print http-get print ;
If you're interested, I'll dig up my notes.
Graham