Live data from Hacker News

Why Janet? (2023)

ianthehenry.com

141–150 of 292 posts

Re: Why Janet? (2023)

#141

Earlier quoted context omitted.

Pay per interaction model? 1 cent per post.

Probably the only solution. But the penny has been deprecated so it will have to be a nickel.

Only copper was deprecated. Real $0.01 absolutely exists in your bank etc.

Anyway, marketers see a popular site like a physical billboard, where they would pay thousands a month for their message to be seen by thousands of people. If you made it cost pennies to post, and a few more pennies to boost and astroturf, AND that the post would be seen by millions of people, they'd say "By Grabthar's hammer, what a bargain!!" and order a hundred more per day...

Re: Why Janet? (2023)

#142
post #137
post #121

Earlier quoted context omitted.

The kind of subtle difference I’m talking about is that in C, you have to put a semicolon after struct {…} and do {…} while (…), but not after other curly brace constructs. What would be the analogue in Janet?

The first one is pretty C-specific and for example doesn’t exist in Java. Similarly for the second one, the reason is that `while` is used for two different constructs, which for example isn’t the case in Rust. These are just accidental complexities stemming from unfortunate design decisions in C. Having a richer repertoire of syntactic constructs doesn’t by itself imply such complications. My point was, replacing n…

> The first one is pretty C-specific and for example doesn’t exist in Java.

It was just an example, most languages have quirks like this. I don’t know about Java, but in Rust you have the turbofish operator, whose necessity stems from using the less-than sign as both an operator and a delimiter.

> My point was, replacing n syntactic constructs by n functions or macros doesn’t reduce the cognitive load of having to know each of them.

The difference is that if you don’t know a function/macro, you can just read its documentation. If you don’t know a syntactic construct, where do you look?

Another advantage is that if you want to create new functionality similar to existing language features, it won’t stick out like a sore thumb. For example, you could create an until loop:

  (until (window-should-close)
    (draw-screen))
  # is equivalent to
  (while (not (window-should-close))
    (draw-screen))
In Rust, it would have to look completely different from a while loop:

  until!(window_should_close(),
    draw_screen());
  // is equivalent to
  while window_should_close() {
    draw_screen();
  }

Re: Why Janet? (2023)

#143
post #105
post #87

Earlier quoted context omitted.

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 execu…

There are reasons why not that many programmers “get it”, and it’s not because the others are uninformed. It’s a matter of valuing different things.

Absolutely! But it’s also because they don’t really understand one of the things. It’s the Blub Paradox.

Re: Why Janet? (2023)

#144

Does embedding Janet still lean on global state?

My first question too, and I checked out the linked book [1], and sure seems like it! There's global functions like `janet_init()` and `janet_loop()` all over the place.

A language shouldn't advertise itself as "embeddable" if it does this. It means you can't have multiple interpreters, you can't use it on multiple threads, etc. GNU Guile does this too, and it's a baffling decision! For my field (audio plugins like VSTs), it means it's absolutely a no-go, because hosts can load any number of instances of your plugins and potentially run them in parallel in the same address space, they can't rely on global state like this. Each interpreter has to be separate.

Lua does this right, as does Python (as of 3.12, when they made the GIL local to each interpreter) and I think most of the JavaScript engines. And it's not hard, instead of a global `janet_init()`, just have an opaque pointer bundle all the state, like `janet_init(interpreter)`. If you want a global interpreter, just stick it in a global variable.

[1]: https://janet.guide/embedding-janet/

Re: Why Janet? (2023)

#145
post #3

This post is refreshing - smells of the pre AI discussions on the internet. A new language, a new syntax, heavy debate with people who have spent years writing code. I think someone should start a community online where AI isnt allowed.

> 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…

I suspect real ways to keep AI out of a community, or really to have an online community at all, are going to be structurally incompatible with making anyone rich. The possibility of getting rich poisons the incentives.

Re: Why Janet? (2023)

#146
post #124

Earlier quoted context omitted.

Half the posts here are AI grifting.

That’s a pretty extraordinary claim. Do you have anything quantitative to back it up? HN has bots, I think that is a fair assumption, but half? How do you know that for sure?

[flagged]

Re: Why Janet? (2023)

#148

Earlier quoted context omitted.

That’s a pretty extraordinary claim. Do you have anything quantitative to back it up? HN has bots, I think that is a fair assumption, but half? How do you know that for sure?

[flagged]

TIL that statements of obvious exaggeration are called causal, hyperbolic statements. Who knew?

All kidding aside, I've never heard them called causal hyperbolic before. It's a good term.

Re: Why Janet? (2023)

#150

This got me thinking of Hy. I wonder how syntactically close they are; there might be an exploitable Python -> Hy -> Janet path here. [0] https://hylang.org/

I use both. They're similar for simple use, but above a certain level of complexity Hy has a lot of Python-isms that bleed through. It really doesn't ever let you forget that underneath all the parentheses you're really writing Python. Janet feels like its own stand-alone language in that respect, where Hy is more like a syntax swap.

I have the impression that Hy's user base is larger, though (not that either one is huge).

Post reply on HN