I love this! Lua is one of those languages I have a love-hate relationship with because it’s as internally consistent as C (love!), has one of the only implementations of OOP that I actually like (like), cannot simply compile to a standalone binary—yes, luajit and löve2d help with this, but it’s by no means perfect—(dislike), and is dynamically typed (hate!).
I have always been eyeing terralang to see if it gets off the ground, but it still does not compile correctly in a variety of circumstances.
If this ever gets a setting to force for everything to type-check and gets the ability to compile to a native binary, I would seriously consider writing a lot of my personal projects in it.
Thanks for the link, and here’s hoping the author keeps with it!
cannot simply compile to a standalone binary
I don’t understand this; what’s difficult about doing it with Lua? Should be trivial with a tiny C shim, unless you’re specifically objecting to the fact that it compiles to machine code using JIT instead of AOT or something.
Unfortunately as someone pointed out to me, it hasn’t seen any commits in over a year, so unless someone volunteers to take it over, this seems unlikely.
I don’t understand this; what’s difficult about doing it with Lua?
I don’t want the result to be a C program that has lua embedded in it, I want a purely lua (or something like it à la terra) language that compiles down to native code.
Ahh, I didn’t notice that either. That is disappointing. Well, perhaps Terra will manage to get off the ground eventually?
I don’t want the result to be a C program that has lua embedded in it
I don’t understand. What is the observable difference? The whole point of Lua is that it is easy to embed in C programs.
it’s clunky. if the route to compiling a lua program as a standalone binary is to write a small c wrapper and compile that, that’s something the lua toolchain should do for you automatically, without making you think about the details. (not used lua, but i had the same complaint with eql. which made me maintain part of my application in C just to keep the compiler happy)
So it’s an ideological objection rather than a concrete one?
There’s no such thing as “the lua toolchain”, just various collections of 3rd-party tools. Since Lua is useful for such a broad variety of things it makes sense for the core team to focus on doing one thing well rather than being all things to all people.
Lua’s historical “father and mother” were the data-description/configuration languages SOL (Simple Object Language) and DEL (data-entry language). They had been independently developed at Tecgraf in 1992–1993 to add some flexibility into two different projects (both were interactive graphical programs for engineering applications at Petrobras company).
I guess there are only so many good names out there.
That said, I’m very interested in better static analysis tools for Lua, and I think a line-for-line superset is the right way to go. I’d be very interested in reading more details about “plausible typing” and what relationship it has to Dialyzer’s success typing.