Page 1 of 1

Integrating LLVM into Love2d

Posted: Mon Jun 27, 2016 8:45 pm
by max77
Hi guys, I'am looking for a way how to integrate LLVM into lova2d? Any suggestions on how this can be done?

Re: Integrating LLVM into Love2d

Posted: Mon Jun 27, 2016 8:56 pm
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.

Re: Integrating LLVM into Love2d

Posted: Mon Jun 27, 2016 11:07 pm
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

Re: Integrating LLVM into Love2d

Posted: Wed Jun 29, 2016 7:55 am
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.

Re: Integrating LLVM into Love2d

Posted: Sun Jul 03, 2016 10:17 am
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.

Re: Integrating LLVM into Love2d

Posted: Sun Jul 03, 2016 2:56 pm
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.