|
|
|
|
|
by HoLyVieR
5125 days ago
|
|
> JSX performs optimization while compiling the source code to JavaScript. The generated code runs faster than an equivalent code written directly in JavaScript. This is just absurd. It is claiming it will run faster than JavaScript ... by compiling to JavaScript. If generated JavaScript code would run faster, it just mean the JavaScript code could have been written better in the first place. They probably have logic optimization behind the scene, but clamming it will run faster that JavaScript is just ridiculous. |
|
"The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript."
This is not absurd at all, it has been a proposition made by many languages in the past regarding their target. In fact it's kind of the whole point of an optimizing compiler. Whether its C being turned into better ASM than you'd write by hand, or CoffeeScript being turned into better JavaScript than you'd write by hand, the basic idea is the same. Of course you could theoretically just write the better ASM/JavaScript/whatever yourself, but the point is that usually how to do so is not obvious or not worth your time. If the average programmer's output ends up more performant with your compiler, then the claim is fair.