Someone who knows how Love's source works so that instead of running Lua scripts, run Ruby, As far as I think I know, Love is written in C, and from C it compiles Lua and runs it (I think), I don't think I need to get rid of Lua completely, just add Ruby support. I need ideas or some explanation of how I can achieve this.
I have already seen the Love source code and I also know how to build it, my idea so far is to implement the Ruby interpreter and replace some functions of the Lua interpreter with Ruby.
Or maybe execute Ruby from Love without needing to recompile it?
I want to use Ruby in Love because it seems as simple as Lua and it has many similarities, but with more functions, such as classes for example. (And many other reasons)
Build Love with Ruby instead of Lua
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 6
- Joined: Sat Apr 25, 2020 7:58 am
Build Love with Ruby instead of Lua
Last edited by Nightrains on Sat Apr 25, 2020 3:52 pm, edited 2 times in total.
Re: Build Love with Ruby instead of Lua
Good luck! While it certainly is possible to create all the library bindings for Ruby which Love2d offers for Lua, I don't understand the motivation except that someone likes Ruby more than Lua?
You can have something like classes in Lua if you want to. "Ruby has classes" is not a very strong argument against Lua.
You can have something like classes in Lua if you want to. "Ruby has classes" is not a very strong argument against Lua.
In soviet russia, code debugs you.
-
- Prole
- Posts: 6
- Joined: Sat Apr 25, 2020 7:58 am
Re: Build Love with Ruby instead of Lua
It is not only that, I want to dedicate myself to creating a game with Love but I need a really good good language for that (Create games), Ruby is one of those, but Lua is a Language although fast and light, very basic.Varkas wrote: ↑Sat Apr 25, 2020 2:41 pm Good luck! While it certainly is possible to create all the library bindings for Ruby which Love2d offers for Lua, I don't understand the motivation except that someone likes Ruby more than Lua?
You can have something like classes in Lua if you want to. "Ruby has classes" is not a very strong argument against Lua.
Re: Build Love with Ruby instead of Lua
You could use something like RLua which bind Lua und Ruby together:
RLua is Ruby to Lua bindings library that features nearly complete coverage of Lua C API, seamless translation of Lua and Ruby objects into each other, calling Lua functions from Ruby and vice versa.
-
- Prole
- Posts: 6
- Joined: Sat Apr 25, 2020 7:58 am
Re: Build Love with Ruby instead of Lua
You know how to use it? I am searching but I don't know if it could be run directly from Lua, otherwise it is not possible.Xugro wrote: ↑Sat Apr 25, 2020 3:34 pm You could use something like RLua which bind Lua und Ruby together:RLua is Ruby to Lua bindings library that features nearly complete coverage of Lua C API, seamless translation of Lua and Ruby objects into each other, calling Lua functions from Ruby and vice versa.
-
- Party member
- Posts: 548
- Joined: Wed Oct 05, 2016 11:53 am
Re: Build Love with Ruby instead of Lua
Besides classes (which can be done with lua) what do you need that lua doesn't offer but ruby does?
-
- Prole
- Posts: 6
- Joined: Sat Apr 25, 2020 7:58 am
Re: Build Love with Ruby instead of Lua
I have used Lua for a long time, I want to use something new, but still using Love, and what I would like to try is Ruby or Python, but right now I only want to be able to use Ruby.MrFariator wrote: ↑Sat Apr 25, 2020 5:27 pm Besides classes (which can be done with lua) what do you need that lua doesn't offer but ruby does?
Ruby in addition to classes has a more elegant and simple syntax, but similar to that of Lua, switch cases, operators like +=, -=, etc.
Re: Build Love with Ruby instead of Lua
Ruby can do this:MrFariator wrote: ↑Sat Apr 25, 2020 5:27 pm Besides classes (which can be done with lua) what do you need that lua doesn't offer but ruby does?
Code: Select all
1:destroy_number(2)
Code: Select all
false:become_true()
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Build Love with Ruby instead of Lua
And lua's concept may very well be: "you only need tables as /the/ aggregate type" and i'm sure others can list similar whimsical one-liners for other languages like perl or whatever.
So, Löve is written in C++, and it uses LuaJIT by default to execute lua code as fast as if it were near native C code. It does not use the PuC or any other lua interpreters by default. If you do manage to recompile it somehow with a Ruby interpreter instead of LuaJIT, you will feel the godawful slowdown that will result in.
Lua's a good enough language for doing anything in it, like any other; the list of commercially released Löve games on steam is a telling supportive argument to that.
And you can implement classes in lua, there's already like 50 implementations. Along with literally anything else. Lua is basic, yes, but also flexible.
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.
So, Löve is written in C++, and it uses LuaJIT by default to execute lua code as fast as if it were near native C code. It does not use the PuC or any other lua interpreters by default. If you do manage to recompile it somehow with a Ruby interpreter instead of LuaJIT, you will feel the godawful slowdown that will result in.
Lua's a good enough language for doing anything in it, like any other; the list of commercially released Löve games on steam is a telling supportive argument to that.
And you can implement classes in lua, there's already like 50 implementations. Along with literally anything else. Lua is basic, yes, but also flexible.
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.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
-
- Party member
- Posts: 548
- Joined: Wed Oct 05, 2016 11:53 am
Re: Build Love with Ruby instead of Lua
I am aware of this quirk of ruby's, and it's an interesting one. It's not too dissimilar from lua's table shenanigans, just taken a step further ahead.
I was wondering if there was something about ruby that made you want to use it over lua, and I guess I can't fault you for wanting to learn something new. You were curious about the how, while I was simply curious about the why.Nightrains wrote: ↑Sat Apr 25, 2020 8:05 pm I have used Lua for a long time, I want to use something new, but still using Love, and what I would like to try is Ruby or Python, but right now I only want to be able to use Ruby.
Instead of cramming either ruby or python into löve though, I'd instead rather suggest looking into libraries or frameworks specifically made for either of those two languages. I'm not sure if ruby has its equivalent of löve (in terms of available features and maturity), but even a simple framework would at least allow you start writing a game now rather than later.
Who is online
Users browsing this forum: Bing [Bot] and 3 guests