Hacker News new | past | comments | ask | show | jobs | submit login

In the case of Javascript, the performance came at great cost. Javascript engines are monstrously complex. The language might be "simple", but the implementation is not.

Lua on the other hand is probably fast because it is simple. There aren't many other programming languages like that. (C and Scheme maybe?)




The lesson from both of these is that performance doesn't magically come from simplicity but it is enabled by simplicity. A complex system is always hard to optimise. A simple system may be easy to optimise.

Building simple systems whilst keeping performance in mind is a delicate balancing act. Local optimisations tend to add complexity that may prevent later optimisations. Sweeping generalisations that reduce implementation complexity often inhibit later optimisation due to lack of information (eg http://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-to...).


The Lua interpreter is among the fastest of languages in its class, but LuaJIT is also among the fastest JITs. I agree that a lot of this has to do with Lua being a simple language.




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

Search: