Earlier quoted context omitted.
> 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 we…
Why Janet? (2023)
231–240 of 292 posts
Re: Why Janet? (2023)
#232janet has replaced sh, python, awk, etc. for me, for system scripts over a certain length! it has a very fast startup time (on my system, 1.4ms via hyperfine vs. 1ms for dash) for scripts (not compiled executables), and its sh-dsl module allows typing shell commands very elegantly, like ($ cmda w x | cmdb y z). the ability to load an image to debug is a big help, too. i've started using it very recently but it's prob…
> janet has replaced sh, python, awk, etc.... babashka did that for me.
Between babashka, janet(i discovered it just now), fennel, guile. Which one would be a better scripting language? Please tell me you experience, and if you are interested, we can work on a small article and benchmark about this.
Re: Why Janet? (2023)
#233Earlier quoted context omitted.
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 we…
You can replace Java there with pretty much any OOP language, where functions are not first-class citizens, and it will still be true. There are no "false claims" here. The main point is valid. We have orchestrated an entire industry around "objects", while much simpler abstractions have already existed. You probably just have not experienced the "true" nature of Lisp, where you can interactively change any behavior…
You wrote:
>> The Gang of Four book exists because Java made functions second-class citizens
That is a false claim. You asserted a causal relationship between Java and the content of the GoF book that does not exist without time travel.
> You probably just have not experienced the "true" nature of Lisp, where you can interactively change any behavior of the running program, directly from your editor, without linking, linting, compiling, restarting or even saving the code you type.
Sure buddy. You know so much about me...
Re: Why Janet? (2023)
#234Earlier quoted context omitted.
> janet has replaced sh, python, awk, etc.... babashka did that for me.
This is a great comparison and I've been wondering about it for a while. Between babashka, janet(i discovered it just now), fennel, guile. Which one would be a better scripting language? Please tell me you experience, and if you are interested, we can work on a small article and benchmark about this.
Babashka has replaced bash-scripting for me. I don't hate Bash, but why would I ever choose to use a language that has no true REPL, if I don't have to? bb is pretty much Clojure, which is the greatest choice if you're dealing with data - any data. Clojure is incredibly data-driven, which wins me over Janet. I also reach out to nbb whenever I need to deal with Node. e.g. scraping scripts driven by Playwright.
Janet is great when you need tiny runtime or you're dealing with subprocess-heavy scripts - Janet feels closer to actual shell syntax; or when you have to embed it to C/C++ program.
Fennel is indispensable for any Lua - mpv, Hammerspoon, AwesomeWM and Neovim configs, etc.
Re: Why Janet? (2023)
#235Earlier 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?
For me, certainly. But it's not a matter of adding parens, it's more removing extra syntax.
Re: Why Janet? (2023)
#236Earlier quoted context omitted.
You can replace Java there with pretty much any OOP language, where functions are not first-class citizens, and it will still be true. There are no "false claims" here. The main point is valid. We have orchestrated an entire industry around "objects", while much simpler abstractions have already existed. You probably just have not experienced the "true" nature of Lisp, where you can interactively change any behavior…
> There are no "false claims" here. You wrote: >> The Gang of Four book exists because Java made functions second-class citizens That is a false claim. You asserted a causal relationship between Java and the content of the GoF book that does not exist without time travel. > You probably just have not experienced the "true" nature of Lisp, where you can interactively change any behavior of the running program, directl…
> Sure buddy. You know so much about me...
I should have checked your comment history first before making assumptions. Please accept my apologies if I sounded patronizing. Shouldn't be an excuse for my tone, in my defense I could say: "I said 'probably'". Still disagree with you overly correcting me since I firmly believe the overall notion of my original comment is correct. Thus I won't remove my snarky, sarcastic paragraph above.
Re: Why Janet? (2023)
#237Earlier quoted context omitted.
The non-commutavity is a feature, not a bug. It allows you to have clearly defined parsing for grammars that would traditionally be considered ambiguous.
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.
I'd argue that it is how humans think about ambiguous syntax, except in the special case of operator precedence, which is the most complex example. A more salient example to me would be, say, the case of an ‘else’ block after a double-‘if’:
if (c) if (d) X; else Y;
It's technically ambiguous, but you only need to run into it once, see how your IDE auto-formatter indents it, and then you've internalized the precedence rule immediately.Re: Why Janet? (2023)
#238There is also fennel, earlier language originally by same developer, that is similar, but compiles to, and is fully implemented in, Lua. No standard library of its own so missing many nice things like the parser library from janet, but it is good for writing scripts for things that embed Lua. https://fennel-lang.org/
Fennel really is great, and a great way to get into the clojure family. My biggest gripe with it is that debugging is the typical transpilation bed of needles. The bridge between Fennel and the Lua VM is super fragile, and it just doesn't have half the quality of the Janet debugger and REPL. It's a real shame, because Fennel is way more portable, and thanks to LuaJIT is capable of breaking SBCL's jaw, which is absolu…
I gather that some features will be added to 2.1 but others only to 3.0.
Re: Why Janet? (2023)
#239Earlier quoted context omitted.
This is a great comparison and I've been wondering about it for a while. Between babashka, janet(i discovered it just now), fennel, guile. Which one would be a better scripting language? Please tell me you experience, and if you are interested, we can work on a small article and benchmark about this.
It's platform-dependent isn't it? Otherwise, the practical differences between Lisp dialects are negligible. For me writing either in Janet or Fennel or Clojure feels almost like writing in the same language. Babashka has replaced bash-scripting for me. I don't hate Bash, but why would I ever choose to use a language that has no true REPL, if I don't have to? bb is pretty much Clojure, which is the greatest choice if…
I'm curious what differences you see? I've been all in on Janet, but barely used Clojure. What more data driven aspects does Clojure have .... offer? My mental model/assumption's always been that Janet's Clojure without JVM and (sadly) not so pure. I don't use any of Janet's C interop facilities. I'd love to know what I'm missing
Re: Why Janet? (2023)
#240Earlier 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
> it seems to scale well This seems hard to say without knowing how large it is. To me, it seems like a relatively small community, far smaller than HN anyway.