Live data from Hacker News

Why Janet? (2023)

ianthehenry.com

221–230 of 292 posts

Re: Why Janet? (2023)

#221
post #4

> But by allowing you to unquote literal functions, Janet makes it possible to write macros that are completely referentially transparent. These lisp guys really get excited over very abstract things. If you say this to an average person on the street they will probably try to run away.

> over very abstract things. I beg to differ. There's just isn't "easy and straightforward" path to simplicity. We thought that explaining the world with "objects" was simple and instead of using already existing language, OOP took "objects" (an easy choice) and invented a elaborate taxonomy of "patterns" to work around the limitations of objects. Just look at this mess: - Strategy Pattern: Interface + multiple class…

> The Gang of Four book exists because Java made functions second-class citizens

Why do people write silly things like this? GoF was published in 1995, the same year Java was first released, and includes neither Java code nor any mention of Java. Java had no influence on that book.

Re: Why Janet? (2023)

#222

(defn foo [first & rest] ...) So basically Lisp 2.0. Although, this here is a good idea: "pass values from compile-time to run-time" Would be nice if some kind of "scripting" language be as fast as a compiled language, but without ruining the syntax. Just about 99% of the languages that are shown, have a horrible syntax. Syntax is not everything, but most language designers don't understand that syntax also matters.…

can't there theoretically be a language which transpiles to Janet to get all the benefits without additional paranthesis too? Not sure if such transpilation would have a perf hit though, I hope somebody responds who knows about it more. I don't deny that syntax matters itself too but there are some ideas of janet like sandboxing and other features which seem to me to be worth implementing in other languages too. Pers…

> like lua/wren which can transpile to Janet too.

Really? I've used dozens of languages and honestly, I just can't wrap my head around how ugly Lua code can get. At first, I tried treating it as "javascript with no bad parts", turns out, modern JS is far, far better than 1996 JS and nicer than Lua. The most annoying part about Lua is that I never know how to format it for better readability - should I add line breaks, or not, etc. lua-fmt often just makes it worse.

When I found Fennel I immediately moved to it, even though it was "experimental". Since then, I just don't want to deal with Lua, aside from some small one-liners.

Re: Why Janet? (2023)

#223

Earlier quoted context omitted.

> over very abstract things. I beg to differ. There's just isn't "easy and straightforward" path to simplicity. We thought that explaining the world with "objects" was simple and instead of using already existing language, OOP took "objects" (an easy choice) and invented a elaborate taxonomy of "patterns" to work around the limitations of objects. Just look at this mess: - Strategy Pattern: Interface + multiple class…

> The Gang of Four book exists because Java made functions second-class citizens Why do people write silly things like this? GoF was published in 1995, the same year Java was first released, and includes neither Java code nor any mention of Java. Java had no influence on that book.

[dead]

Re: Why Janet? (2023)

#224
post #29

Earlier quoted context omitted.

lobste.rs uses a web-of-trust referral system. I guess it still involves a moderator killing off bad nodes, but it seems to scale well

yeah but I can't post there because I don't know anyone with an account and frankly CBA traipsing around looking for someone who has an account. does seem like more things will have to go this way though

I actually hung out in their IRC for a while hoping to maybe form a social connection and then get an invite, but somehow it just never materialized, and the chat wasn't engaging, so I stopped coming back...

Re: Why Janet? (2023)

#225

Earlier quoted context omitted.

> over very abstract things. I beg to differ. There's just isn't "easy and straightforward" path to simplicity. We thought that explaining the world with "objects" was simple and instead of using already existing language, OOP took "objects" (an easy choice) and invented a elaborate taxonomy of "patterns" to work around the limitations of objects. Just look at this mess: - Strategy Pattern: Interface + multiple class…

> The Gang of Four book exists because Java made functions second-class citizens Why do people write silly things like this? GoF was published in 1995, the same year Java was first released, and includes neither Java code nor any mention of Java. Java had no influence on that book.

iLemming, your reply is [dead] and I don't know why. Responding to parts of it:

> Peter Norvig made this argument explicitly in 1998, showing 16 of 23 patterns are "invisible or simpler" in Lisp

The GoF book even mentions this so Norvig's presentation is a useful read, but even the authors of the book knew it was true. It's not like he added a new idea with that bit you quoted, the useful parts of the presentation were which patterns became invisible or simpler and why.

> Let's try not to nitpick on literal wording to avoid engaging with the substance, could we?

I responded to a common, but false, claim. Don't make false claims and I won't call you out for it.

Re: Why Janet? (2023)

#226
post #77

Thought this might be about JANET, the rationale for which I have never really understood. The wikipedia article on it is not very explanatory: https://en.wikipedia.org/wiki/JANET

From memory, it was for Joint Academic Network. I'm surprised the Wikipedia article doesn't mention it at all, but it seems hard to find an authoritative source.

Re: Why Janet? (2023)

#228
post #204
post #158

Earlier quoted context omitted.

Janet global state is thread local;[1] janet_init() is called once per thread. [1] official docs: https://janet-lang.org/capi/embedding.html

So you can't execute a Janet script on a different thread than it was created on? Still not good: if you're making audio plugins, you don't control the threads which your program runs on. It's just not good enough, IMHO.

Not sure exactly what you're getting at, you mean transfer mid-execution to another thread? You can load and run a script on any thread you can load janet on, and you can coordinate across threads if need be. To clarify, janet_init just sets up the VM

I'd also go take a look at the actual docs and code, I'm not sure I know the exact answer, but assumptions won't help

Edit: there was someone on the Zulip that mentioned working on audio plugins, and there are a couple other audio-related projects you could check out. Someone there might have a better answer -- https://janet.zulipchat.com/

Re: Why Janet? (2023)

#229

Earlier quoted context omitted.

Aw man I love babashka. I will say the lack of static types in clojure is pretty brutal for me. Especially when combined with the obtuse error messages. But I still love babashka and the whole REPL driven world. What did you end up rewriting your bb scripts in?

If there's one thing that I sometimes wish Lisp had, it's types. Most of the time, I don't need or even want them. But when you're doing a big refactor or changing the shape of your primary data structure, it would be nice to have the compiler be able to assist you in detecting locations where you've cross-wired something. But other than that, I don't care. And yes, Clojure's error messages could be better, but they…

> If there's one thing that I sometimes wish Lisp had, it's types.

Let's write some very silly code to turn an integer into a list of digits in Common Lisp:

  (deftype Digit ()
    "A non-negative integer smaller than 10."
    '(Mod 10))

  (defun integer->digits (integer)
    "Turns a given INTEGER into a list of digits."
    (declare (type Integer integer))
    (labels ((digit-loop (integer digits)
                (declare (type Integer integer)
                         (type List digits))
                (if ( (2 0 2 6)

  (digit-loop "2026")
  ; The value
  ;     "2026"
  ; is not of type
  ;     INTEGER
  ; when binding INTEGER
  ;
  ; Type HELP for debugger help, or (SB-EXIT:EXIT) to exit from SBCL.
  ;
  ; Restarts:
  ;   0: [ABORT] Exit debugger, returning to top level.

Re: Why Janet? (2023)

#230
post #206
post #114

Earlier quoted context omitted.

But that’s not how humans writing code generally think about ambiguous expressions. You can see that by how few precedence rules programmers tend to internalize, and often prefer extra parentheses to make sure that the parser interprets it the way they mean.

We absolutely order more likely / preferred options before other options. Codifying that as a short circuit optimization is a feature.

We rarely have preferences that are independent of the concrete use case. Your argument boils down to saying that existing precedence hierarchies are badly designed (or else they would always match everyone’s intuitions), but that’s not the case. (Operator precedence is only one illustrative example here.)
Post reply on HN