Close

Once more in the Lua

A project log for Over-engineered LED strip controller

Way too much stuff to light my garage MY way.

wjcarpenterWJCarpenter 07/30/2017 at 03:290 Comments

I've spent some time looking into Lua. I think it will meet my needs for this project.

As with most languages, the authors have made some choices that I wouldn't have made. However, there seems to be at least a reasonable rationale for the things they decided. And they seem to have made it so that you can get close enough to things you want the language to have. For example, Lua doesn't need semi-colons to terminate statements ... but you can put them in there if you want to. Yay! They don't have real classes and objects, but you can make your code look a lot like it does.

I was planning to do most of this code in an event driven way, and the Lua libraries for NodeMCU make it pretty easy to register callback functions to handle interrupts. On the other hand, the standard libraries are not especially rich in devices (like Arduino-land), but I think that will be OK.

Oh, yeah, it's got GC memory management. I've spent enough time debugging mismatched malloc and free, thank you, so GC is a major plus for me. I doubt that I will have that many collectible "objects", but it's nice to not have to worry about it.

Discussions