Integrating LLVM into Love2d

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
max77
Prole
Posts: 2
Joined: Mon Jun 27, 2016 7:08 pm

Integrating LLVM into Love2d

Post by max77 »

Hi guys, I'am looking for a way how to integrate LLVM into lova2d? Any suggestions on how this can be done?
Last edited by max77 on Thu Jul 07, 2016 1:51 pm, edited 2 times in total.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Integrating LLVM into Love2d

Post by Nixola »

I don't know how and if that can be done, but I wanted to tell you that you can load C libraries using LuaJIT's FFI, just in case you didn't know. It's not exactly what you need, but it allows you to easily use a different language (although a specific one) to get math done faster.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Trebgarta
Prole
Posts: 33
Joined: Mon May 23, 2016 5:21 pm

Re: Integrating LLVM into Love2d

Post by Trebgarta »

I guess you can use LLVM C API using LuaJIT ffi like Nixola suggested.

Relevant: https://pauladamsmith.com/blog/2015/01/ ... c-api.html
User avatar
Linkpy
Party member
Posts: 102
Joined: Fri Aug 29, 2014 6:05 pm
Location: France
Contact:

Re: Integrating LLVM into Love2d

Post by Linkpy »

Can be interesting, but I think the cleaner way to do it is to add a custom C++ module directly within the Love2D executable (to have a "love.llvm" table in Lua). I think you need to search for tutorial or any documentation about LLVM directly. Maybe this can be useful.
Founder of NeoShadow Studio. Currently working on the project "Sirami".
github / linkpy
max77
Prole
Posts: 2
Joined: Mon Jun 27, 2016 7:08 pm

Re: Integrating LLVM into Love2d

Post by max77 »

Hello, guys, thank you for your responses!

I know there is Luabind - a library that creates bindings between C++ and Lua. It has the ability to expose functions and classes, written in C++, to Lua. Can it be used to add a custom c++ module/function directly to the Love2D executable? Any real example how to this in love2d sources would be very helpful.
User avatar
Linkpy
Party member
Posts: 102
Joined: Fri Aug 29, 2014 6:05 pm
Location: France
Contact:

Re: Integrating LLVM into Love2d

Post by Linkpy »

I don't know myself. You should go directly in the Love2D's source codes : https://bitbucket.org/rude/love .
Normally, within the module directory.
Founder of NeoShadow Studio. Currently working on the project "Sirami".
github / linkpy
Post Reply

Who is online

Users browsing this forum: No registered users and 68 guests