Looking for some Lua alternatives to be embedded in a game engine
Since I'm having untracable issues with Lua due to its API and lackluster documentation, I've decided to drop it from my game engine (PixelPerfectEngine) in favor of some easier to use alternatives.
What I need is:
open source
small footprint even if it at the cost of some complexity (I need it as a scripting engine, not as a replacement for compiled application languages)
integer support (I don't care if I could just round it on the backend)
C or C++ ABI
can be embedded into a software (yes, there are people that suggest you to use janky solutions like passing data in files and command line)
Even a better Lua implementation would suffice, and if I had the time, I would port the official one to D (my main language), while getting rid of the godawful stack method of control.
gdscript is awesome but isn't plug-and-play embed like Lua is. Here is an example of gdscript being pulled into another environment https://github.com/gdscript-online/gdscript-online.github.io This kind of breaks your last bullet point though since it's not as developed as it should be but still possible to actually embed.
This is not a recommendation, but just a couple of days ago someone linked to this project, claiming similar goals to lua, great performance, and gradual typing:
A more established, proven option is Haxe. Haxe has a lot of libraries but I think it's specifically designed to be batteries-optional. This Haxe VM in particular looks pretty impressive:
Check out scheme. The syntax is incredibly simple. Watch like the first 20 minutes of a first sicp lecture, and you'll know enough lisp to read basic scheme.
Macros are magic, and I'm guessing they would be really useful for you to abstract interactions with the engine. Check out the for macro and how it's compared to the standard loop macro. Both implement a DSL to make iteration both simpler and easier to read (if you understand the specific language of the macro).
open source
Licence will depend on the implementation, but I think most are open source. Guile was the GNU champion in the embedded language war. Also, you can go full GNU with GNU make, GCC, and GNU guile.
small footprint even if it at the cost of some complexity (I need it as a scripting engine, not as a replacement for compiled application languages)
Scheme's whole thing is to be minimal, while letting you make anything you need. For example the r5rs specification is 50 pages long, and I think has recursion as the only iteration method. Specific implementations add additional features like while loops.
integer support (I don't care if I could just round it on the backend)
I'm not sure what you mean by int support, but there should be exact/inexact and "convert between them" functions for numbers. Check out the scheme specs and implementation docs for specifics.
C or C++ ABI
interop also depends on implementation, but guile should be pretty good.
can be embedded into a software (yes, there are people that suggest you to use janky solutions like passing data in files and command line)
there are a few schemes made specifically for embedding
Documentation is really varied. Also, schemes usually don't have all that much online info available, but the bigger ones have good communities.
Just to warn you, you're probably going to end up using Emacs if you decide to work with scheme. Doom Emacs is great. For magic check out lispy and paredit.
The main issue with Lua isn't the language, but the API, which doesn't want to play nice with my program, and is poorly documented with the assumption that people only want to use the API in the simplest possible way, even at the cost of not using certain functionality.
I have used DukTape in the past, it is an ECMAScript (javascript) implementation. The API is amazing, very consistent parameter and naming schemes, uses a stack based approach (feels like a better version of how lua goes about things). It is designed to be embedded. Documentation for the API is some of the best you will see, lots of good examples. It even has a debugger that you can hook into.