We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Talk:Lua
Jump to navigation
Jump to search
Why is it here at all? Is Lua esoteric? If the concept of tables and metatables can be considered an "esoteric" feature of the language, then it should be at least mentioned (if not explained in detail). --Blashyrkh (talk) 09:35, 20 July 2026 (UTC)
- We have references to non esoteric languages on here, if it needs to be referenced for whatever reason --Yayimhere2(school) (talk) 10:14, 20 July 2026 (UTC)
- Agreed. However, at the same time, we can find ways to be light-hearted and talk about the weird parts of the language; see Python for an example. Corbin (talk) 19:07, 20 July 2026 (UTC)
- not sure if this is fit for inclusion, but Lua's pattern matching allows for handling nested brackets via
%bxy, e.g("abc (def (ghi) jkl) mno"):match("%b()")returns(def (ghi) jkl), something regular Regex can't do. off the top of my head I can't really name any other "esoteric" features other than, well, tables in their entirety —aadenboy (talk|contribs) 19:17, 20 July 2026 (UTC)- IMHO, an amazing (unique? esoteric? idk) feature of Lua is that OOP can be constructed almost without syntactic support from the language itself (except
:operator andselfkeyword), while keeping amount of boilerplate code at minimum level. Compare it with C. Can one implement OOP in C? Sure! just look at the Linux kernel or gtk. But OOP in C requires a lot of boilerplate code. Compare with C++ now. C++ is OOP naturally. But it's done at the cost of syntactic extension of C. Lua proudly sits on both chairs. --Blashyrkh (talk) 19:33, 20 July 2026 (UTC)
- IMHO, an amazing (unique? esoteric? idk) feature of Lua is that OOP can be constructed almost without syntactic support from the language itself (except
- multiple expressions and results. functions can return more than one value, multiple variables can be initialized in one line, etc. rules for how they are handled are also defined in the manual. here's for v5.4. one 'esoteric' rule for multiple results is that they are only expanded iff it is the last exp and it's not wrapped in parentheses, else it is eq to the first value. so, given
f()returns 2 and 3:x, y, z = 1, f()is eq tox = 1; y = 2; z = 3, butx, y, z = f(), 4is eq tox = 2; y = 4; z = nil-- somefan (talk | contribs) 20:57, 20 July 2026 (UTC)
- not sure if this is fit for inclusion, but Lua's pattern matching allows for handling nested brackets via