Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As someone who chose the Lua runtime as a basis for his own toy language, these are my observations:

A. True. Paradoxically Lua's source is well-documented in places that arguably didn't need documentation in the first place, but it tends to contain no comments whatsoever in tricky places like the VM or the implementation of internal data objects.

B. Global-by-default has bugged me as well. Thankfully it's not difficult to patch it so declarations are mandatory and local though.

C. It's a matter of taste in the end. I struggled for a while on whether to convert it to 0-based indexing or not, but so far have left things as they are. Depending on your programming style, you might end up not using indexes directly all that much.

D. The distinction between having separate array and hash parts in a table kind-of works, but only if you make the conscious decision never to work with numerical indexes. Generally, I think this type of array/map hybrid is something PHP got right with their ordered hash maps, whereas Lua's way of doing things have a few gotchas.

[] For a lot of applications, having only one number type works surprisingly well. I just wish they had opted for morphing the internal number representation according to usage in the script, instead they are now doing a separate int type in Lua 5.3 which feels a little out of place for my taste.

[] I really don't think Lua needs a separate symbol type.

[] Things I didn't like include how often you have to check for certain conditions in Lua to avoid raising fatal errors. Not being able to use keywords inside the table dot notation. The idea that the self operator works on a function in the table instead of its metatable. The lacking core library, especially when it comes to table usage. The fact that a require()'d file doesn't know its own file name. No default to-string serialization on tables. The pattern that control flow statements always require code block components instead of single expressions. Goto statements.

Here's a link to my project which addresses my personal Lua pain points: http://np-lang.org/



Hey Udo, so you're around a computer... Any reason you haven't reached out in over a month?


Hey, I'm back. Emails are going out soon.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: