clojure clr and jmv - portability and compatibility?

26 views
Skip to first unread message

urza urza

unread,
Oct 15, 2010, 8:45:27 AM10/15/10
to Clojure
Hello,

I am new to clojure, so sorry if this is a stupid question, but:

How portable are clojure programs between clojure clr and clojure jvm?
For example, can i use clojure contrib in clr? How about Enlive or
other libraries?

Can I write one clj program that will run both in jvm and clr? Or is
it choose your platform, and use the same language, but not the same
libraries?

Thanks
urza

Timothy Baldridge

unread,
Oct 15, 2010, 9:17:25 AM10/15/10
to clo...@googlegroups.com
From what I've been seeing of both clojure and clojure-clr...they
aren't very portable at all. Pure clojure code should be fine. But
since clojure likes to use the underlying VM for almost everything it
can, you'll have issues. FileStream in CLR may not be the same as
FileStream in Java. As a CLR guy, I can't really comment about the
java side of things, but I have noticed the two are quite different
when it comes to APIs.

IMO, cljoure needs a "batteries included" standard library. Languages
like Python define constructs like file objects. As long as one
follows the python file object spec you can use any object as a file
and read/write to it. Unfortunately, clojure as taken the easier road
of saying "what to read a file byte by byte....go read the Java Docs".
So if one wants to use Clojure for even a moderately complex
application, one is forced to be a clojure and a java expert.

In your case, you'll be looking at being a clojure, java and .net
expert. Have fun!

Timothy

> How portable are clojure programs between clojure clr and clojure jvm?
> For example, can i use clojure contrib in clr? How about Enlive or
> other libraries?

--
“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)

Reply all
Reply to author
Forward
0 new messages