porting to other vms?

23 views
Skip to first unread message

Raoul Duke

unread,
Jul 28, 2008, 3:24:48 AM7/28/08
to clo...@googlegroups.com
hi,

clueless unresearched and therefore possibly annoying question: what
is a rough guesstimate of how easy it would be to take Clojure to
another host language/vm? which maybe boils down to asking: how many
primitives are there, vs. things implemented as macros - since
presumably once the primitives are ported, everything else comes for
free?

thanks.

Rastislav Kassak

unread,
Jul 28, 2008, 3:39:58 AM7/28/08
to clo...@googlegroups.com
You forgot there are quite a few native java calls in average user
code ("." and ".." functions).
So even if you port basic runtime, almost nothing will run straight
out of the box.

Rich Hickey

unread,
Jul 28, 2008, 8:44:39 AM7/28/08
to Clojure
I developed Clojure in parallel on both Java and C#/CLR for a while,
but the CLR hasn't been maintained for a long time. In order to
support Clojure, a platform would have to provide facilities
substantially similar to Java - as does the CLR. I don't know of
another platform as capable of hosting Clojure - did you have one in
mind specifically?

You would have to port the clojure.lang support library from Java to
C#, and then go through the Clojure code in boot.clj et al and factor
out some of the host calls. Note that most of the host calls are to
the clojure.lang library, and could remain unchanged.

For someone who knows Java, C#, the CLR and Clojure really well, and
is thread-savvy, I would characterize it as doable if somewhat
tedious. Great care needs to be taken in all areas relating to memory
models, threads and locks.

Rich

Paul Barry

unread,
Jul 28, 2008, 8:47:55 AM7/28/08
to clo...@googlegroups.com
Objective Clojure?

Ted Neward

unread,
Jul 28, 2008, 1:17:22 PM7/28/08
to clo...@googlegroups.com
Is the source for the CLR port still around someplace? I'd be interested in
taking a look at possibly bringing it up to date...

Ted Neward
Java, .NET, XML Services
Consulting, Teaching, Speaking, Writing
http://www.tedneward.com

> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 270.5.6/1574 - Release Date:
> 7/25/2008 4:27 PM
>

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 270.5.6/1577 - Release Date: 7/28/2008
6:55 AM

Rich Hickey

unread,
Jul 28, 2008, 1:41:32 PM7/28/08
to Clojure


On Jul 28, 1:17 pm, "Ted Neward" <ted.new...@gmail.com> wrote:
> Is the source for the CLR port still around someplace? I'd be interested in
> taking a look at possibly bringing it up to date...
>

You can see it by spinning back SVN:

http://clojure.svn.sourceforge.net/viewvc/clojure/trunk/src/?pathrev=300

Looks like the last rev was 262, over 700 revs and almost 2 years ago!

Other than as a source of ideas, I wouldn't consider it a good basis
for a port, as so much has changed since then, including the
persistent collections, the STM, numerics etc. Back then Clojure was a
Common Lisp compiler that generated Java and C# source.

The right thing to do would be to start from the current Java source,
IMO.

It also predates the DLR, which might ease the port today.

Rich

jbarciela jbarciela

unread,
Aug 18, 2008, 9:34:51 PM8/18/08
to clo...@googlegroups.com
Hello,

Is there any experience running/compiling on iKVM? (JVM on .NET)
That could be the bridge right there, and for free, no porting efforts.

Jaime


On Mon, Jul 28, 2008 at 8:44 AM, Rich Hickey <richh...@gmail.com> wrote:
>
>
>

Shawn Hoover

unread,
Aug 18, 2008, 9:44:36 PM8/18/08
to clo...@googlegroups.com
On Mon, Aug 18, 2008 at 6:34 PM, jbarciela jbarciela <jbar...@gmail.com> wrote:

Hello,

Is there any experience running/compiling on iKVM? (JVM on .NET)
That could be the bridge right there, and for free, no porting efforts.

Jaime


Yes, Clojure can run on IKVM. You lose some performance, but you can call pretty much any Java or .NET code, whether from the base libraries or custom. There was some discussion here that shows how it works: http://groups.google.com/group/clojure/browse_thread/thread/e48b64f3dc1f09fb?fwc=1.

Shawn

Reply all
Reply to author
Forward
0 new messages