by haberman · 13y ago · 0 comments
$ time lua empty.lua
real 0m0.005s
user 0m0.002s
sys 0m0.002s
$ time ./luajit empty.lua
real 0m0.005s
user 0m0.001s
sys 0m0.002s
Maybe there's cool stuff going on here but I can't get past being annoyed at these over-hyped claims.[1] I guess it should be faster than hand-written C, which is, of course, possible. ATS supposedly generates C code which is very competitive.
~/felix>flx --test=build/release --static mt
~/felix>time ./mt
real 0m0.004s
user 0m0.001s
sys 0m0.002s
~/felix>time ../lua-5.2.1/src/lua mt.lua
real 0m0.006s
user 0m0.001s
sys 0m0.003sFor some strange reason, certain misconceptions in CS/programming have half-lives measured in several decades, such as this annoying distinction between interpreters/VMs/compiled languages. We're at least 20 years out from interpreters being meaningfully distinct from VMs and compiled languages.
(Yes, most languages compile to bytecode, but people generally use the colloquial term "compiled language" to refer to a language whose implementations usually compile to machine code. JIT compilers for dynamic languages are quite a different thing because they generally only compile type-specialized fragments of code; such machine code has guards that fall back to the general-purpose interpreter if the expected preconditions do not hold.)