I ventured forth into the fair(y) realm of LISP, and all manner of strange and wonderful things came to be.
Actually, not that much. It’s that time of the year when pre-Xmas madness starts settling in, and as a result there has been entirely too much going on for me to devote a time to my personal projects.
Things have been a bit quiet on the Clojure front, too, at least as far as active coding is concerned. I’ve had to tend to (many) other matters since my last foray into heavy parallelism and got somewhat quagmired in Cascalog (and its rather unhelpful documentation) to boot.
But I’ve been asked to review Clojure High Performance Programming and am about halfway through, so you can expect a little more about that in a few days.
It’s self-hosting, and even though it requires a compilation step (and a working Node setup) I find it more practical than ClojureScript – if only because the compiler is instantaneous (unlike
Another big difference is its nice, readable compiled output. The clear one-to-one match with your own code (which, by the way, includes sourcemaps) makes it a pleasure to use. And that’s before you start using macros – then it gets really interesting.
For my own use, I built a set of different browser bundles with varying capabilities (bundling the read/eval/loop and compiler, a minimal runtime, etc.). That way I can compile and run Wisp directly on the browser (via
application/wisp scripts), allowing for very tight iteration.
But for mid-to-large projects I suppose I’ll need to stick to the “normal” approach and set up a build step.
Hylang is a rather different beast. It’s been around for a bit, and is a LISP dialect that ties directly into the Python runtime. It generates Python ASTs, and is therefore indistinguishable from “regular” Python – which means it works perfectly with PyPy, making it a very fast language.
It too lacks Clojure‘s immutable data structures – that may deter some purists, but the resulting mix of Clojure-inspired syntax and Python libraries is delightfully pragmatic and very enjoyable to code in.
The mind-boggling thing about it is how seamless the interop is. I can import and use Python modules directly (of course – and this makes Hy one of the most immediately useful LISP dialects, right off the bat), but Python can also import and use Hy modules. And the language is so well integrated that debuggers like
pdb “just work”.
In between these two and Clojure, I think my immediate needs are covered – I can quickly prototype stuff in Hy, paste a fair amount of the resulting code into a Clojure project, and build a web front-end with Wisp.
With a few macros and some careful tweaks, I might even be able to run the exact same code on all of them, although that will of course depend mostly on what kind of data structures I’m using – and you can’t really take full advantage of Clojure without buying in to the whole thing, not just the syntax.
But it’s a nice way to slide into the groove, so to speak, and lessening friction when switching between environments helps a lot.