Why isn't everyone using Lua?
11–15 of 15 posts
Re: Why isn't everyone using Lua?
#12Re: Why isn't everyone using Lua?
#13Earlier quoted context omitted.
I don't have a lot of experience with Python, is it as easy to call out from and into c code as with Lua? (I am now just guessing as to why a game programmer would choose Lua over Python).
lua is easier to embed, is smaller, and has better performance. it's also a slightly cleaner language (all other things being equal, i think it is slightly better than python: the handling of tables is more regular; it has better support for continuations; it has tco; and correct scoping). on the downside, the "maps as arrays" approach is a bit clumsy.
foo = {1,2,3}
This is an ordered list. #foo -> 3 foo = {foo = "bar", baz = "bin"}
This is a dictionary. #foo -> 0; the reason for this is that #foo (or more clearly, the length of foo) measures the length of the ordered list portion of a table. If you iterate an ordered list with ipairs(), you will only get the ordered list entries, even if you were to have dictionary data in the same table.This is somewhat unintuitive in the context of other similar languages, but once you have a grasp of it, it makes a lot of sense, and is remarkably elegant.
Re: Why isn't everyone using Lua?
#14It does suffer from the lack of a robust standard library, because it is intended to be embedded, where it should inherit the majority of its functionality from the host application. That said, when embedded in a rich host environment, it's a marvelous tool.