4 ms·
The structure of the JavaScript is interesting. It looks like this: if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) { Math.imul =
by tzs 8y ago
The structure of the JavaScript is interesting. It looks like this:
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);
}
}
[240k of minimized JavaScript
generated by ClojureScript]
The non-minimized code is just a copy/paste of the imul polyfill [1] from MDN. I'm curious why that is needed, since the ClojureScript seems to already have an imul polyfill included (the function named Ed in the minimized code). Is ClojureScript's polyfill broken?
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul#Polyfill https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- rorygibson 8y agoClojureScript uses the Google Closure compiler under the hood. From a quick dig around, looking at the Closure changelog, they introduced a polyfill of their own; I'm guessing this went in after CLJS built one, so now there are 2 in the compile / transpile chain. One of the consequences of nothing in life being simple any more!
- CuteBrowser 8y agoNot simple? Maybe you're doing it wrong. Just make blockchain backend, run it as a serverless process on k8 and voila, can't be simpler.
- dmos62 8y agoDon't be sarcastic, it doesn't add to the discussion. You're just saying you agree in a silly way and citing some things you also happen to find needlessly complex.
- aaaaaaass 8y agoDon’t be condescending. It makes you look like a dingleberry.
- CuteBrowser 8y ago> You're just saying you agree in a silly way and citing some things you also happen to find needlessly complex. Thank you oh wise one. I had no clue
- dang 8y agoWe've banned this account for repeatedly breaking the site guidelines. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html