4 ms·
The demos are cool, but are there any among them that can't be done in JS? I know I've seen Voronoi polys in JS that were way less janky than the one in the PN
by thrownaway2424 13y ago
The demos are cool, but are there any among them that can't be done in JS? I know I've seen Voronoi polys in JS that were way less janky than the one in the PNaCL demo.
- spot 13y agothe voronoi is the only one that i think is competitive in JS. js has plenty of 2d physics sims but i have yet to see a decent 3d one like this.
- thrownaway2424 13y agoAre you saying that some of these can't be done in JS, or just that they're more efficient in PNaCl?
- binji 13y agoThey can all be done in JS (modified to remove threading, of course). In fact, many of them already run in emscripten/pepper.js (see http://trypepperjs.appspot.com http://trypepperjs.appspot.com).
- cdash 13y agoWhich is a pretty big deal imo considering Voroni goes from 3.3 fps with 1 thread to 12 fps with 8 threads on my laptop with an intel quad core with hyperthreading.
- leoc 13y agoWell, presumably you could implement a language with bignums in PNaCL with reasonable efficiency, something which is evidently not possible in JS.
- azakai 13y agoWhy is that evidently not possible? :) Serious question, I would guess anything that can be done in C - and bignums can - could be done well in JS, because typically C code compiled to JS runs at about half the speed of native. If you have results showing otherwise for bignums, I would be very interested. Anything special about that particular problem?
- leoc 13y ago> Why is that evidently not possible? :) Because Mozilla assured us that it was not. Central to Mozilla's case against Dart was the assertion that parts of it - including bignums - could not be implemented efficiently by compiling to JS, leaving native Dart runtimes at a strong advantage.
- azakai 13y agoLink?
- leoc 13y agoHere we are: https://news.ycombinator.com/item?id=3094072 https://news.ycombinator.com/item?id=3094072
- azakai 13y agoThanks, reading that it says that native bignum support can speed things up. That's probably true - the only question is how much. If it's 25% vs 2,500% then that's what matters. I don't see an actual debate about numbers in that thread there, just generalities? As I said above, I would expect JS to reach about half of the speed of C. It's possible that having native bignums would have removed some of that difference. More importantly, the context here is PNaCl. Do you see a reason bignums could be emulated better in PNaCl vs JS? I assumed that's what you were implying, but perhaps I misunderstood you? Sorry if so.
- thrownaway2424 13y ago