frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Janet: Lightweight, Expressive, Modern Lisp

https://janet-lang.org
64•veqq•9h ago

Comments

bjoli•4h ago
Is there anything that is janet-unique? I just did a cursory glance, and most of it seems like a scheme with slightly different syntax and a more "modern" standard library.

Why should I switch from my scheme of choice (guile) to Janet?

veqq•4h ago
It's not a Scheme at all! It doesn't have cons cells after all. It's a Clojure-like (maps everywhere, collection api, immutable data structures) with 1mb executable and [servers](http://janetdocs.org/) running under 10mb of ram.

Fibers are very interesting, even used for error handling. I've not wrapped my head around PEGs yet.

ggm•3h ago
If a language lacks cons can it truly be held to be a lisp or has heresy taken over?
exe34•2h ago
It's got Lots of Indented Silly Parentheses.
worthless-trash•3h ago
Thank you for janetdocs.org , I hated having the missing functions from janetdocs.com
bjoli•2h ago
That makes sense. I have always thought about what I would do if I could make a "modern scheme". A lot would be taken from clojure but definitely not everything. Cons cells would stay, but the star of the show would be immutable vectors based on rrb trees or maybe finger trees (efficient concatenation, insertion in the middle etc), HAMTs , concurrentML (like guile-fibers) and a nice looping facility (like my own goof-loop[1]) and restricted mutation. Syntax-case and syntax-parse from racket. An extensible pattern matcher (like the one found in racket).

I would also make strings immutable, maybe like Guile's cow-strings, maybe blobs-with-cursors.

Definitely just copy Guile's delimited continuations.

I think I would just ignore most of r7rs, since I don't think it improves things for the progrmmer.

girvo•1h ago
PEGs (even outside Janet) are amazing and what I reach for all the time :) definitely one of those tools that’s worth learning!
natrys•18m ago
Yep peg.el[1] is now built-into Emacs since 30.1 (which is how I came to know of it, but actually the library seems much older) and it makes certain things much simpler and faster to do than before (once you figure out its quirks).

[1] https://github.com/emacs-mirror/emacs/blob/master/lisp/progm...

worthless-trash•3h ago
I don't know enough about guile, but janet was pretty easy to develop for .

Its binaries are quite small, could wrap and embed raylib and a few small c libraries with no hassle. This makes distribution much easier.

For my simple 2d game jaylib (raylib) code.

  ls -laoh build/app
  -rwxr-xr-x  1 worthless   2.8M 27 Jul 17:28 build/app

  otool -L ./build/app
  ./build/app:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1356.0.0)
        /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 24.0.0)
        /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 706.41.0)
        /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
        /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2674.3.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 4034.0.0)
        /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1951.0.4)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1226.0.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 4034.0.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
I believe those are pretty standard to have on most OSX machines, the situation is similar for my Linux system.

The LLM's really can't deal with janet though, they seem to think its clojure and screw up a lot of things.

asQuirreL•2h ago
I would tend to use Janet for scripts, especially ones that need to talk to the outside world because of its fast startup and batteries included standard library (particularly for messing with JSON, making HTTPS requests, parsing with PEGs, storing data in maps), while I would use guile for larger projects where things like modularity, performance, or metaprogramming were more important to me.

That being said, these days I use Clojure for both (I use babashka to run scripts: https://babashka.org/)

3036e4•1h ago
I did most of the 2023 Advent of Code using Janet and it was a great experience. I forced myself to use PEGs as much as possible, even when it was overkill, and I really began to like those for the readability and ease compared to other parsers/regexps that I have used.

I like that it is a small language without dependencies. Have it installed everywhere, including in termux on my phone. Good for scripting.

Used to daydream about a native Clojure and Janet is close enough to that. Does not have everything, but the cost in size and dependencies is so much lower. It is simpler and easier and runs well even on a RPi Zero.

terminalbraid•1h ago
One big difference is you can compile Janet programs down to executables without any additional dependencies or runtimes. It makes distribution extremely nice. The ffi is also much easier.
atemerev•1h ago
If you are happy with Guile, I guess Janet is not worth switching (it is faster, though). It is absolutely and explicitly not Scheme, though. More like natively compiled and script-optimized Clojure.
xigoi•20m ago
One thing I really like about Janet, compared to Scheme, is that it’s one language instead of a family of similar but incompatible languages.
dmpk2k•1h ago
Does it have a native compiler and/or types? Basically, can it get in the ballpark of SBCL's performance?

It'd be nice to have something cleaner than Common Lisp, and a much smaller image size. If it has decent performance too, I'm sold.

atemerev•1h ago
This is not a replacement for Common Lisp. It is in the same niche as Guile (but quite faster).
terminalbraid•25m ago
Janet does compile to standalone executables with jpm
ethan_smith•21m ago
Janet uses a bytecode VM that's faster than many dynamic languages but won't match SBCL's native compilation performance; it has optional type annotations for documentation but not for optimization.
NeutralForest•50m ago
Janet is awesome but pretty please, work on the tooling. There's very little in the way of working and debugging interactively with the REPL from any IDE that I know of and last time I tried (on Emacs) there was barely a dedicated mode to work with it.
worthless-trash•44m ago
I use janet ts mode in emacs and Ajsc netrepl integration, for at least a while now.

You should try again.

NeutralForest•31m ago
oooh cool! thx
terminalbraid•31m ago
Janet is also supported by conjure in neovim

https://github.com/Olical/conjure

The LSP for it works reasonably well.

mesaoptimizer•36m ago
Also see https://janet.guide/ for a good introductory book to Janet.
raydenvm•35m ago
Are there any known commercial use cases?
revskill•27m ago
I do not see how it handles async await
terminalbraid•22m ago
You should take a look at fibers

https://janet-lang.org/1.9.1/docs/fibers/index.html

nemoniac•18m ago
The first code example on that page claims to solve "the 3SUM problem".

According to [1], "the 3SUM problem asks if a given set of n real numbers contains three elements that sum to zero."

It's not clear to me what problem the Janet code solves but it's clearly not that 3SUM problem.

On the example input of

    @[2 4 1 3 8 7 -3 -1 12 -5 -8]
it outputs

    @[@[6 1 7] @[2 5 10] @[1 2 9] @[4 6 9] @[3 0 9] @[6 2 0]]
For what it's worth, here's some Common Lisp code that does solve the 3SUM problem in O(n^2).

    (defun 3sum (a)
      (let ((h (make-hash-table))
            (len (length a)))
        (dotimes (i len)
          (setf (gethash (aref a i) h) t))
        (dotimes (i len)
          (dotimes (j i)
            (when (gethash (- (+ (aref a i) (aref a j))) h)
              (return-from 3sum t))))))
    
    (3sum #(2 4 1 3 8 7 -3 -1 12 -5 -8))
    ;; => t

[1] https://en.wikipedia.org/wiki/3SUM
bmacho•7m ago
[delayed]

When We Get Komooted

https://bikepacking.com/plog/when-we-get-komooted/
155•atakan_gurkan•3h ago•65 comments

Linux on Snapdragon X Elite: Linaro and Tuxedo Pave the Way for ARM64 Laptops

https://www.linaro.org/blog/linux-on-snapdragon-x-elite/
76•MarcusE1W•3h ago•36 comments

Chemical process produces critical battery metals with no waste

https://spectrum.ieee.org/nmc-battery-aspiring-materials
124•stubish•6h ago•6 comments

Sapients paper on the concept of Hierarchical Reasoning Model

https://arxiv.org/abs/2506.21734
53•hansmayer•3h ago•11 comments

Fast and cheap bulk storage: using LVM to cache HDDs on SSDs

https://quantum5.ca/2025/05/11/fast-cheap-bulk-storage-using-lvm-to-cache-hdds-on-ssds/
100•todsacerdoti•7h ago•25 comments

Smallest particulate matter air quality sensor for ultra-compact IoT devices

https://www.bosch-sensortec.com/news/worlds-smallest-particulate-matter-sensor-bmv080.html
83•Liftyee•7h ago•30 comments

A low power 1U Raspberry Pi cluster server for inexpensive colocation

https://github.com/pawl/raspberry-pi-1u-server
61•LorenDB•3d ago•25 comments

Janet: Lightweight, Expressive, Modern Lisp

https://janet-lang.org
65•veqq•9h ago•29 comments

Implementing dynamic scope for Fennel and Lua

https://andreyor.st/posts/2025-06-09-implementing-dynamic-scope-for-fennel-and-lua/
11•Bogdanp•3d ago•0 comments

Resizable structs in Zig

https://tristanpemble.com/resizable-structs-in-zig/
129•rvrb•13h ago•57 comments

How we rooted Copilot

https://research.eye.security/how-we-rooted-copilot/
310•uponasmile•18h ago•123 comments

Purple Earth hypothesis

https://en.wikipedia.org/wiki/Purple_Earth_hypothesis
231•colinprince•3d ago•63 comments

Rust running on every GPU

https://rust-gpu.github.io/blog/2025/07/25/rust-on-every-gpu/
544•littlestymaar•1d ago•183 comments

Low cost mmWave 60GHz radar sensor for advanced sensing

https://www.infineon.com/part/BGT60TR13C
80•teleforce•3d ago•28 comments

16colo.rs: ANSI/ASCII art archive

https://16colo.rs/
49•debo_•3d ago•12 comments

Coronary artery calcium testing can reveal plaque in arteries, but is underused

https://www.nytimes.com/2025/07/26/health/coronary-artery-calcium-heart.html
97•brandonb•13h ago•86 comments

Reading QR codes without a computer

https://qr.blinry.org/
16•taubek•3d ago•2 comments

Personal aviation is about to get interesting (2023)

https://www.elidourado.com/p/personal-aviation
108•JumpCrisscross•11h ago•90 comments

What went wrong for Yahoo

https://dfarq.homeip.net/what-went-wrong-for-yahoo/
184•giuliomagnifico•16h ago•175 comments

Cable Bacteria Are Living Batteries

https://www.asimov.press/p/cable-bacteria
32•mailyk•3d ago•3 comments

Show HN: QuickTunes: Apple Music player for Mac with iPod vibes

https://furnacecreek.org/quicktunes/
77•albertru90•11h ago•24 comments

Beyond Food and People

https://aeon.co/essays/nietzsches-startling-provocation-youre-edible-and-delicious
11•Petiver•3h ago•2 comments

Paul Dirac and the religion of mathematical beauty (2011) [video]

https://www.youtube.com/watch?v=jPwo1XsKKXg
70•magnifique•12h ago•5 comments

Teach Yourself Programming in Ten Years (1998)

https://norvig.com/21-days.html
89•smartmic•13h ago•38 comments

The natural diamond industry is getting rocked. Thank the lab-grown variety

https://www.cbc.ca/news/business/lab-grown-diamonds-1.7592336
208•geox•22h ago•248 comments

Getting decent error reports in Bash when you're using 'set -e'

https://utcc.utoronto.ca/~cks/space/blog/programming/BashGoodSetEReports
122•zdw•3d ago•35 comments

Arvo Pärt at 90

https://www.theguardian.com/music/2025/jul/24/the-god-of-small-things-celebrating-arvo-part-at-90
90•merrier•13h ago•24 comments

Where are vacation homes located in the US?

https://www.construction-physics.com/p/where-are-vacation-homes-located
98•rufus_foreman•16h ago•71 comments

Torqued Accelerator Using Radiation from the Sun (Tars) for Interstellar Payload

https://arxiv.org/abs/2507.17615
64•virgildotcodes•12h ago•7 comments

Shallow water is dangerous too

https://www.jefftk.com/p/shallow-water-is-dangerous-too
129•surprisetalk•3d ago•98 comments