Post

HN
Hacker News

Why Janet?

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 .

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.

Janet is an imperative language with first-class functions, a single namespace for identifiers, and lexical block scoping. The core of the language is very small, consisting of only eight instructions: do , def , var , set , if , while , break , fn . But thanks to macros, there are lots of high-level wrappers that give you more powerful or convenient control flow.

You can โ€œlearnโ€ Janet in an afternoon, because the runtime semantics are extremely familiar: think JavaScript, plus value types, minus all the wats. And the rest of the language is small: the entire standard library fits on one page . It was this ease of getting started that got me hooked in the first place.

Itโ€™s easy to compile Janet programs into native executables that statically link the Janet runtime. And you can share those programs with other people, without asking them to install Janet first โ€“ or your projectโ€™s dependencies, or anything else for that matter. You donโ€™t even have to tell them itโ€™s written in Janet!