11 votes

A Look at the Design of Lua

2 comments

  1. s4b3r6
    Link
    I'm a Lua fan. I adore using the language, both embedded and scripting, and it is incredibly easy to use. Lua's use of metamethods, tables, and functions to implement Object-Oriented design is...

    I'm a Lua fan. I adore using the language, both embedded and scripting, and it is incredibly easy to use.

    Lua's use of metamethods, tables, and functions to implement Object-Oriented design is probably one of the best I've seen.

    Just the fact that "Hello, World":sub(1, 9) is sugar for string.sub("Hello, World", 1, 9) is amazing, and a fantastic choice. Combine that with tables being weak references, and you have an instant way to use self in any OO class a user creates.

    However, pcall is anything but elegant or straightforward. Ensuring you've covered all relevant use-cases is painful, rather than something that just flows in the background of what you're trying to create. It's a pain point.

    5 votes
  2. spit-evil-olive-tips
    Link
    I've worked with Lua a bit, by way of using Awesome WM, but never really grokked its design and why it does what it does until this article.

    I've worked with Lua a bit, by way of using Awesome WM, but never really grokked its design and why it does what it does until this article.

    4 votes