You can make your Lua games for nintendo ds using the Gly engine, but as limitations of only fixed point and without cmath library, as it has not been worked on yet.
git clone https://github.com/gamelly/core-native-ps1
cmake -Bbuild -H. -DGAME=path/to/your/game.lua