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 »

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: 3153
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 »

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 »

.so for shared libraries, .a for static libraries in Unix.
User avatar
bartbes
Sex machine
Posts: 4946
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 »

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 »

Have you tried Love built with LuaJIT?
User avatar
zorfmorf
Prole
Posts: 35
Joined: Sat Mar 10, 2012 12:31 pm

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

Post 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.
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 »

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: Majestic-12 [Bot] and 5 guests