Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@honza
Created May 16, 2012 14:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save honza/2710877 to your computer and use it in GitHub Desktop.
Save honza/2710877 to your computer and use it in GitHub Desktop.
Haskell versus Clojure

Haskell versus Clojure

I'm trying to decide which of these two I want to learn right now. I'll probably end up doing both but can't invest at the moment.

Clojure

Pros:

  • The JVM is a fast, stable platform
  • Ease of web app deployment (Heroku, etc)
  • LISP, macros
  • Good package manager
  • Java libraries available

Cons:

  • Ridiculously long startup time (useless for scripts)
  • Lack of types
  • Less popular on Github

Haskell

Pros:

  • Type system
  • Fast start up (+ runghci)
  • "If it compiles, it does what you want."
  • Longer history
  • More popular on Github

Cons:

  • Compiles to native code which makes it more difficult to deploy Haskell apps on things like Heroku
  • Horrible package manager
@swannodette
Copy link

Given ClojureScript I don't think it's accurate anymore to say that Clojure is not useful for scripting.

@honza
Copy link
Author

honza commented May 16, 2012

@swannodette Write in Clojure, compile to Javascript and run on node.js? I guess that would work, except you're losing the raw speed of Java. For simple things, this would work fine.

@swannodette
Copy link

V8 is getting very fast. I recently ran the Alioth benchmark for spectral-norm single-threaded on the JVM. The same code written in ClojureScript running on V8 is within 1.5X :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment