2
I never thought it could happen to me. I mean, parentheses? In this day and age? But for the past couple years, my go-to programming language for fun side projects has been a little Lisp dialect called Janet.
(print "hey janet")
I like Janet so much that I wrote an entire book about it, and put it on The Internet for free, in the hopes of attracting more Janetors to the language.
I think you should read it, but I know that you don’t believe me, so I’m going to try to convince you. Here’s my attempt at a sales pitch: here is why you – you of all people – should give Janet a chance.
Yeah, I was curious about Lisp for a while, but just couldn’t get into it until Clojure came out. I find the additional syntax for data literals makes a huge difference in readability. Janet takes a lot of the good parts of Clojure and packages them into a nice and small runtime.
Babashka is another similar project I can highly recommend. It’s a Clojure runtime compiled against Graalvm, so it’s also very lightweight and has instant startup. The nice part with Babashka is how batteries included it is. You have an HTTP server, you can connect to Postgres, parse JSON, etc. all works out of the box. And you can even do REPL driven development against it. You just run
bb --nrepl-server
and connect the editor to it. For example, here’s a full blown HTTP server that can be run as a script:#!/usr/bin/env bb (require '[clojure.pprint :refer [pprint]] '[hiccup.core :as hiccup] '[org.httpkit.server :as server]) (defn handler [{:keys [uri server-name request-method]}] {:body (hiccup/html [:html [:body [:p "URI: " uri] [:p "server-name: " server-name] [:p "method: " request-method]]])}) (server/run-server handler {:port 3000}) (println "serving on port 3000") @(promise)