Hacker News new | ask | show | jobs
by knz42 4672 days ago
"Just a whole bunch of inefficiencies in the implementation."

That's a common misconception: what makes a language "faster" than another is not only more or less optimizations in the compiler or efficiencies in the runtime. There are language features that just kill performance. The typical culprits, in descending order of cost:

- dynamic typing

- dynamic dispatch (virtual methods)

- mandated bounds checking

- existence of an "eval" function

- mandated introspection

1 comments

To write fast code, you have to use the right data structures (impossible if everything is a hash map), manage memory (possible even with garbage collection), and be able to inline everything in the inner loops (introspection,eval,etc make this hard).