Fork me on GitHub
#off-topic
<
2022-04-06
>
Adam Kalisz08:04:10

No really surprising, but getting ~ one page of 4 KiB (* 2048 16bit) is a lot faster than getting the same amount of data but in smaller chunks.

(* 32 860)
=> 27520
(* 16 1598)
=> 25568
(* 8 2426)
=> 19408
(* 4 5116)
=> 20464
(* 2 8002)
=> 16004
Allocating more memory/ creating that many larger objects seems to kill the runtime at some point though. I am investigating this since it could be used as a "random well" just like /dev/urandom but with some usable data such as 16bit unsigned ints or 32 bit unsigned ints (when wrapped with unsigned-bit-shift-right 0 or so).

đź‘€ 1
Adam Kalisz08:04:34

This has interesting use-cases such as this horrible and probably unsafe hack:

slipset18:04:14

So I read through https://quanttype.net/posts/2022-04-06-clojure-and-what-couldve-been.html and I must say that I tend to agree on the conclusion with Clojurescript. When Figwheel came out in 2015, it IMO put cljs way ahead of JS, but these days the dev experience with TS is basically on par with cljs. Personally I find the greatest pluss is that we tend to prefer hiccup over jsx/tsx. The code I wrote in TS today is highly functional without any OO, which looks a lot like the code I’d write in cljs.

Danny19:04:01

Agreed… Glueing stuff together in TypeScript is super easy. Compiler really helps prevent bugs. Even TypeScript based AWS Lambdas can now be developed in a live-reloading manner. We’re using Clojure for what it was always best at: data processing.

isak19:04:55

Interesting. What tools/libraries are you using to get a similar/better experience? Is it based on mutable data structures still, like normal javascript?

isak19:04:31

Is it for simple applications, or advanced?

Danny20:04:32

We call Clojure in a typed way from TypeScript, by https://github.com/flowyourmoney/malli-ts

mauricio.szabo02:04:59

Wow, I so disagree with this. Cljs with shadow-cljs have hot reload that doesn't depend on any library and can basically hot reload anything; Typescript compiler preventing bugs was studied already, and most results where not conclusive; and in ClojureScript, I can REPL into my env without needing to rely on external tools like debuggers and such

âž• 2
mauricio.szabo02:04:59

What I feel is that the JS ecosystem became so insane that almost any language that do not use its tooling (babel, webpack, etc) feels out of place... there's also a whole issue with backwards compatibility, fragmentation of tools, etc. As an example, I have to interface with a TS library. That library does not compile with tsc - instead, it uses an external tool to precompile things to JS. Then, webpack over the js. The webpacked version is imported on our app. This is all necessary because of the libraries used, and the bundle size gets smaller. Any other combination almost doubled the bundle size... For some reason nobody was able to find out.

âž• 1
slipset05:04:33

Wrt pds. I might be very mistaken here, but from a immutability perspective, todays js/ts practice of spreading data structures into other data structures, eg {…foo,bar}, you basically achieve immutability, even if it's not as fast/efficient as a pds. As for the build, sure, it's magical, but create-react-app does the magic for you. I'm not claiming it's maintainable, though.

Danny10:04:13

I avoid webpack. esbuild.

Joshua Suskalo18:04:07

General licensing question: I am currently making a threading utilities library to contain a few functions and macros that I myself need very often and that seem to resolve many patterns I've seen in the wild, but I know lots of people are dubious about adding new dependencies, and I want to reduce friction as much as possible for anyone who wants to use these functions. I would like for people to be able to simply copy the implementations of the functions and macros out of the library source and paste it into their own code without the need for attribution or to keep the license. I know that the CC0 license is a good one for this purpose, but is there a more common software license which also fits that need, and is there likely to be any issues to be had with using CC0 on code, seeing as it's usually not used for software directly?

seancorfield19:04:31

My suggestions would be either MIT, BSD, or ASL2. Those are "you can do anything" licenses to varying degrees and are likely to be compatible with most (nearly all) Clojure projects.

dpsutton19:04:35

There's a new MIT-0 license from Amazon that is exactly mit but drops the attribution requirement

dpsutton19:04:02

I don't know intricacies of licensing but you could also dual license stuff

seancorfield19:04:05

https://en.wikipedia.org/wiki/License_compatibility is a good place to start for an overview of compatibility with https://en.wikipedia.org/wiki/Comparison_of_free_and_open-source_software_licences being a deeper dive across more licenses.

Joshua Suskalo19:04:11

Thanks to both of you!

Joshua Suskalo19:04:45

I ended up going with MIT-0

Chase20:04:40

I just stumbled on this cool clojure library (with accompanying fun video intro) while browsing HN (https://news.ycombinator.com/item?id=30925917 , the author is in there doing an AMA): https://github.com/drcode/good-guesser https://www.youtube.com/watch?v=2SFNbiurWhc