Live data from Hacker News

Prepack helps make JavaScript code more efficient

prepack.io

231–233 of 233 posts

Re: Prepack helps make JavaScript code more efficient

#231
post #81

Earlier quoted context omitted.

IANAL, but most likely: nothing. Less likely: Facebook counter-sues you for patent infringement and (maybe?) has a slightly better case as long as you keep using it. Your lawyers tell your engineers to rewrite everything without Facebook technologies and it's all a big pain in the ass and you regret ever suing Facebook for patent infringement.

Would the same still apply to the output of the programs, e.g. could you keep the optimized code generated by Prepack?

That's for the court to decide, assuming Facebook has patents on Webpack. To minimize liability, probably best not to.

Re: Prepack helps make JavaScript code more efficient

#233

I think that just in time compilers are better at doing thier things. Sure it is nice project that can interpret and print preprocessed js, but I think it might in fact not bring speed in most cases. And the current state doesn't even know how to constant fold this loop. function foo() { const bar = 42; for (let i = 0; i <= bar; i++) { if (i === bar) { return bar; } } };

As long as the ahead of time optimizations that dont have a large enough negative drawback in another criteria (speed vs size) are welcomed by me, even if the JIT can do the same optimizations too. Regarding your code example, maybe prepack was changed in the past week and a half, but it is folded quite fine when i tried it:

  (function() {
    function foo() { const bar = 42; for (let i = 0; i 
Post reply on HN