LiveScript vs ClojureScript

February 1, 2015

The following are my pros/cons notes comparing LiveScript (which I really loved using) to Clojure(Script), and eventually to Racket. The conclusion was that ClojureScript wins, partly because of my other biases toward Clojure.

LS

Pros

  • concise, haskell-like

  • improved coffee, a very popular language

  • npm

  • node is fast

  • beautifully simple standard node lib

  • brunch et al

  • jade (hiccup might suffice, but there is clj-jade)

  • angular/backbone

  • express

  • socket.io

  • d3 (but c2)

  • native json

  • many lessons/projects already written in ls

  • put into any proj that uses coffee

  • testing frameworks

  • plugs into everything where js is used with minimal change

Cons

  • callback hell

  • impossible async recursion (and no tco)

  • not multi-threaded so maybe harder to scale for production

  • poor repl

  • too many npm pkgs to choose from

  • won’t paste into browser repl

  • bad vim syntax highlighting (fixable)

  • node won’t go on windows (anyone care?)

  • prelude confused with underscore/lodash/async/nimble

  • obscure

  • syntax heavy; a bit quirky

  • surprising scope issues

  • JavaScript\* community fragmented among langs/tools

CLJ(S)

Pros

  • lisp, beautiful functional

  • a fit for every domain

  • immutability

  • avoids node event loop

  • 4clojure for practice/competition

  • multi-runtime options (java, node, browser)

  • maybe preferred by academics

  • browser repl?

  • native structures more expressive/concise than json and racket’s

  • edn

  • concurrency

  • sensible scoping

  • easier to teach (vs ls), been done many times

  • laziness

  • clojure toolbox (nicely settles on a few tools for any job)

  • many settled libs: korma/sql, hiccup/templating, luminus/web, incanter/stats, midje/testing

  • obviates ChucK with Overtone

  • lighttable as drracket competitor

  • om/reagent/react

  • practical real-world, employable skillset

  • js compatible (ClojureScript)

  • simple web deployment via uberjar/uberwar to jetty, tomcat, or nginx

  • google closure compiler/optimizer (though heavy)

  • macros

Cons

  • too bulky for raspi!

  • memory hogging beast! so not good for kids learning on limited hw

  • slow startup? (but maybe okay since single repl stays alive for days)

  • lots of parens, more verbose

  • prefers emacs (but PG uses vi)

  • heavy on java and suffers from its limitations

  • RPN opaque for beginners

  • lacking JavaScript/node/npm ecosystem?

  • complexity of setup

  • terrible error messages, but clj-stacktrace

Continue reading →