4 ms·
Clojure for .NET
- jared314 17y ago.NET has tail call optimization. Does clojure clr implement support for it?
- noblethrasher 17y agoI 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.
- jared314 17y agoI think you are confusing the clojure compiler and the clojure language compiler.
- DrJokepu 17y agoAs 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.
- snprbob86 17y agoPresumably the Clojure compiler emits MSIL. You can emit whatever instructions you want, even if the host language's compiler doesn't emit those instructions.
- flatline 17y agoAnother (inactive) project that I found interesting: http://dotlisp.sourceforge.net/dotlisp.htm http://dotlisp.sourceforge.net/dotlisp.htm
- pmjordan 17y agoThis is actually the precursor to Clojure; note how it was developed by Rich Hickey.
- flatline 17y agoYeah, 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.
- markhurd 17y agoBTW for "inactive" read "stable" :-) I have updated my personal build a bit, but haven't had time to add my changes back to SourceForge. Mark Hurd markhurd@ozemail.com.au
- pmjordan 17y agoI'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 17y agoThis 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 17y agoStuff 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.