4 ms·
Not speaking for hydandata, a few key points of CL as opposed to Clojure (which might be advantages or disadvantages depending on context and preference) includ
by 0xcde4c3db 10y ago
Not speaking for hydandata, a few key points of CL as opposed to Clojure (which might be advantages or disadvantages depending on context and preference) include:
- Defined by a standard (the text of the standard is available for free online as the Common Lisp HyperSpec [1]), not by a reference implementation led by a BDFL
- Multiple mature implementations, both free and proprietary
- Wholeheartedly multi-paradigm; has FP features, but also provides plenty of tools for imperative (notably including a powerful macro for loops) and (meta)object-oriented approaches
- "Lisp-2" rather than "Lisp-1"; functions and variables are in different namespaces, which reduces name clashes but requires disambiguation in some places
- Designed for implementation in a wide variety of environments, including being embedded as an extension/scripting language in C or C++ applications (see ECL [2])
[1] http://www.lispworks.com/documentation/HyperSpec/Front/index.htm http://www.lispworks.com/documentation/HyperSpec/Front/index...
[2] https://common-lisp.net/project/ecl/ https://common-lisp.net/project/ecl/
- kakapupu 10y ago> Defined by a standard How does this help, compared to Clojure? > Multiple mature implementations Why wouldn't one free mature implementation be good enough? > Wholeheartedly multi-paradigm Exactly like Clojure. > "Lisp-2" rather than "Lisp-1" I can't remember which one Clojure is :) But I haven't had any problems with namespaces and the like. > Designed for implementation in a wide variety of environments So is Clojure, right? There's the CLR version, and ClojureScript too.
- lispm 10y agoClojure variants are incompatible in various basic ways, since they use the host language for various things. The underlying platform also restricts what the implementation provides. No TCO in JVM -> no TCO in Clojure. Numbers are internally floats in Javascript -> Numbers are internally floats in ClojureScript and use Javascript semantics, not Clojure-Semantics. Clojure: Clojure 1.8.0 user=> (/ 3 4) 3/4 ClojureScript cljs.user=> (/ 3 4) 0.75 Looks like these are different languages... Common Lisp implementations OTOH implement most of the standard. There is also more choice in implementations: * native implementations AND hosted implementations * actual Lisp interpreters or a mix of interpreters and compilers, interactive compilers, batch compiler * compilers written in Lisp itself with good error messages, forms of compile-time type checking/inference, and advanced error handling (like SBCL, CMUCL) * compilation to C, full embedding into C programs (ECL and others) * full embedding in C++ (CLASP) * compilation to shared libraries, embeddable into other applications * whole program compilers for delivery of compact applications (like mocl) The main Clojure compiler is written in Java and it shows... https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java https://github.com/clojure/clojure/blob/master/src/jvm/cloju... If one targets a certain host environment (JVM, Javascript, ...) then this range of options and choice might not matter, even hinder - besides getting a poorer version of interactivity. If we see a Lisp as a language on its own, then it matters a lot.
- azrazalea 10y ago> > Wholeheartedly multi-paradigm > Exactly like Clojure. Clojure is definitively not multi-paradigm. The only blessed by the developers/community paradigm is functional.