• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compare Clojure to Haskell and CL

 
Ranch Hand
Posts: 100
VI Editor Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,
I've been thumbing through Land of Lisp and Learn yourself a Haskell with great interest.
In what situations would those languages hold an edge over Clojure and vice-versa?
 
author
Posts: 20
Clojure
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Clojure's design draws heaviliy from several amazing languages - haskell, ocaml, erlang, common lisp, scheme, etc.

I haven't personally used Haskell in any real project, so I can't comment directly. However, I do believe that Clojure's macro system has advantages that other languages don't have, and can't provide in the same easy way.

What I mean by that is that in Clojure, being a LISP, building mini-languages (DSLs) on top of the core is a natural design pattern. There is language-level support for this, with the macro system. Also, being functional in nature, designing systems in a bottom-up manner is far more natural and results in more expressive and elegant code.

Further, Clojure has explicit support for state-management (safe from multithreading issues). These constructs are much easier to understand and use than, say monads in Haskell.
 
Igor Mechnikov
Ranch Hand
Posts: 100
VI Editor Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Amit Rathore wrote:safe from multithreading issues



Does CL lack something as far as concurrency and multithreading compared to CLojure?
 
Amit Rathore
author
Posts: 20
Clojure
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, for one thing, all core data-structures in Clojure are immutable, which is not true of CL.

Further, Clojure has a built-in STM system which allow for safe state management (be it of a single thing at a time or for multiple things in a coordinated transaction). This doesn't exist in CL, unless you use one of several STM libraries out there. Even then, it isn't automatic, and requires careful discipline from the programmer.

Clojure was designed from ground-up to support safe multithreading.
 
reply
    Bookmark Topic Watch Topic
  • New Topic