3 ms·
Glorious indeed. At least three levels of abstraction, two JITs, and a host of supporting code. Can we add some more layers like an emulator or get recursive by
by mutagen 11y ago
Glorious indeed. At least three levels of abstraction, two JITs, and a host of supporting code. Can we add some more layers like an emulator or get recursive by getting something like Pyasm running inside it?
- madeofpalk 11y agoHave you seen Gary Bernhardt's THE BIRTH & DEATH OF JAVASCRIPT? https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...
- d2xdy2 11y agoI saw this a few months ago, and it never gets any less insane (in a good way) to watch. Just following Atwood's Law, I suppose.
- nudpiedo 11y agoI work on a machine that has two hypervisors, one third in plan, and more abstraction layers than a lasagna software. It is still very very efficient.
- StavrosK 11y agoIt may be fast, but I doubt it's very efficient...
- bobajeff 11y agoThis crashes my mobile (webview based) web browser.
- wfunction 11y agoHow can you have multiple hypervisors...? Do they both run in ring -1?
- mschuster91 11y agoHeh, that could be a good trick against hypervisor malware. Just run inside your own hypervisor...
- fragmede 11y agohttp://en.wikipedia.org/wiki/Virtualization#Nested_virtualization http://en.wikipedia.org/wiki/Virtualization#Nested_virtualiz...
- EpicEng 11y agoFast(ish) != efficient. Your setup is categorically inefficient. That may be fine for your use case, but let's not lie to ourselves.
- EpicEng 11y agoBut... Hardware is cheap, right? Hardware gets faster all the time, right? Sure, the end user rarely sees any noticeable improvement because we just use the speed increase as an excuse to write ever more inefficient code, but at least you get to use your favorite language in the browser.
- craftkiller 11y agohttp://en.wikipedia.org/wiki/Wirth%27s_law http://en.wikipedia.org/wiki/Wirth%27s_law
- StavrosK 11y agoSince PyPy is written in (R)Python, you can just run PyPy inside the resulting interpreter, for a 1000x slowdown.
- callahad 11y agoPotentially just one JIT, right? asm.js is AOT compiled on Firefox.
- fijal 11y agoNo, because it's "AOT" compiled when it's downloaded or executed (since you have one JIT, you can't AOT compile what it produces). So you can think about it as "just" one JIT, but a very inefficient one
- pcwalton 11y ago> since you have one JIT, you can't AOT compile what it produces I'm not sure what this means, but if you mean that Firefox doesn't cache compiled asm.js code, that's not true. It does [1]. [1]: https://blog.mozilla.org/luke/2014/01/14/asm-js-aot-compilation-and-startup-performance/ https://blog.mozilla.org/luke/2014/01/14/asm-js-aot-compilat...
- fijal 11y agoSo look. PyPy compiles bits and pieces of code generating assembler. This assembler then gets to be turned into Javascript (asm.js) which needs to be parsed and compiled. All of this happens at runtime and while you can technically call the second piece of it AOT, it's essentially a double JIT or at least you pay the cost of double jitting. The equivalent in C would be generating C at runtime and sending it through gcc/clang.