I 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?
Without reading further. I'd say yes and no. No for client javascript. Compilation is a slow and intensive process. You don't have the time to optimize the mountains of code loading on every new page. It makes the page much slower to load. The returns are negative if all the code executed turned out to be a single function to flash a menu, before the user left. Yes for server javascript. It's long running processes,…
Prepack helps make JavaScript code more efficient
171–180 of 233 posts
Re: Prepack helps make JavaScript code more efficient
#172A long time ago there was a theory about using Guile (the GNU Scheme) as a general interpreter for languages using partial evaluation: you write an interpreter for a language in Scheme, use a given program as input, and run an optimizer over the program. This turns your interpreter into a compiler. I played around with the concept (making a Tcl interpreter), and it even kind of worked, often creating reasonably reada…
Pypy does it a lot like that.
Re: Prepack helps make JavaScript code more efficient
#173Earlier quoted context omitted.
What would their case be? "Yes, we gave away the software and documented it and paid designers to design it all pretty and spent marketing effort promoting it but nobody is allowed to use it because it's patented technology"? Has any court ever ruled that a permissive license like BSD does not include a patent grant when it says "use in source and binary forms, with or without modification, are permitted"? Because th…
Patents doesn't mean "nobody is allowed to use it"; patents mean "you are required to license the patent from the patent-holder, which usually requires paying royalties." I could totally see the point of a FOSS software project that implements a patented algorithm, where people work together to improve the thing but everyone who uses it still has to get a license from the patent-holder. (For a recently-top-of-mind ex…
Software distributed under those terms would no longer adhere to OSI's definition of open source (I think it violates points 1, 3, and 6) nor the FSF's Free Software Definition (points 2 and 3).
It might not stand up in court, but I do think it's obviously unethical to release patent-encumbered "FOSS" without mentioning your patents and then demand users obtain a license after the fact.
Re: Prepack helps make JavaScript code more efficient
#174Earlier quoted context omitted.
What will happen if you have bug in your function? Take the fibonacci function for example, what if you have a bug and created an infinite loop? Will Prepack terminate?
GCC doesn't crash if you tell it to unroll loops with an infinite while loop in your code, does it?
Re: Prepack helps make JavaScript code more efficient
#175Hi, 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
#176Coming from a non-CS background, I've always wondered why you can't "convert" code from one framework or paradigm to another. For instance, converting a project from jQuery to React. If you can define the outputs, why can't you redefine the inputs? That's what it seems like this project does... I suppose converting frameworks would be a few orders of magnitudes harder though.
Re: Prepack helps make JavaScript code more efficient
#177Earlier quoted context omitted.
"How much marketshare do you think that Javascript will lose once WebAssembly gets mainstream?" I'm no fortuneteller, but I suspect that people writing the most demanding client applications for web will be very happy when it does. Browser-desktop convergence wasn't meant to happen through JS, and after the proliferation of the hacks that we have today to get around inherent design flaws in the language, it really sh…
> are the forcing function behind using Electron instead of building a real desktop app. I have to work hard to not fall into this way of thinking most of the time. I am as frustrated as you with the proliferation of Electron apps. But a lot of the time it boils down to: Application X would not exist if Electron did not exist. Cross platform dev is hard . More programmers, no matter what language they use, is a posit…
Why? Are more plumbers also a good thing, even though this reduces the average wage of the plumber and the quality of plumbing?
Re: Prepack helps make JavaScript code more efficient
#178This has promise but still needs more work. I added one line to their 9 line demo ( https://prepack.io/repl.html ) and it ballooned to 1400+ lines of junk: (function() { function fib(x) { y = Date.now(); // the useless line I added return x 42) x = fib(10); global.result = x; })(); I understand Date might not be acceptable for inner loops but a lot of my code that deals with scheduling would benefit significantly if…
(function() {
for(var i = 0; i Re: Prepack helps make JavaScript code more efficient
#179Earlier quoted context omitted.
> are the forcing function behind using Electron instead of building a real desktop app. I have to work hard to not fall into this way of thinking most of the time. I am as frustrated as you with the proliferation of Electron apps. But a lot of the time it boils down to: Application X would not exist if Electron did not exist. Cross platform dev is hard . More programmers, no matter what language they use, is a posit…
> More programmers, no matter what language they use, is a positive thing. Lowering the barrier to entry via things like Chrome Dev Tools, Electron and related technologies is a good thing. Why? Are more plumbers also a good thing, even though this reduces the average wage of the plumber and the quality of plumbing?