3 ms·
I use Lua, with ALLOWS you to use OO, but doesn't enforce it. To say the least. Lua does have first-class functions, including full closures, and the one Lua da
by SomeCallMeTim 14y ago
I use Lua, with ALLOWS you to use OO, but doesn't enforce it. To say the least. Lua does have first-class functions, including full closures, and the one Lua data structure is a "table", which can act like a full OO class with the right patterns applied, but which generally can be extended anywhere, each "object instance" getting its own unique extra fields attached.
Lua doesn't have macros (well, you can use a library to get an extremely powerful macro language if you want [1]), but the problem with going too far down the macro/DSL route (IMHO) is that the code becomes harder for people who didn't write it to understand. Or even if the code itself is easy to understand (by virtue of being a good DSL), it becomes harder to extend or modify, especially if the modification involves something not explicitly designed for by the original developer.
If you stick with the syntax of a known and well documented language, then the learning curve for new developers is easier. Though even then, the other issues you point out can obscure the code flow, so probably the only thing you can say is that complex code is complex. ;)
[1] http://metalua.luaforge.net/ http://metalua.luaforge.net/