[erlang-questions] Clojure

Robert Virding <>
Sun Sep 14 21:19:49 CEST 2008


I was flirting a bit with the ??? and looking at Clojure. While I am not
that impressed (LFE is better :-)) there was some interesting stuff in the
Rationale:

Object Orientation is overrated
+ Born of simulation, now used for everything, even when inappropriate
    - Encouraged by Java/C# in all situations, due to their lack of
(idiomatic) support for anything else

+ Mutable stateful objects are the new spaghetti code
    - Hard to understand, test, reason about
    - Concurrency disaster

+ Inheritance is *not* the only way to do polymorphism

+ "It is better to have 100 functions operate on one data structure than to
have 10 functions operate on 10 data structures." - Alan J. Perlis

+ Clojure models its data structures as immutable objects represented by
interfaces, and otherwise does not offer its own class system.

+ Many functions defined on few primary data structures (seq, map, vector,
set).

+ Write Java in Java, consume and extend Java from Clojure.

Couldn't have said it better myself, except for the Java bit and the end. Of
course deciding to base it on the JVM has introduced some strange things for
a functional language, for example the lack of (guaranteed) last-call
optimisation means they have a recur form for recursion. This only works for
recursion and not general jumping around.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080914/39cb04cd/attachment.html>


More information about the erlang-questions mailing list