lunatic-python icon indicating copy to clipboard operation
lunatic-python copied to clipboard

How I can make a Lunatic-Ruby?

Open xskullcrow opened this issue 5 years ago • 1 comments

Hi, I used Lunatic Python to make the Love framework compatible with Python, but right now I want to do the same but instead of Python with Ruby, it has its own C Api, although different from Python or Lua, but is it possible to make a Lunatic Ruby?, that is, in the same way that Lunatic Python was made, but with Ruby, how can I do it?

xskullcrow avatar Apr 26 '20 18:04 xskullcrow

I'm not familiar with the Ruby C api but I'd assume it provides all the tools and functions you'll need to get at Ruby's language features and semantics. I don't see why Lunatic-Ruby isn't possible, it's just a matter of learning and getting familiar with the api and build a bridge with it.

There is the issue of data type mapping and translation; at some point you'll have to decided how you want to handle it from the foreign language. Some of the types are self explanatory, like value/ non-reference types eg. numbers, bools, nil, null, strings etc. But what about other things like functions, closures, array list-type containers, coroutines etc. In lunatic-python most of the latter is handled by wrapping a reference to it in some meta-object and you use that object through that meta-object.

greatwolf avatar Apr 26 '20 21:04 greatwolf