Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, you're right, that is cool and that is remarkable. But Javascript still really sucks sometimes.

To use an analogy: I'm not saying the plane doesn't fly, but I am saying the plane seats are uncomfortable.

Also, this is a total aside: what if there actually was a way to stuff like C++ on a computer in sandboxed environment that could be loaded automatically by a user in a seamless way? If that happened, if you took away Javascripts monopoly of the highly portable and convenient environment, it'd be dropped so fast you could blink and miss it.




> Also, this is a total aside: what if there actually was a way to stuff like C++ on a computer in sandboxed environment that could be loaded automatically by a user in a seamless way? If that happened, if you took away Javascripts monopoly of the highly portable and convenient environment, it'd be dropped so fast you could blink and miss it.

This is what asm.js enables for non-garbage-collected languages, and what Binary Data enables for garbage-collected languages.

But I think you're overestimating how much people want to move away from JavaScript. The overwhelming majority of Web pages never leave the JavaScript interpreter in Firefox, because they just aren't bound on JS execution speed. What is far more important than raw JS speed on most Web pages is ease of development and DOM/CSS performance. I think it'd be hard for C++ to gain much mindshare on the long tail of Web sites, even in a world where asm.js was universal, easy to use, and 100% of native speed.

JS has plenty of faults, but one thing it's never lacked is convenience. Conversely, C++ has many virtues, but one thing it's never had is ease of use. Given that calculus, I expect JS to continue to dominate for a long time.


> JS has plenty of faults, but one thing it's never lacked is convenience. Conversely, C++ has many virtues, but one thing it's never had is ease of use.

That is a weird thing to say. Maybe it is just me, but when I use JavaScript, I cannot stop worrying about the possibility that there is yet another corner case I have not contemplated. Admittely, C++ is full of corner cases too; but, in my experience, it can be coerced into being a more or less civilized language by making a list of strictly verboten constructs, including, but not limited to, void pointers, manual resource ownership management and casts other than static_cast. When you leave these out, you actually have a smaller language that is easier to reason about. With JavaScript, no list of bad constructs can do - you need to actively rely on the semantically crazy stuff to do anything useful.


What semantically crazy stuff do you have to rely on? I don't advocate mindlessly buying into the cult of Crockford, but he outlines a pretty reasonable subset of the language in "JavaScript: The Good Parts"

The only thing I can think of that you might mean is function scoping, which I would agree with.


PNaCl


Which is awesome to actually use, but it doesn't have the interoperability that Javascript does. Maybe one day it will, and that'll be awesome. But till then, we'll never know.


I wonder if it would be possible to shim PNaCl with emscripten as a fallback.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: