News for hackers. Stuff that matters.
Re:Show HN: Trolley lets you take payments from your static ... by tzs on Thursday September 27, 2018 @07:19AM (#18083456)
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/Refe...

Re:Show HN: Trolley lets you take payments from your static ... by rorygibson on Thursday September 27, 2018 @07:24AM (#18083488)
ClojureScript 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!

Re:Show HN: Trolley lets you take payments from your static ... by CuteBrowser on Thursday September 27, 2018 @08:33AM (#18083821)
Not 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.

Re:Show HN: Trolley lets you take payments from your static ... by dmos62 on Thursday September 27, 2018 @08:41AM (#18083872)
Don'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.
Re:Show HN: Trolley lets you take payments from your static ... by CuteBrowser on Thursday September 27, 2018 @09:17AM (#18084119)
> 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

Re:Show HN: Trolley lets you take payments from your static ... by dang on Saturday September 29, 2018 @02:36AM (#18099031)
We've banned this account for repeatedly breaking the site guidelines.

https://news.ycombinator.com/newsguidelines.html