Comment by spacechild1
1 year ago
It is a low-level API for creating bindings to other languages and as such typically isn't used directly. (Well, unless you are writing C :)
What I find fantastic about the stack-based API is that it exposes very few interpreter internals. As a result the authors may drastically change the implementation without breaking the public API. Most importantly, they hide the internal object representation and as a user you only ever deal with plain C types, like integers, floats, C-strings and user data pointers. As a consequence, you don't have to think about memory management because all types are passed by value! In fact, someone could theoretically write a Lua implementation with reference counting and the API wouldn't have to change. It really is a very smart and elegant design.
No comments yet
Contribute on Hacker News ↗