3 ms·
TurboWarp – Run Scratch projects faster
- vajrabum 2y agoThis thing compiles scratch to Javascript with a claimed 10 to 100 speedup. Here's a bit from the docs on how it works. https://docs.turbowarp.org/how https://docs.turbowarp.org/how And here's the source. https://github.com/TurboWarp/ https://github.com/TurboWarp/ From the doc and a quick glance at the repo it looks like it's scratch modified to compile to javascript. No surprise that you can't live edit, at least not for now.
- pjmlp 2y agoIt is kind of ironic that in this scenario JavaScript is seen as really blazing performance. I wasn't aware the Scratch implementation is that slow.
- lionkor 2y agoJS is not slow; remember that big JS engines are stupidly optimized.
- pjmlp 2y agoIt kind of is, when compared with native compiled languages, hence why rewriting JavaScript tooling is the new fashion is JS world.
- Asraelite 2y agoYou're underestimating the insane amount of engineering effort Google has put into optimizing V8. Take a look at some benchmarks. https://programming-language-benchmarks.vercel.app/javascript-vs-csharp https://programming-language-benchmarks.vercel.app/javascrip... https://programming-language-benchmarks.vercel.app/javascript-vs-java https://programming-language-benchmarks.vercel.app/javascrip... https://programming-language-benchmarks.vercel.app/javascript-vs-cpp https://programming-language-benchmarks.vercel.app/javascrip... It beats Java and C# in many of them, and for C++ it's usually not more than 5x slower. Of course, that's all optimized JavaScript. It's a lot easier to slip up and accidentally make your code much slower in a scripting language than in a compiled language. So yeah, for larger programs it's definitely worth rewriting.
- pjmlp 2y agoYou obviously don't know my comment history regarding dynamic languages and JIT compilers. If only CPython was half as fast as V8, or if PyPy wasn't a black swan in the community. Still doesn't change the point I made.
- neonsunset 2y agoIf you run the benchmarks longer (i.e. more than a couple hundred milliseconds - the above benchmarks use validation values from the original benchmarksgame, not the ones used for evaluating performance), you will see a different picture: https://benchmarksgame-team.pages.debian.net/benchmarksgame/box-plot-summary-charts.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/javavm-node.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... (and this is, by far, the most favorable comparison for Node.js you can make, where it can trade punches but ultimately ends up losing) Sure, V8 is impressive, but there is no free lunch especially when your optimization target is a dynamically typed, initially interpreted, language.