Clojure is Cool


This is the single biggest selling point to most lisps (and the overbearing factor in my love for them), and is completely unique, not just to development compared to a 'typical' language (compiled or interpreted), but unique/superior even to other languages that lean towards a REPL based approach (J / APL / Prolog / Elixir) of programming and trying out some code.

I like to term this as 'time between cause and effect' - or the time it takes between making a change, and seeing the result of that change.

In a compiled language, this is usually very large - a programmer will update the program, recompile it, execute it, and finally see the result of the change.

In an interpreted language, this is slightly less - the compilation step is removed.

In a test driven development (TDD) methodology, this is even less - the execute it scope is reduced from the entire world of the software, to the specific segment of code being developed (but, this requires a lot of boilerplate, and even the test runner is not always tightly coupled to an individual test at the editor level).

Some of the languages that offer a pleasant REPL experience (even PHP and Nodejs give a decent built in REPL) still run into the problem of having 2 separate environments - there is the actual world of the software (the execution runtime), and then an isolated 'interactive' environment - often a very manual and ephemeral experience - the user runs code - those commands run simply disappear when the session ends etc.

What if there was a coupling between the code itself, at an individual snippet level, and the REPL environment? And what if the REPL environment and the execution runtime/world were one in the same? With lisp(s), that's the case!

It was a bit mind blowing my first time trying it - "do I type code in the REPL and it saves it to a source file somewhere?" I asked myself (or perhaps some kind folks in IRC)? No! You actually modify your program in your source file, select an s-expression (a block of code surrounded by parenthesis) and evaluate just that block of code in your running REPL / runtime image. It was a bit mind blowing to realize, and a great revelation was revealed, as it became clear that all those parenthesis were for a very good reason (for this interactive functionality to work well - imagine trying to re-evaluate a single snippet of code in ANY other non-lisp language - good luck writing a parser that can handle redefining a single method without having to 'hot reload' an entire file (or, in many cases, an entire project!). Lets just say, it makes all those other times between cause and effect appear to be eons (even those of you who may have tried out front end with 'fast' hot module reloading like typescript fusebox, or create-react-app - try out something like Clojurescript and fighweel - you will not want to go back).