

Clojure for .NET - DrJokepu
http://github.com/richhickey/clojure-clr

======
jared314
.NET has tail call optimization. Does clojure clr implement support for it?

~~~
noblethrasher
I can't be bothered to download and run reflector on it but if they made it
completely in C# then I don't see how they could have taken advantage of TCO
since the compiler doesn't ever make use that CLR instruction.

~~~
DrJokepu
As far as I can see Clojure CLR uses the Dynamic Language Runtime and
Expression Trees which do support tail recursion. I don't know if Clojure CLR
takes advantage of it, probably not. However, recent .NET VMs automatically
apply tail-recursion optimization if a number of specific conditions are met,
even if the compiler doesn't actually emit tail-recursive IL.

------
flatline
Another (inactive) project that I found interesting:

<http://dotlisp.sourceforge.net/dotlisp.htm>

~~~
pmjordan
This is actually the precursor to Clojure; note how it was developed by Rich
Hickey.

~~~
flatline
Yeah, there are a variety of lisp-y things out there for .NET, I came across
this one quite by accident and was surprised to see the name. I read that
Hickey had originally thought to target the CLR with Clojure, when I found
this project I wondered if this is what he was talking about.

------
pmjordan
I've been toying with the idea of creating a LLVM-based Clojure
implementation, which would permit interesting constructs such as coroutines
and continuations. Too busy though, and Java 7 will supposedly support them,
if it's ever released.

~~~
allertonm
This idea has been bounced around by a few people interested in getting
Clojure onto the iPhone/iPad platform too, since the JVM is unlikely to ever
be there.

MacRuby suggests that it's not a complete pipedream, but the experience of the
Unladen Swallow team indicates that it will not be all unicorns & rainbows.
You'd also have to find an appropriate GC (I know some people are looking at
using Boehm to get MacRuby on iPhone, but you have to wonder if you'll run
afoul of the Appstore Police by incorporating a GC in your app.)

------
kingkilr
Stuff like this is why I'm convinced the PyPy guys have the right approach.
Write it once in a high level language and then compile it into different
targets.

