Skip to content
Tech News
← Back to articles

Why Janet? (2023)

read original more articles
Why This Matters

Janet is a minimalist, easy-to-learn programming language that appeals to developers for its simplicity, flexibility, and portability. Its design allows for quick mastery and seamless distribution of applications as native executables, making it a practical choice for both hobbyists and professionals. This highlights a growing trend toward lightweight, self-contained languages that simplify development and deployment processes in the tech industry.

Key Takeaways

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.

Janet is simple

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.

There are actually five more instructions that exist to support macros: quote , unquote , quasiquote , splice , and upscope . But you don’t have to write those in “regular” code.

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.

Janet is distributable

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!

... continue reading