Live data from Hacker News

JSX - a faster, safer, easier alternative to JavaScript

jsx.github.com

1–10 of 73 posts

Re: JSX - a faster, safer, easier alternative to JavaScript

#3
the jsx source code of the "hello world" example is only 62.5% of the code needed by dart for the same example. 5 lines vs 8 lines of code.

the compiled JS source of the "hello world" example is only 0.5% of the code needed for the same task by dart. 91 lines vs 17259 lines code.

Re: JSX - a faster, safer, easier alternative to JavaScript

#4
> (...) even the optimized JavaScript libraries like Box2D becomes faster when ported to JSX.

Box2D is a C++ library that has been ported to ActionScript and then, from ActionScript, converted to JavaScript - not by hand, but by a bunch of scripts[1]. The JS version of Box2D still carries around a lot of unnecessary weight from the original C++ and ActionScript versions and has much room for improvement.

A rewrite or "smart" conversion from C++ to JS, that endorses JS instead of trying to emulate C++ or ActionScript, should be able to improve performance a lot.

I don't know how Box2D was ported to JSX. Maybe it was a rewrite by a human? In any case, I'm not saying what they do isn't impressive, but calling Box2D an "optimized JavaScript library" is just plain wrong.

[1] There are several different JS ports of Box2D available, but, to my knowledge, none of which is a sensible rewrite by a human.

Re: JSX - a faster, safer, easier alternative to JavaScript

#5

"JSX offers a solid class system much like the Java programming language, freeing the developers from working with the too-primitive prototype-based inheritance system provided by JavaScript." Pass.

That's a weird thing to think. If you can simulate classes with prototypes, but you can't simulate prototypes with classes, what is the natural conclusion you can come to about which is more expressive or primitive?

Re: JSX - a faster, safer, easier alternative to JavaScript

#9

"JSX offers a solid class system much like the Java programming language, freeing the developers from working with the too-primitive prototype-based inheritance system provided by JavaScript." Pass.

That's a weird thing to think. If you can simulate classes with prototypes, but you can't simulate prototypes with classes, what is the natural conclusion you can come to about which is more expressive or primitive?

http://javascript.crockford.com/prototypal.html

Re: JSX - a faster, safer, easier alternative to JavaScript

#10

"JSX offers a solid class system much like the Java programming language, freeing the developers from working with the too-primitive prototype-based inheritance system provided by JavaScript." Pass.

That's a weird thing to think. If you can simulate classes with prototypes, but you can't simulate prototypes with classes, what is the natural conclusion you can come to about which is more expressive or primitive?

That prototypes are overly complex.

You can't simulate most imperative programs with functional ones because writing in a functional language eliminates a vast majority of bugs due to incomplete reasoning about memory barriers and other really hard to duplicate issues like race conditions.

CHESS is an amazing piece of software precisely because it CAN simulate race conditions and reproduce them, however, if these things didn't exist no one would ever bother trying to reproduce them.

I'm quite fine not being able simulate these issues.

Post reply on HN