But fast code needs to be compiled, where the translation work gets done ahead of time and the machine code is loaded and run whenever needed. If you can save the machine code because you know you'll need it again, this is very useful. And modern compilers don't just translate, they also analyse how the program's structured and work out the most efficient way to produce the machine code depending on what's actually happening. This optimisation is the most difficult part of compiler technology to get right, but the one with the most potential for speeding things up.
So a third way is being explored – Just In Time compilers, or JITs. These are a cross between an interpreter and a compiler: they interpret each line of a program as it is executed for the first time, but keep a machine code representation. Then, if the program goes back to that line (most programs have loops and program branches that ensure multiple execution of portions of themselves), the compiler knows to refer to the translation it prepared earlier.
That combines the immediacy of interpretation and some of the potential speed-up of compilation, and you get code re-execution without having to maintain a huge database of pages. However, it's not much good for optimisation; if you translate everything when you encounter it for the first time, you've got little chance of understanding enough of what's going to happen next. And as there's a lot you don't know while you're compiling, you have to create and keep lots of code that can cope with different possibilities. That takes up a lot of time and memory.
You can read a lot more about TraceMonkey, and tracing compiler technology in general, by following some of the links from the initial announcement. But the stuff you need to know is that in benchmarks, TraceMonkey is delivering up to 30 times speed improvements over the norm – with most useful stuff running between two and eight times faster. It's not finished by any means (what do you expect from a three month old?), and when you're writing compilers the devil really is hunkering down in the sulphurous details. Expect bugs for a while yet.