News for hackers. Stuff that matters.
Re:Joy: A maximalist web framework for Lisp aficionados by pgt on Tuesday June 07, 2022 @11:43AM (#31655993)
Why would someone use Joy on Janet over Reitit & Ring on top of Clojure?

I see Janet is small and embeddable. Does that mean faster startup time than a full JVM? It's nice that most of Janes the literals match Clojure, so aside from `def` inside a function (as opposed to `let`), it's natural for a Clojure user to read.

Re:Joy: A maximalist web framework for Lisp aficionados by gosukiwi on Tuesday June 07, 2022 @12:54PM (#31657103)
Maybe they don't want to tie themselves with the JVM, or have no experience with the Java ecosystem? Janet seems like a much simpler ecosystem. Also, for fun would be a great reason :P
Re:Joy: A maximalist web framework for Lisp aficionados by jpe90 on Tuesday June 07, 2022 @11:52AM (#31656126)
I don't really care about startup time personally but the linked page mentions "very low memory usage" which is quite a contrast with Clojure which seems to use insane amounts of memory for simple things.
Re:Joy: A maximalist web framework for Lisp aficionados by d_t_w on Tuesday June 07, 2022 @09:08PM (#31662059)
Do you have a reference for Clojure's 'insane amounts of memory' use?

Our product (https://kpow.io) is written in vanilla Clojure/Clojurescript, it will quite happily run with a 64MB heap for smaller workloads.

64Mb for a non-trivial full-stack enterprise-grade application with authentication enabled providing a rich UI and multiple asynchronous and/or scheduled background processes that monitor and manage Kafka resources. Sure we don't recommend running multi-cluster production workloads on a 64MB heap, but requiring further memory for real workloads has nothing to do with Clojure and we're a long way from 'insane' memory use, or doing simple things.

Re:Joy: A maximalist web framework for Lisp aficionados by d_t_w on Wednesday June 08, 2022 @12:59AM (#31663410)
RE: Clojure startup times, the full Kpow web app starts in ~7s.
Re:Joy: A maximalist web framework for Lisp aficionados by swlkr on Tuesday June 07, 2022 @12:57PM (#31657137)
I wrote janetdocs with joy and it's been running for quite a while on a pretty small VPS. htop shows RES memory usage as ~16MB and SHR as ~6MB, so it's anecdotal, but there's at least one data point.
Re:Joy: A maximalist web framework for Lisp aficionados by capableweb on Tuesday June 07, 2022 @12:29PM (#31656744)
I'm not saying it is using a low amount of memory, but I just fired up a new Clojure repl and it seems to end up using 90MiB memory once up and running. Is that what you'd call "insane amounts of memory"?

Maybe spending too much time in JavaScript-land has jaded my view of memory consumption.

Re:Joy: A maximalist web framework for Lisp aficionados by shakna on Tuesday June 07, 2022 @06:02PM (#31660586)
Janet, for comparison to that 90MiB will use something more like 16MiB. Using less than 20% of the overall memory footprint does make Clojure seem insane by comparison.
Re:Joy: A maximalist web framework for Lisp aficionados by joe_guy on Tuesday June 07, 2022 @10:50PM (#31662646)
How does that scale? I'm not worried about 60mb of ram in 2022. Is there a single like-like comparison of a complex application?
Re:Joy: A maximalist web framework for Lisp aficionados by uvtc on Tuesday June 07, 2022 @01:37PM (#31657681)
> It's nice that most of Janes the literals match Clojure

Two things:

* Janet doesn't have a built-in set data structure literal. Need to use a library for that.

* Janet has mutable and immutable versions of arrays and hashmaps (the literals for the mutable variety are prefixed with `@`)

Re:Joy: A maximalist web framework for Lisp aficionados by samatman on Tuesday June 07, 2022 @04:02PM (#31659397)
I was surprised to discover that Janet tuples and records (the immutable array and hashmap you've mentioned) aren't the Clojure-style immutable which is designed for cheap updates, but the more usual kind of immutable where if you want a copy with changed data, you have to make a copy with changed data.
Re:Joy: A maximalist web framework for Lisp aficionados by db65edfc7996 on Tuesday June 07, 2022 @11:59AM (#31656233)
Janet starts incredibly quickly. Here was a microbenchmark someone produced comparing various Lisps[0].

[0] https://github.com/janet-lang/janet/issues/324#issuecomment-...

Re:Joy: A maximalist web framework for Lisp aficionados by jdminhbg on Tuesday June 07, 2022 @01:07PM (#31657285)
> so aside from `def` inside a function (as opposed to `let`)

It looks like the examples on the linked page use let, so it definitely seems like it's available.

Fwiw, you can technically use def anywhere in Clojure, it's just not good practice to do so.

Re:Joy: A maximalist web framework for Lisp aficionados by eigenhombre on Tuesday June 07, 2022 @11:52AM (#31656119)
On my machine, a "hello world" program runs 100x faster on Janet compared to Clojure.[1]

[1] https://gist.github.com/eigenhombre/ea1d2c6d2fcd5b5c9ca7e8df...

Re:Joy: A maximalist web framework for Lisp aficionados by capableweb on Tuesday June 07, 2022 @12:06PM (#31656376)
Makes a lot of sense. Babashka will be faster than Clojure as well.

Where Clojure shines, is long-running processes. Try the same benchmark, but instead printing "hello world" 1000000x times and compare it, and you'll have a benchmark showing Clojure's strength rather than weakness.

In the end, benchmarks usually show what the author(s) wanted to show with the benchmark.

Re:Joy: A maximalist web framework for Lisp aficionados by ducktective on Tuesday June 07, 2022 @12:30PM (#31656759)
What about Babashka vs Janet? In terms of utility, libraries and startup times...