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

We do have that VM. It just happens that this VM's "bytecode" looks like JavaScript.

Here is Python running in the browser:

http://syntensity.com/static/python.html



Sorry, but this is not good enough. This argument is made all the time, but all you're really saying is that every other language should be a second-class citizen to JavaScript. Emscripten is a cool technical hack, but why the fuck is it 2012 and we have to compile C++ to JavaScript?


It's not good enough now, probably because JavaScript was designed as a lightweight scripting language to make web pages a little more interactive and not as a general "bytecode for the web".

However, it always amazes me when people in discussions like this take JavaScript as a done deal or a static target...this is a fatal flaw in this discussion.

JavaScript as a language and community has evolved a lot, and it continues to evolve. We've already seen improvements that make it a better target for compilation, and we'll be seeing more in the future...now that it's clear that that is what the web wants/needs and not just a little scripting language for forms.

My bet is it will be much easier/quicker to work JavaScript into a good target for compiling other languages to than to develop a general VM and convince all the browser vendors to adopt it.

That's not even taking into account which would be better overall, which I think is an interesting question without an entirely clear answer....but I'm a pragmatist and so I think it's not worth worrying about except intellectually.


> all you're really saying is that every other language should be a second-class citizen to JavaScript.

Every platform has a "native" form. On your x86 desktop, it's x86 assembly, which everything is a second-class citizen to in the sense it needs to be compiled into it. On the web, the native form is JavaScript.

It has to be something fairly high-level because the web is CPU and OS-agnostic, which JS is.

The only practical concern that can be here, is whether JS is good enough for this task - if languages compiled into it run efficiently enough. It can be, if browsers continue to improve JS and if we all improve compilers into JS. So far little work has been done on both of those, but there is starting to be effort there.

> Emscripten is a cool technical hack, but why the fuck is it 2012 and we have to compile C++ to JavaScript?

We need to compile into something platform-independent, memory-safe and standardized. There isn't currently a better option than JavaScript, because each other option has major downsides. So does JS, to be sure, but overall it's a wash, and JS is already there so it wins.


Source-level debugging please.


Agreed it's important. I believe several major browsers are working on that.


Browsers supporting JavaScript and some other bytecode format would bring web innovation to a crawl.

I think once browsers are able to debug in the originating languages people will stop complaining about this.


Can you provide some reasoning for why this is necessarily the case?


Arrogant people preemptively declaring failure and trying to enforce their baseless declarations on others is what brings innovation to a crawl.


Come on now, that's a bit harsh. There are really smart people who have been trying this exact thing for years without success. Microsoft tried harder than anyone to make "JScript" part of .NET but finally gave up and Windows 8 has 2 first-class VMs.


It wasn't in the browser though. So it's a different story.


Without success because people like you have been fighting them every step of the way trying to hold back progress. It's hard to overcome inertia, and it's almost impossible when there is an organized resistance. It becomes absolutely insanity-inducing when said resistance uses its own success in warding off progress as ammunition for holding back progress.

I'd say I was exceedingly un-harsh, even downright polite, considering the long-term damage that has been inflicted.


That's just shooting the messenger. The comment about 'enforcing ... on others' is completely unwarranted.


That bytecode is not good enough. It doesn't even have ints for christ sake.


Yes. And it just happens that it's optimized for js and sucks compared to a lower level VM.

Not to mention the extra overhead, not having proper traces for exceptions, source-line equivalency on errors, etc.




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

Search: