Fork me on GitHub
#cljs-dev
<
2021-03-02
>
mkvlr15:03:51

hello @mfikes, @sritchie09 and I were looking at BigInt support in ClojureScript for https://github.com/sicmutils/sicmutils and http://nextjournal.com and came across your work on it https://gist.github.com/mfikes/9fc981ed7a190b8e9b2912eee98fdd5e. Are you considering getting that merged and is there remaining work we can help with to make that happen?

mfikes15:03:07

@mkvlr There is a lot of work to see if it is possible to even do this without breaking changes, making things depend on newer JavaScript engines, etc. ...

mfikes15:03:49

I haven't been pursuing it...

mkvlr15:03:09

@mfikes adding this in such a way that it doesn’t break on older engines without BigInt you mean?

mfikes15:03:25

Meaning, in a way that doesn't break existing codebases.

mfikes15:03:40

And, the concern about older engines is also a valid one.

mfikes15:03:10

Also, to add to the list: In a way that doesn't regress perf.

mfikes15:03:22

Seems pretty challenging IMHO.

mkvlr15:03:11

I don’t think I understand where you expect existing codebases to break

mfikes15:03:36

I think I'm just expressing a very cautious view and don't have good examples of breakage at hand.

mfikes15:03:36

Maybe with the introduction of things like +' codebases can opt into new behavior, etc...

mkvlr15:03:44

ok understood, thanks. And in general you feel it’s pretty challenging.

Sam Ritchie16:03:16

@mfikes understood! If you do want some help implementing it / thinking it through, in sicmutils I ended up extending the numeric tower, IEquiv, Icomparable etc to BigInt, goog.math.Long and goog.math.Integer

Sam Ritchie16:03:53

the performance hit would come from numbers on the left of these operations, since the implementations of those protocols would have to change

mfikes16:03:02

You could feel free to take the work I've done as a basis for attempting to work up a potential patch

👍 9
Sam Ritchie16:03:47

I’ll add that to the list, as I think at least laying out the case would be a valuable thing

Sam Ritchie16:03:04

this was the most sketchy thing necessary to get the goog numbers to play well

Sam Ritchie16:03:38

and honestly something that should probably get pushed up to Closure… these types don’t implement valueOf. (of course that’s beyond the scope of the bigint discussion)

souenzzo16:03:41

some things about bigint: https://github.com/google/closure-compiler/wiki/BigInt-support TLDR; it will only work when your runtime support it. There is no polyfill or compiler tricks.

dnolen22:03:01

Apple M1 is a pretty serious performance improvement for JVM based dev

👍 3
3
clj 3
Sam Ritchie22:03:36

Wild, right? I had my 8 minute test suite drop to 2m, and emacs with many batteries in is smoking fast

borkdude22:03:49

Any experience with docker on M1 yet?

raspasov09:03:31

Do you ever run into problems with 16GB? Or it’s just that much faster that 16GB is not an issue.

nwjsmith22:03:21

Absolutely. And the OpenJDK port is soooo close to being done: https://github.com/openjdk/jdk/pull/2200