Page 1 of 1

Could Love read files converted by Lua to Cee?

Posted: Tue Jan 29, 2013 1:29 pm
by TylertheDesigner
I was looking for various opportunities to get my game logic running in compiled C to help improve performance, and came across this - http://lua-users.org/wiki/LuaToCee
Does anyone know if Love would be able to work with a file created by this? Would it be possible to include all game logic without love-related calls into one file, to run in a compiled form? It seems like it would help efficiency, but maybe I am confused as how this compiled API would work.

Thoughts?

Re: Could Love read files converted by Lua to Cee?

Posted: Tue Jan 29, 2013 2:44 pm
by kikito
TylertheDesigner wrote:I was looking for various opportunities to get my game logic running in compiled C to help improve performance, and came across this - http://lua-users.org/wiki/LuaToCee
Does anyone know if Love would be able to work with a file created by this? Would it be possible to include all game logic without love-related calls into one file, to run in a compiled form? It seems like it would help efficiency, but maybe I am confused as how this compiled API would work.

Thoughts?
LÖVE can speak with libraries of compiled C. They take the form of a .dll file in windows. I never remember the extension for the win/mac versions. But they are different. So you would have to compile the C code three times, once per platform. I'm sure it's possible, but I don't know how to do that, and I'm sure it'll be a complex process.

Do you have any efficiency problem? If you show us your Lua code maybe we can help you make it better without trying such a drastic measure.

Re: Could Love read files converted by Lua to Cee?

Posted: Tue Jan 29, 2013 3:17 pm
by MarekkPie
.so for shared libraries, .a for static libraries in Unix.

Re: Could Love read files converted by Lua to Cee?

Posted: Tue Jan 29, 2013 4:15 pm
by bartbes
You did read that it decreases performance at the moment, right?
Honestly, I doubt it will speed the code up any reasonable amount, since you're not cutting out lua, worse, you're travelling through the api with every single instruction, no wonder it's slower. If you wanted speedup, you'd try to cross the lua/c boundary less often, or more efficiently (see luajit's ffi).

Re: Could Love read files converted by Lua to Cee?

Posted: Tue Jan 29, 2013 5:18 pm
by szensk
Have you tried Love built with LuaJIT?

Re: Could Love read files converted by Lua to Cee?

Posted: Wed Jan 30, 2013 1:16 pm
by zorfmorf
If you tell us what exactly you are trying to speed up, we could potentially help you write more efficient code. That would be a lot easier than including native functions.

Re: Could Love read files converted by Lua to Cee?

Posted: Thu Jan 31, 2013 5:56 pm
by TylertheDesigner
While I appreciate the offers of help from everyone, this wasn't for any specific code. If anything, I would have used it mostly for helper functions and any continuation of the math library (distance formula, vector math, etc). I have some larger project ideas that I am wary of starting in Lua do to the issues in efficiency, so I'm always looking for ways to boost performance.