Live data from Hacker News

Why Janet? (2023)

ianthehenry.com

81–90 of 292 posts

Re: Why Janet? (2023)

#81

Earlier quoted context omitted.

> a new syntax How is the syntax new? It looks like lispy - see the outer parens in the examples given.

Heh, every time you show a average developer lisp for the first time the reaction is the same. Little do they know conditionals, GC, REPLs, macros and more comes from the syntax and language dreamed up in the 50s/60s.

I don't see why Lisp's history would necessarily imply the family is worth learning in 2026. What (other than macros) do lisps offer that other modern languages don't?

Re: Why Janet? (2023)

#82
post #68

Earlier quoted context omitted.

This is such a undervalued benefit, once you've learned s-expressions, you can basically learn a bunch of languages without having to learn completely new syntax. It'll be slightly different, with different idioms and names, but a hell of a lot easier than doing the same across every "It's like C but 50% of the syntax is different actually" language out there, which is most of them.

Is the syntax really the stumbling block for most languages? Would Rust's lifetimes or Swift's isolation rules be easier if they used more parens? Are the scoping rule differences between Emacs Lisp and Scheme easier to comprehend because the syntax is similar?

Yes it is, because as soon as programmers step out of the most basic language level (which is kinda similar in most mainstream languages) there's a bunch of wildly different concepts, with wildly different ways of writing them. Writing them in isolation might be manageable, but it's combining them effectively that gets hairy very quickly, unless one is very experienced in said language. But then, translating that to OTHER languages becomes a bar that is too high!

Re: Why Janet? (2023)

#83

Always nice to see janet getting some attention. shout out to one modern feature: sandbox "Disable feature sets to prevent the interpreter from using certain system resources. Once a feature is disabled, there is no way to re-enable it." https://janet-lang.org/api/misc.html#sandbox

It's a really cool feature but what is a scenario when your average programmer needs such sandboxing?

Re: Why Janet? (2023)

#84
Janet is ALMOST an incredible tool...but what I want is a very clear bifurcation between the standard library's stateful mutating procedures, and stateless value-returning functions. I ran into that wall hard trying to make something non-trivial.

It also turns out that the mix is due to the standard library leaning on raw C loop iterations underneath whenever it can. Which is great! But it confuses the library's interface paradigms.

Re: Why Janet? (2023)

#85
post #45

Earlier quoted context omitted.

> Also my main objection to Lisps is still the horrible bracket syntax. Yes it's unambiguous and easy to parse, but it's HORRIBLE to read and edit. I use Parinfer, which allows me to edit Janet as if it was an indentation-based language.

Yeah I mean I guess if you have to use that syntax, it's nice to have a better editor for it. But IMO the existence of that tool clearly demonstrates that the syntax is pretty bad.

Most editors manage your indentation, parentheses and braces for you. Not sure how that is a unique marker for lisp style languages.

Re: Why Janet? (2023)

#86

> SETQ is def At first I said "what" out loud, since SETQ doesn't create bindings, it only updates them then I read the doc ( https://janet-lang.org/docs/bindings.html ) and the author is indeed wrong ("bindings created with def are immutable"). He probably meant "SETQ is set". I really want to like Janet, as it seems to be the sweet spot between Guile, Tcl and CL (minus the speed/maturity of SBCL) but I have a visce…

Square brackets’ use is very consistent and rather logical in how they are used in Clojure’s syntax.

When round brackets are used, the first element in the list defines how the rest of the list is interpreted, for example:

(func a b c) — run a function with its parameters

(macro x y z) — expand a macro with its parameters

([p q r] …) — “bare” function body that starts with a vector of parameters, and executable forms follow.

Square brackets are used where elements are the same “kind”, and the first one is not special, e.g.:

(defn f [a b c] …) — a collection of same-kind parameters, the first parameter is not special

(let [a 1 b 2] …) — a collection of bindings, the first binding is not special

The only exception that comes to mind is grouping multiple matching elements in `case`, but it for ergonomics.

Once I got the logic, when which is used, I changed my mind, and ever since I’ve felt it’s beautiful.

Re: Why Janet? (2023)

#87

Earlier quoted context omitted.

Heh, every time you show a average developer lisp for the first time the reaction is the same. Little do they know conditionals, GC, REPLs, macros and more comes from the syntax and language dreamed up in the 50s/60s.

I don't see why Lisp's history would necessarily imply the family is worth learning in 2026. What (other than macros) do lisps offer that other modern languages don't?

You don’t program in Lisp, do you? I used to be confused by the smug Lisp weenies. Now I am one. And the difficult thing I’ve found over the years is that Lisp is sort of unexplainable. You either “get it” or you don’t. Yes, it has macros, but macros are a bit overrated. I’ve been programming in Lisp for decades and I rarely write macros. I think the thing that is difficult to convey is how powerful Lisp’s core execution environment is while at the same time being just a page of code that a CS undergraduate can understand. Literally everything else is a library. And those libraries can create syntax, generate code on the fly, and do many other powerful things. But most people won’t “get it” until they take the plunge. I didn’t. Until I did. And now, I don’t feel a need to defend Lisp at all. It won’t go away. You can’t kill it. The folks that “get it” will always have it, and those that don’t “get it” will reach for their Blub language again and again. Such is the way of the world.

Re: Why Janet? (2023)

#88

Always nice to see janet getting some attention. shout out to one modern feature: sandbox "Disable feature sets to prevent the interpreter from using certain system resources. Once a feature is disabled, there is no way to re-enable it." https://janet-lang.org/api/misc.html#sandbox

It's a really cool feature but what is a scenario when your average programmer needs such sandboxing?

I sandbox all my utilities and programs in case some compromised third-party dependency decides to run lose. It's a way to limit the blast radius.

Re: Why Janet? (2023)

#89

Earlier quoted context omitted.

> I think someone should start a community online where AI isnt allowed. In case you haven't followed the saga, the latest[1] digg.com relaunch failed because they couldn't deal with the bot onslaught [2]. Whoever finds a reliable way to keep AI out of an online community first is likely to become a very rich person. [1] Second-to-last, actually, seeing as there seems to be a new homepage right now. [2] https://www.t…

Perhaps requiring webauthn credential for any post/comment with a whitelist of permitted webauthn hardware devices which must have touch/interaction enabled. I'd have to read the FIDO specs, however the only place I've seen webauthn hardware pinning in the wild is with Azure AD/Entra which is ostensibly based on token GUID. If this is the only enforcement mechanism available, it's spoofable.

Then you’ll end up with a forum of only bots because they’ll spoof it and real people won’t put up with the hassle.

Re: Why Janet? (2023)

#90

Always nice to see janet getting some attention. shout out to one modern feature: sandbox "Disable feature sets to prevent the interpreter from using certain system resources. Once a feature is disabled, there is no way to re-enable it." https://janet-lang.org/api/misc.html#sandbox

It's a really cool feature but what is a scenario when your average programmer needs such sandboxing?

you're embedding it as a scripting api and want to limit permissions to just what's needed
Post reply on HN