4 ms·
Being able to build it on top of the language and having it right inside basic language elements as an always-on possibility are quite different things. The fo
by usrusr 11y ago
Being able to build it on top of the language and having it right inside basic language elements as an always-on possibility are quite different things.
The former allows straight forward optimization of the simple case, simply accepting the performance hit of the stuff built on top (which still might benefit from some of those optimizations), while the latter forces the optimizer to invest a large effort into distinguishing between the simple case and the exceptional, and then there still needs to be an always-on fallback path from simple to exotic.
- groovy2shoes 11y ago"Prototype inheritance" is a fundamental building block in Lua, enabled via the metatable mechanism. It's by far the most common way to do OOP in Lua. I'd say it is, in fact, built right in to the basic language.