Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Static vs. dynamic typing has nothing to do with performance. You can have a reasonably performant implementation with dynamic typing, or conversely a statically typed language with zero concern about performance.


That's empirically not true. The dynamic language (implementation) that is closest to static typing performance is probably Javascript, and it achieves this using an absurd amount of work to infer static types and to jit the code.

If instead you make the reasonable assumption that dynamic typing => pointer indirection, and look at how memory works in modern machines, it's also theoretically untrue for a huge number of programs.


Not every code is written with performance in mind. In fact, most aren't. This alone gives much leeway for dynamic languages; if you can make more performant program easier to write, they can pay off even when their maximum performance is limited (this is my definition of "reasonably performant"). The exact amount of leeway will of course depend on circumstances but I guess 10x is a fair estimate, which many JIT implementations can reach---not just crazy beasts like JS engines.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: