Page 2 of 2

Re: Build Love with Ruby instead of Lua

Posted: Sun Apr 26, 2020 1:25 am
by Nightrains
zorg wrote: Sun Apr 26, 2020 12:44 am That said, if you really want to write a ruby interpreter, whether to replace LuaJIT or even just in lua, that's up to you and is in fact a more gargantuan task than if you just started coding your game at this moment. :monocle:
I can, I made games with LUA and not just in Love, but the purpose of this project is not only to create a game, but to do it in a new language, and also, I want to make Love compatible with Ruby.

So I will keep looking how and if I can't then I'll try but with a different language.

Re: Build Love with Ruby instead of Lua

Posted: Sun Apr 26, 2020 1:28 am
by MrFariator
Fair enough, best of luck to you, then.

Re: Build Love with Ruby instead of Lua

Posted: Sun Apr 26, 2020 11:48 am
by pgimeno
I believe that doing this would "just" involve rewriting the wrap_XXXX source files and the Lua scripts, and maybe a few other changes. I don't think the code depends on Lua in any other part. At least a grep for Lua reveals pretty few instances out of these files; I think I only found one in BezierCurve.h but I haven't looked in detail.

See for example https://github.com/love2d/love/blob/mas ... aphics.cpp - good luck rewriting that for a different language!

Then of course you need to somehow adapt the build system.

Re: Build Love with Ruby instead of Lua

Posted: Sun Apr 26, 2020 6:18 pm
by Nightrains
pgimeno wrote: Sun Apr 26, 2020 11:48 am I believe that doing this would "just" involve rewriting the wrap_XXXX source files and the Lua scripts, and maybe a few other changes. I don't think the code depends on Lua in any other part. At least a grep for Lua reveals pretty few instances out of these files; I think I only found one in BezierCurve.h but I haven't looked in detail.

See for example https://github.com/love2d/love/blob/mas ... aphics.cpp - good luck rewriting that for a different language!

Then of course you need to somehow adapt the build system.
Maybe it is easier than that, the modules can be tables and Lua functions, as long as they can be used from Ruby.

With Lunatic-Python I managed to make Python useable in Love without recompiling it, although I had to call the main Python script from main.lua, but then I give it the Love functions from main.lua and from Python they can be used.

I could do the same but from the script that runs main.lua, or maybe in another similar way.