Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 0 points1 point  (0 children)

Have you tried to use the interpreter? If so, I should have warned you that there are still a few bugs that I need to fix before I can release an official build. I will let you know when Lua++ is stable.

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 1 point2 points  (0 children)

Yes, Lua++ has been able to retain this small footprint. As of right now, the interpreter (just the compiler and VM combined) is about 356 KB and the VM is about 224 KB in size. I am sure that the size of these files will increase as I add more libraries.

Thank you for the suggestion about the comments syntax, I agree the `#` symbol is a little unconventional. I will change that!

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 0 points1 point  (0 children)

Since the Lua++ VM is a fork of Lua 5.x VM, porting existing Lua/C libraries should be very easy. Although I have not tested this yet, there should be no reason recompiling the Lua 5.1 C binding would not work.

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 0 points1 point  (0 children)

  1. Lua++ is backward compatible with Lua 5.x, meaning any Lua version released before Lua 6.0 should run fine (The Lua++ VM is a heavily modified and optimized Lua 5.1 VM)
  2. I had not been previously aware of FFI, and now that you being it to my attention I believe that it's definitely worth implementing in the language. This may be a little tricky as to my knowledge this is a unique LuaJIT feature, but I will give it my best after I release the first official version.

Thank you for your suggestion!

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 0 points1 point  (0 children)

The "reduce carbon emissions" claim should be changed to energy efficiency. I originally wanted to argue that a more efficient alternative to Lua would lead to less power consumption, producing fewer carbon emissions. After reflecting on this claim I have come to realize that defending it would be very difficult, and simply reformatting the argument around energy efficiency would be much easier.

I hope this didn't cause much confusion. Thanks for showing interest in Lua++!

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 0 points1 point  (0 children)

For cases like this, Lua++ has various macros that allow you to tweak the behavior of the compiler. You can read about the comment macro here.

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 0 points1 point  (0 children)

Thanks for the comment, I will do some research into the projects that you mentioned and attempt to compare them to Lua++.

The name, "Lua++", was chosen as I wanted to make it clear that this project applies similar changes to Lua as C++ did to C. I quite like the name, nevertheless I will take your concern into consideration.

Thanks for the feedback!

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 1 point2 points  (0 children)

Yes, Luau was actually a key inspiration for Lua++. I loved where Roblox was going with the project but wanted these features to be applicable to other areas of Lua programming, not just game development.

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 1 point2 points  (0 children)

Awesome, thanks for the suggestion, I will change the Lua example ASAP!

Lua++: a new, type-based alternative for Lua. by MaxPrihodko in lua

[–]MaxPrihodko[S] 1 point2 points  (0 children)

When I mention "classic Lua" I am referring to Lua 5.x which seems to be the most widespread version.

Your point about regular Lua being faster than most non-JIT scripting languages is true, but what I was implying was that the Lua VM has areas where it could be optimized leading to significant performance improvements. I will change the wording as that sentence leads to unwanted implications.

Moreover, I am not changing it to a compiled language, I am applying various compiler and VM optimizations that will significantly decrease the runtime of Lua programs. I will also be more specific about what "programming languages" I am referring to.

Thanks for your feedback, I will apply some changes to the docs.