cljs-dev

Chris McCormick 2025-11-26T03:03:22.482599Z

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);
    }
}

dnolen 2025-11-26T04:11:41.280309Z

@chris358 we could put that behind a flag and default to it off now. It's disabled in :lite-mode already.

thheller 2025-11-26T06:56:13.484939Z

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.

Chris McCormick 2025-11-26T10:52:09.283829Z

Not a huge deal at all, just something I noticed when tinkering. It's a tiny piece of code.

dnolen 2025-11-26T04:12:05.862859Z

it's just that in non :lite-mode doesn't really matter all that much

thheller 2025-11-26T09:11:09.206089Z

@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?

thheller 2025-11-26T09:43:21.773009Z

nevermind, :elite-to-string is obviously not gonna work 😛

😂 2
dnolen 2025-11-26T12:48:22.085619Z

did you get it working?

thheller 2025-11-26T12:49:36.920399Z

yep, works fine now

💥 1
thheller 2025-11-26T11:32:27.418369Z

@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

borkdude 2025-11-26T11:33:14.747389Z

that rename was exactly done as a reaction to someone else who had rrb-vector breakage :)

👍 1
thheller 2025-11-26T11:33:29.938599Z

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?

👍 1
thheller 2025-11-26T11:37:22.075179Z

why is that doing a resolve at all, when it is creating the name in the first place?

thheller 2025-11-26T11:38:32.388959Z

but been like that since inception basically, still weird

thheller 2025-11-26T12:29:49.766359Z

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.

🙏 1
dnolen 2025-11-26T12:47:59.934929Z

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

dnolen 2025-11-26T12:51:59.095819Z

bug reports are trickling in, and I'm doing some touchup was hoping to do a follow up release Monday, if that's ok.

thheller 2025-11-26T12:53:33.409129Z

yep, Monday is fine. or whenever really, everything is working now as far as I can tell, so no rush