Skip to content

Janet Verison 1.42.0 Out

github.com/janet-lang
10 pointsveqq4 comments
On HN

Comments

I wonder how Janet compares to Jolt and when should you choose one vs another.

veqqOP

When I first started Janet, I had a conversation along these lines: Would I stay when Jank was ready?

Now, Jank is sort of ready. Jolt seems ready. But actually the whole Clojure ecosystem seems bloated in various ways. Java interop being idiomatic is the worst part of Clojure, and can't be undone. Though I prefer some aspects to Janet (better naming, pure functions/standard library), I like Janet's tooling more! I like Janet's imports and compilation model more (everything out of main is compile time)! I've been thinking about a Janet2 for a while: https://alexalejandre.com/notes/janet2/ and I think the real gains are in the opposite direction of Clojure: e.g. optional times for 10-20x speed ups (coming very, very soon) or correctness. In particular, I love array and logic language ideas (Clojure lacking pattern matching was... a choice.)

Generally speaking, I anticipate Jolt will make sense in more use cases, but Janet has more of a focus on cute DSLs like sh-dsl.

Java interop being idiomatic is the worst part of Clojure

But Clojure today is not only on JVM - I use nbb, and sometimes Squint; I fooled around Clojure-Dart; You can even wrap some Elisp into Clojure today, although I have yet to find a practical use case for that - Elisp is very text-oriented, while every other Lisp is data-oriented, and I lately don't have any tasks for Emacs that require data-centric approach.

I also write some Fennel - iirc it started by the same person who authored Janet. I'm an early adopter - at some point one of my projects held second most starred Fennel GitHub thing. I switch between Lisps with almost no mental overhead - for me, they all practically the same language, but the absence of Clojure's standard library functions is a bummer, I suppose that would be the same in Janet. Perhaps that's slightly bigger annoyance for me than the absence of the built-in pattern matching in Clojure.

So, the decision to pick Fennel was always answerable with a single: "do I need to target Lua?" question. I'm not exactly sure what questions would answer "why I should grab Janet?". I was thinking of using it instead of babashka for some shell-scripty things, but bb turned out to be a bit more ergonomic. Although impractically memory hungry. And Jolt now being a new kid on the block throws another wrench into my [in]decision. I guess I won't really know unless I try.

Thank you for humoring me and telling me about Janet2, I only hearing about it now.

I only really know Janet by going through "Janet for Mortals" - so I'm by no means an expert

https://janet.guide/

But while it superficially has similar syntax to Clojure, it's fundamentally a very very different language. You don't have immutable data-structure. It's intended to be used in an imperative way. It's extremely minimal in a kind of Scheme-y way. It's sort of like Scheme with more creature comforts. It was a very interesting PEG system for building DSLs and an innovative "runtime" where the program state is also a Janet program in an of itself. It's very weird and has new paradigms.

In the end I wasn't sure where I'd ever really want to use it though. Maybe similar scenarios as Scheme? If I wanted a scripting language where the whole language is something I could keep in my head.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.