Hi, I am Nikolai Tillmann, a developer on the Prepack project. I am happy to answer any questions!
Prepack helps make JavaScript code more efficient
21–30 of 233 posts
Re: Prepack helps make JavaScript code more efficient
#22Looks like it's applying the same sort of optimizations a normal optimizing compiler would. With all of these JS "compilers" and transpilers, at some point, it just makes sense to build a client-side language in the browser that compiles down to native and runs sandboxed. I'm excited for WebAssembly, but I realize that, like with all shiny new web things (for example, WebRTC on Safari/iOS), mainstream browsers that m…
I was right there a year or two ago developing portable native client things for my project, Linux on the Web (I was able to get vim and python running). Projects like that can pioneer a whole lot of new techniques and infrastructure that can be very easily applied to whatever technology is eventually going to win out.
@rattray Even without access, downvotes don't just happen out of nowhere; you have to admit that this just looks too obvious to any reasonable person.
I'm curious what you thought was downvote-worthy of my original post pre-edit?
I get it, rules are rules, and this is a matter of principle.
Re: Prepack helps make JavaScript code more efficient
#23Looks like it's applying the same sort of optimizations a normal optimizing compiler would. With all of these JS "compilers" and transpilers, at some point, it just makes sense to build a client-side language in the browser that compiles down to native and runs sandboxed. I'm excited for WebAssembly, but I realize that, like with all shiny new web things (for example, WebRTC on Safari/iOS), mainstream browsers that m…
> Please resist commenting about being downvoted. It never does any good, and it makes boring reading.
https://news.ycombinator.com/newsguidelines.html
Disclaimer: I do not work at Facebook.
Re: Prepack helps make JavaScript code more efficient
#24Looks like it's applying the same sort of optimizations a normal optimizing compiler would. With all of these JS "compilers" and transpilers, at some point, it just makes sense to build a client-side language in the browser that compiles down to native and runs sandboxed. I'm excited for WebAssembly, but I realize that, like with all shiny new web things (for example, WebRTC on Safari/iOS), mainstream browsers that m…
From the guidelines: > Please resist commenting about being downvoted. It never does any good, and it makes boring reading. https://news.ycombinator.com/newsguidelines.html Disclaimer: I do not work at Facebook.
What I'd really like to see is this discussion steered back on topic. It was originally interesting and productive. I like talking about web technologies; it is my passion.
Re: Prepack helps make JavaScript code more efficient
#25Earlier quoted context omitted.
I was right there a year or two ago developing portable native client things for my project, Linux on the Web (I was able to get vim and python running). Projects like that can pioneer a whole lot of new techniques and infrastructure that can be very easily applied to whatever technology is eventually going to win out.
@dennykane It's a shame seeing your comments are getting downvoted on here too. It really leaves me with a bad impression about how FB operates. @rattray Even without access, downvotes don't just happen out of nowhere; you have to admit that this just looks too obvious to any reasonable person. I'm curious what you thought was downvote-worthy of my original post pre-edit? I get it, rules are rules, and this is a matt…
This kind of commentary is not welcome on HN.
Re: Prepack helps make JavaScript code more efficient
#26I was under the impression that V8 and the like are so optimized that this would give marginal gains. Would love to be wrong though. Do you have any performance benchmarks?
Prepack doesn't seem to optimize for V8 in particular; rather, it just does some calculations ahead of time. V8 cannot possibly do these optimizations. How would it know that e.g. my code tries to calculate PI to 1000 decimals? That's where prepack steps in and calculates PI to 1000 decimals for you during your build-step, so that the JS you ship doesn't have to do that calculation.
Re: Prepack helps make JavaScript code more efficient
#27I was under the impression that V8 and the like are so optimized that this would give marginal gains. Would love to be wrong though. Do you have any performance benchmarks?
> experiment with JavaScript features by tweaking a JavaScript engine written in JavaScript, all hosted just in a browser; think of it as a "Babel VM", realizing new JavaScript features that cannot just be compiled away
I've been playing with making toy languages inside of Javascript, and I believe there's lots of untapped power there. The paradigm battles don't have to be: we can run all sorts of paradigms in the same VM, with data executing as code. This means that you can decompose expressions to see where they came from (e.g. the steps in a state machine that yielded an evaluation result). If you believe (as I do) that invisibility-by-default is one of the greatest pain points in the history of computing, then these sorts of approaches are essential.
The problem with doing that is that some things will be slower than they would in "native" JS. I've been proceeding anyway and thinking that could be dealt with later. So I'm bookmarking this, because it attacks that exact problem: runtime-compilation of generated AST's.
The name is a little unfortunate, in that respect, though, especially since it will make people think it's a build tool like Webpack. Webpack is for dead fish. This is incomparably more powerful.
edit so to answer your original question, this would piggyback on the optimizations of the VM (V8 or SpiderMonkey, or whatever), taking for granted that JS which is not needlessly verbose (as generated code must sometimes be), can be run nearly optimally.
Re: Prepack helps make JavaScript code more efficient
#28Hi, I am Nikolai Tillmann, a developer on the Prepack project. I am happy to answer any questions!
Re: Prepack helps make JavaScript code more efficient
#29Hi, I am Nikolai Tillmann, a developer on the Prepack project. I am happy to answer any questions!
Can you prove that any of the optimizations in your docs aren't already done by V8? I agree with the other commenters in this thread-- V8 likely does these already. You have an extraordinary claim, which requires extraordinary proof.
V8 == user impacted.
Compile time V8 == compiler impacted, users happy.
It's like interpreting what you can during compile time, with caching capabilities.
To speed up boot time and init time, not runtime per say.
Re: Prepack helps make JavaScript code more efficient
#30I was under the impression that V8 and the like are so optimized that this would give marginal gains. Would love to be wrong though. Do you have any performance benchmarks?
The benefit of this would be at runtime when implementing interpreters: > experiment with JavaScript features by tweaking a JavaScript engine written in JavaScript, all hosted just in a browser; think of it as a "Babel VM", realizing new JavaScript features that cannot just be compiled away I've been playing with making toy languages inside of Javascript, and I believe there's lots of untapped power there. The paradi…
I haven't used webpack but I have used many similar tools, and I've heard a lot of praise for webpack. Can you elaborate on why you dislike webpack so much?