

My path to Clojure - mindaugas
http://blog.n01se.net/?p=37

======
icey
How weird, the dupe detection must have some sort of time sensitivity built
in... this was posted a couple of weeks ago with the same URL:

<http://news.ycombinator.com/item?id=441485>

~~~
wingo
Funny, though I didn't read it then. Still, it's more to my interests than the
rest of the front page...

~~~
icey
Yeah, it's totally not a big deal, I just thought it was weird because the
URLs matched up completely. It is a good read - I only remembered it because I
saw it here a couple of weeks ago.

------
rw
I've become enamored with PLT Scheme. Clojure main appeal appears to be that
it is on the JVM (with all those darn libraries), not that it is a
new/beautiful and novel language. I am a proponent of porting Clojure to run
without the JVM - has anyone heard of such a project?

~~~
prospero
What possible benefit would there be to a project like that?

~~~
ricree
I wouldn't mind a .net version, but other than that I agree that clojure loses
a lot of its benefit over other lisps if it isn't tied to an existing runtime
and library set.

~~~
icey
I heard a rumor a few weeks ago that someone had Clojure running on IKVM. I'm
sure it would be slow as hell right now; but it'd probably be OK for toying
around with.

~~~
mindslight
Given that clojure "embraces the platform", it'd probably be pretty hard to
have clojure.net _without_ ikvm in there somewhere. Performance could be
increased by porting the code generator and core classes to .net, but users
expect to use arbitrary java libraries, so that capability has to be there.

(Seems like that strategy could also be applicable to a native port, using an
embedded jvm to handle whatever has not been ported from java land)

and FWIW (i have little .net knowledge)

    
    
        ubuntu:~% ikvm -jar clojure.jar
        Clojure
        user=> (. cli.System.IO.File OpenText "/dev/null")
        #<StreamReader System.IO.StreamReader>
    

(startup takes about 6x times as long with ikvm than java -client. compiling
with ikvmc creates a clojure.exe which instead takes 9x to start. clojure-1240
non-slim, java 1.6.0_07, ikvm 0.34.0.4, mono 1.9.1)

~~~
icey
That's pretty interesting... Does mono have a native image generator like
ngen? You might be able to get some performance improvements if it does.

~~~
mindslight
It does, but given how quickly it runs, I can't think it's doing that much? I
remember playing with it a while ago and not seeing any performance worth
remembering.

Apparently the latest version of mono has much better AOT support, and
performance improvements as well.

------
time_management
I'm coming to agree with him about Clojure being the best language out
currently. I've used both it and SBCL and I prefer the former, because SBCL's
lack of up-to-date libraries (compared to the JVM) can be frustrating.

I wouldn't call macros a hard necessity, however. You can accomplish quite a
lot, quickly, in Ocaml or Haskell, even though they're statically typed
languages with no macros. Functors, type classes, and various cool design
patterns (e.g. monads) provide a lot of the abstraction and code reuse that
macros provide. Also, I'd rather use a statically-typed language for a project
with 4+ developers.

I think that 90% of Lisp's headway over a language like Java comes from the
functional paradigm, and 10% from macros.

~~~
jrockway
> SBCL's lack of up-to-date libraries can be frustrating.

But on the flip-side, Clojure's lack of a real object system can be
frustrating. It is also annoying that you have to actively work around the JVM
(for example, when making tail calls). Generally it is a beta-quality
languages with some issues that need to be worked out. (I stick with Haskell
for now when I want to write in a functional style, and CL for everything
else.)

Also, while having Java libraries is better than having no libraries at all,
the code that uses Java libraries becomes very un-lispy. It is a reasonable
compromise, but certainly not ideal.

~~~
weavejester
Clojure has all the components necessary for an object system: multimethods,
hierarchies and structs. It's not quite an object system, but it's not hard to
roll your own from these pieces. Someone on the group has made a CLOS-inspired
library called Spinoza (formally CLJOS) using these components, which you
might want to look into if you're fussed about having proper objects.

