If cljs is targeting es6 now is this shim still required?
if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) {
Math.imul = function (a, b) {
var ah = (a >>> 16) & 0xffff;
var al = a & 0xffff;
var bh = (b >>> 16) & 0xffff;
var bl = b & 0xffff;
// the shift by 0 fixes the sign on the high part
// the final |0 converts the unsigned value into a signed value
return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
}
}@chris358 we could put that behind a flag and default to it off now. It's disabled in :lite-mode already.
FWIW it has been behind a flag in shadow-cljs for 5 years. nobody has ever asked for about that flag, so I doubt anyone has ever used it.
Not a huge deal at all, just something I noticed when tinkering. It's a tiny piece of code.
it's just that in non :lite-mode doesn't really matter all that much
@dnolen trying to get :lite-mode to work in shadow-cljs but failing. I need to add the use-lite-types analyzer pass, set the cljs.core/LITE_MODE closure define and of course the compiler :lite-mode and :elide-to-string to true. what else might I be missing? These overall reduce the build size, but still about 50% larger than cljs.main. must have missed another change but can't figure out which?
nevermind, :elite-to-string is obviously not gonna work 😛
did you get it working?
yep, works fine now
@dnolen can you make a new release with the Vector->VectorLite rename? the 1.12.116 release breaks the [org.clojure/core.rrb-vector "0.1.2"] library, which seems to be somewhat widely used
that rename was exactly done as a reaction to someone else who had rrb-vector breakage :)
also the "fix" seems to point to maybe an underlying bug where just a missing :refer-clojure :exclude (Vector) ends up (deftype Vector ...) declaring cljs.core.Vector although in a different ns. doesn't seem like deftype should do that?
https://clojurians.slack.com/archives/C03S1L9DN/p1764021723081989
ah thx. yeah the problem seems to be this https://github.com/clojure/clojurescript/blob/c4bc714ae4853ae91e55f342e89df0809aaed310/src/main/clojure/cljs/core.cljc#L2029
why is that doing a resolve at all, when it is creating the name in the first place?
but been like that since inception basically, still weird
I did a temp fix replacing https://github.com/clojure/clojurescript/blob/81fde7c3b9893b5f12fb91463839f947f46a1385/src/main/clojure/cljs/analyzer.cljc#L3616 with t (symbol (str (:name (:ns env))) (str tsym)). not sure its the "correct" fix, but works. will remove once a new release is out.
yeah that line goes back to Rich, so will need to think about it, it was written for a very old version of resolve-var
bug reports are trickling in, and I'm doing some touchup was hoping to do a follow up release Monday, if that's ok.
yep, Monday is fine. or whenever really, everything is working now as far as I can tell, so no rush