lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Italo Maia <italo.maia@gmail.com> wrote:

> I don't think lua, as a language, is perfect either, but it is in the
> right track. After seeing https://www.youtube.com/watch?v=EUvgoxBm7uc from
> Roberto, the way lua walks forwards becomes much clearer. Anyhow, coming
> from python, I hardly miss a switch/case structure but, an yield would be
> certainly interesting to gave upon. Also, type annotation would be very
> nice (helloooo ravi). Large code-bases could benefit tremendously from it.
> Regarding OO with Lua, I hardly miss a built-in "class" support, but the
> lack of a standard interface for OO Lua libraries is a big bummer. Lots of
> incompatible OO libs. Something like: "if you want to build a lib to do
> this, try to make it compatible with this interface/behavior".

I like type annotation as well as a defined OO model, both of which I have
also implemented. Interestingly, from what I have seen the Ravi author and I
implemented types nearly the same way, though we did choose differing syntax
for the language.

A built-in class model does allow for some very nice optimisations of the
encapsulated data. If the compiler knows the data you are using, and you
make that data easy and fast to access, then the OO model should be much
more performant vs the metatable method of implementing classes.

I really do like the minimalist approach to Lua... I just think my idea
of minimal is a bit more than that of Team Lua. However, that is not a
bad thing as it means there is a very nice solid base to build upon!

I still need to learn more about co-routines, I get what they are but I
don't think the entire concept of when and how to use them has clicked
quite yet. That said, I would love to see if it would be possible to
implement a version of libdispatch (Grand Central Dispatch in macOS)
to Lua along with creating "blocks" of code... which are really just
closures with slightly different upvalue scope rules if I recall.

~Paige