5 ms·
V8: a tale of two compilers
- ceyusa 15y agoI guess that v8 is leading a revamp in the languages. Even perhaps the bytecodes will die!! the AST IS the bytecode :D
- swah 15y agoWhat?
- wingo 15y agoI think ceyusa was referring to the elision of bytecode as an intermediate step. Interestingly though, my assertion that V8 kept around the AST was wrong: it keeps around the source, and re-parses as needed. So maybe it's JavaScript that is the new bytecode now...
- masklinn 15y ago> I guess that v8 is leading a revamp in the languages. 1. v8 is an implementation, not a language, so it hardly makes sense to say v8 is leading a revamp in the languages. 2. most of v8's behaviors were pioneered by Self and put to task in JVMs (HotSpot and — even earlier — Jikes RVM) and Strongtalk (v8's assembler comes in significant parts from strongtalk, I believe), so it hardly makes sense to say that v8 is leading unless you restrict this to the pretty small world of javascript in-browser runtimes. 3. finally, other browsers were already walking down the route of JITs when Chrome arrived (Tracemonkey landed in Firefox trunk in October 2008) V8 is definitely a strong work of software engineering put to good use, but the amount of inane praises are grating: it's not magic and it's mostly the application of preexisting practical research and development (meaning stuff which was already used, not just research papers).
- hobo5 15y agoin fact firefox trace and jaeger monkey are pretty nice themselves if not more than v8. theyre also faster often time
- kingkilr 15y agoI don't think so, in my experience working on dynamic languages there's no need to kill bytecode, it's a useful intermediary form, as you still need either a stage-one compiler or an interpreter anyway, and interpreters are (to a first approximation) easier to write.
- Joeri 15y agoIt's amazing how much faster dynamic languages can run with some engineering effort. It's also frustrating, because it contrasts starkly with my PHP code's performance. I wish the PHP team had the resources to do this kind of work, because at this point it's the slowest subcomponent in my stack.
- SpikeGronim 15y agoHave you tried HipHop? https://github.com/facebook/hiphop-php https://github.com/facebook/hiphop-php
- true_religion 15y agoThat is a PHP to C compiler, is it not?
- kingkilr 15y agoWrong on both (but not far off) :P a) It's a "restricted subset of PHP" it doesn't compile the entire language, b) it compiles to C++.
- true_religion 15y agoWow. Anytime I hear about people choosing C++ as their target, I have mingled feelings of awe and uneasiness.
- jey 15y agoHopefully projects like HLVM will be able to fix that by proving a very good target for dynamic language implementations. It's a very ambitious project that's in relatively early stages, but seems promising.
- wanderr 15y agoIs that still true for you if you use APC? What if you use nginx instead of Apache? In our experience, APC makes an order of magnitude difference, and nginx makes several.