Closed skunkiferous closed 3 years ago
c2mir is better than tcc anyway - so can you not just use that?
So, you think c2mir would be the way to go. You say that "c2mir is better than tcc anyway". Do you mean that c2mir would make faster code (because TCC hasn't been updated to support recent processors), or is there some other reason c2mir would be better? For example, would there be "less overhead" calling C from Ravi, or the other way around, using c2mir, because they share the same bytecode?
I am not sure I have understood what you are trying to do.
If you are seeking to easily compile C code from inside Ravi, then c2mir can do that. I have not exposed this capability.
The main limitation of c2mir is it only supports 64-bit architectures. I have not compared with tcc, but my understanding of tcc is that it lacks an optimizer.
That answers my question.
tcc.lua seems like a great addition to luajit, to implement "hot loops" and bit-fiddling in C, instead of Lua.
Since Ravi uses MIR, and there is a c2mir compiler, that can also be used as a library, like TCC, one would think, it should be possible to provide something similar to tcc.lua, but using c2mir.
How difficult would that be?
Background: I'm looking for an all-in-one solution to scripting a game, with an "easy-to-learn" language with a community (Lua), for the "modders", the ability to use static-typing (Ravi) for "me", and the ability to code low-level for performance-critical code (C).