

V8: a tale of two compilers - p4bl0
http://wingolog.org/archives/2011/07/05/v8-a-tale-of-two-compilers

======
Joeri
It'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.

~~~
masklinn
> It's amazing how much faster dynamic languages can run with some engineering
> effort

It's a bit more than just "some", and it's an evolution 20 years[0] in the
making[1].

[0] <http://en.wikipedia.org/wiki/Self_(programming_language)>

[1] <http://en.wikipedia.org/wiki/StrongTalk>

~~~
eneveu
I learned about this when watching Avi Bryant's great talk "Bad Hackers Copy,
Great Hackers Steal" : <http://vimeo.com/4763707>

He explains that dynamic languages are not inherently slow. It's their current
implementation that's slow. Java is not fast thanks to static typing, it is
fast thanks to the Hotspot VM, which builds upon the StrongTalk VM
implementation.

Quote taken around the 13" mark (some trolling included ;) ): "Ruby has the
dynamic part, and Java has the fast part. And this has led to this assumption
that people have that the reason that Java is fast and Ruby is slow is because
Java is static and Ruby is dynamic. And that's just not true, that's just a
myth. Nothing about Java being fast has anything to do with it being static.
It's simply that the papers that the Java people read were the ones that told
you how to make it fast, and the papers that Matz read were the ones that told
you how to make it usable."

------
ceyusa
I guess that v8 is leading a revamp in the languages. Even perhaps the
bytecodes will die!! the AST IS the bytecode :D

~~~
masklinn
> 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
in fact firefox trace and jaeger monkey are pretty nice themselves if not more
than v8. theyre also faster often time

