
Writing a Lisp Interpreter in Go - fogus
http://bobappleyard.wordpress.com/2010/02/18/writing-a-lisp-interpreter-in-go/
======
andrewcooke
Curious. It implies tail call elimination (the description of exhausting the
stack explicitly says it wasn't a tail recursive call), but the description
sounds like it's so direct that I can't see how it works.

Looking at evalExpr -
[http://github.com/bobappleyard/golisp/blob/master/lisp/lisp....](http://github.com/bobappleyard/golisp/blob/master/lisp/lisp.go#L417)
\- the only way I can see for this to have tail call elimination is if Go
itself does (and I don't think it does, does it? It does have coroutines,
which you could use to implement trampolining, but I don't see that here...)

~~~
maxtilford
I think tail call elimination is handled in the Apply method for closures -
[http://github.com/bobappleyard/golisp/blob/master/lisp/lisp....](http://github.com/bobappleyard/golisp/blob/master/lisp/lisp.go#L567)
. Looks like a trampoline to me.

~~~
andrewcooke
Ahhh. Thanks. After thinking about that I realised I don't understand Go's
syntax :o)

------
stcredzero
I wrote a quip awhile back about wanting a scripting language closely
integrated with Go. Maybe this would fit the bill? (Though one with a Go-like
syntax would be better.)

~~~
koenigdavidmj
That somewhat points to a development environment that I would like---a
statically compiled language that is also easily interpreted. You develop with
the interpreted version to get the quickest turnaround, and then you compile
it for speed when you're ready to release your product.

Seems like LLVM or the JVM would both make this comfortable.

~~~
stcredzero
You should check out Groovy then. It has optional typing. Put in enough type
annotations, and it's compiled Java.

------
alexk
Can't but wait for go interpreter in lisp :)

~~~
stcredzero
One that can compile its Lisp programs into Go.

------
ponce
Now he can program in a proper language.

------
Semiapies
Obligatory mention of having to use Readability for light-on-dark text...

EDIT: Some of us are on the other side of 30 and won't waste our eyesight on a
blog by someone who thought white-on-black was _kewl_. Those under 30
shouldn't, either.

