7 ms·
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 JV
by pgt 4y ago
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.
- gosukiwi 4y agoMaybe 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
- jdminhbg 4y ago> 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.
- eigenhombre 4y agoOn my machine, a "hello world" program runs 100x faster on Janet compared to Clojure.[1] [1] https://gist.github.com/eigenhombre/ea1d2c6d2fcd5b5c9ca7e8dfd213e508 https://gist.github.com/eigenhombre/ea1d2c6d2fcd5b5c9ca7e8df...
- capableweb 4y agoMakes 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.
- ducktective 4y agoWhat about Babashka vs Janet? In terms of utility, libraries and startup times...
- jpe90 4y agoI 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.
- capableweb 4y agoI'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.
- shakna 4y agoJanet, 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.
- joe_guy 4y agoHow does that scale? I'm not worried about 60mb of ram in 2022. Is there a single like-like comparison of a complex application?
- swlkr 4y agoI 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.
- d_t_w 4y agoDo you have a reference for Clojure's 'insane amounts of memory' use? Our product (https://kpow.io 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.
- db65edfc7996 4y agoJanet starts incredibly quickly. Here was a microbenchmark someone produced comparing various Lisps[0]. [0] https://github.com/janet-lang/janet/issues/324#issuecomment-623123272 https://github.com/janet-lang/janet/issues/324#issuecomment-...
- uvtc 4y ago> 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 `@`)
- samatman 4y agoI 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.