Fork me on GitHub
#announcements
<
2021-12-05
>
dominicm15:12:27

https://github.com/juxt/pack.alpha has seen a major rewrite today, it's now compatible with tools.build and -T . Pack is a way to convert your deps.edn projects into docker images, Lambda deployment packages, Self executable jars (like uberjars), or "skinny jars" (for libraries or java -cp deployments). This release completely changes the namespaces, coordinate, and removes all the -main s that were previously present. The plan is to re-add new -main in the future on top of the new APIs (contributions welcome!).

๐ŸŽ‰ 16
๐Ÿ†’ 3
๐Ÿ™Œ 1
Ben Sless15:12:40

a. this is cool, will look for excuse to use it at work b. just came across https://github.com/nanovms/ops, any thoughts on packing a unikernel?

dominicm16:12:46

I haven't investigated unikernels at all. That project is in go, so I don't really have any thoughts about how to utilize it right now, it might work well with the skinnyjar mode though!

Ben Sless16:12:08

Just like Clojure shells out to git, you could shell out to other tools written in less fortunate languages. Question is it's even worth the trouble from your perspective

quoll18:12:12

https://github.com/quoll/cljs-math is a reimplementation of the new clojure.java.math namespace in pure ClojureScript. This calls into js/Math for a few operations, but because java.lang.Math (and hence clojure.java.math) includes many more functions than are supported in JavaScript, many of the functions had to be implemented from scratch. The namespace is implemented in a .cljc file so that testing can be done in Clojure to compare directly with the equivalent Java functions, but outside of testing it is only useful in ClojureScript.

๐ŸŽ‰ 48
๐Ÿ‘ 17
cljs 11
โญ 8
gratitude 3
โค๏ธ 7
Noah Bogart19:12:35

This is great! I hope this can be bundled in the clojure math core library instead of as an outside library.

quoll19:12:38

Itโ€™s specifically for ClojureScript. Itโ€™s only a .cljc file for testing purposes. Once appropriate tests have been set up to compare java.util.Math results to native cljs results, then it will turn back into a .cljs file

quoll19:12:11

It literally duplicates what java.lang.Math does, with some tweaks to make it work in ClojureScript

Noah Bogart19:12:25

Right, yes, I mean so clojure core can have built-in support for both clojure and clojurescript

quoll19:12:46

I think that the process is to get it accepted into ClojureScript

๐Ÿ‘ 1
Cora (she/her)19:12:01

that code is a super interesting read!!

quoll19:12:16

I canโ€™t take credit. Itโ€™s transliterated from the JDK

quoll19:12:49

I just needed to deal with a few things. e.g. unsigned comparisons, and not being able to recast Doubles as ints to read the bits, etc

quoll20:12:04

Not being able to add Long values was a problem! I solved that with my own add64 function

quoll20:12:38

Not exactly elegant, but it got the job done ๐Ÿ™‚

Cora (she/her)20:12:05

well I think it's great, either way. you had to understand the gaps well enough to fill them and it's interesting how they got filled in ๐Ÿ˜Š

โž• 9
borkdude10:12:05

A fast way to play with this :)

$ nbb -cp $(clojure -Spath -Sdeps '{:deps {com.github.quoll/cljs-math {:git/tag "v0.0.1" :git/sha "f92217e"}}}')
user=> (require '[cljs.math as m])
nil
user=> (clojure.repl/dir cljs.math)
<<
>>
>>>
E
IEEE-fmod
IEEE-remainder
MAX_FLOAT_VALUE
MIN_FLOAT_VALUE
...

๐Ÿ‘ 2
quoll10:12:55

Oops. I should have kept <<, >>, and >>> private!

borkdude10:12:15

Already won something by posting that then ;)

๐Ÿ˜† 4
borkdude10:12:41

Btw, impressive work!

๐Ÿ’– 3