Could Love read files converted by Lua to Cee?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
TylertheDesigner
Citizen
Posts: 80
Joined: Sat Apr 10, 2010 2:27 am

Could Love read files converted by Lua to Cee?

Post by TylertheDesigner » Tue Jan 29, 2013 1:29 pm

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?

User avatar
kikito
Inner party member
Posts: 3152
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

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

Post by kikito » Tue Jan 29, 2013 2:44 pm

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.
When I write def I mean function.

User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

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

Post by MarekkPie » Tue Jan 29, 2013 3:17 pm

.so for shared libraries, .a for static libraries in Unix.

User avatar
bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes » Tue Jan 29, 2013 4:15 pm

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).

szensk
Party member
Posts: 155
Joined: Sat Jan 19, 2013 3:57 am

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

Post by szensk » Tue Jan 29, 2013 5:18 pm

Have you tried Love built with LuaJIT?

User avatar
zorfmorf
Prole
Posts: 33
Joined: Sat Mar 10, 2012 12:31 pm

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

Post by zorfmorf » Wed Jan 30, 2013 1:16 pm

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.

User avatar
TylertheDesigner
Citizen
Posts: 80
Joined: Sat Apr 10, 2010 2:27 am

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

Post by TylertheDesigner » Thu Jan 31, 2013 5:56 pm

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.

Post Reply

Who is online

Users browsing this forum: Nelvin and 11 guests