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

C++ can be compiled to Javascript that runs at reasonable speeds (not just toy applications, either). See:

https://github.com/kripken/emscripten/wiki

And yep, I was right. Web workers do make use of multiple cores, and there's at least one parallel programming library that takes advantage of it:

http://adambom.github.io/parallel.js/



Web workers are atrocious though. They're very strangely hobbled by either requiring a serialize->deserialize round-trip when passing data back and forth, or you can sidestep it by 'transferring' the object across contexts (it then 'disappears' in the original context). The reasons for doing it rather than sharing are obvious (the race conditions would be hard to track down, etc.) - but there's no escape hatch for languages like ClojureScript which has immutable data-structures (and therefore don't care about mutable race conditions) and persistent/structural-sharing datastructures (and therefore would be very costly to serialize/deserialize, or totally broken by the transfer model).

Really a shame.


I ran the Quake 3 demo. It was frameskipping all over. Performance was not acceptable for even playing. I think 10-15 fps. No, its not my laptop. My laptop has no problems with real Quake 3. I want to ask you to take a step back and look at it purely from a black box perspective. Forget about JavaScript for a moment. Is it really your opinion this is reasonable performance?


For playing Quake? Maybe not.

For running any application that spends 99% of its time waiting for the user to press a key (which is most of them)? Sure. No problem at all.


And maybe that is todays reality because JavaScript cant really do anything else. Give a kid a hammer and all problems become nails.




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

Search: