Re: [livecode] embedding languages/parsers

From: Patrick Borgeat <patrick_at_borgeat.de>
Date: Sat, 31 Dec 2011 14:52:58 +0100

Hey Tom,

Am 31.12.2011 um 14:36 schrieb Tom Betts:

> Anybody had any dealisng with this sort of approach?

Lua is very easy to integrate in any C Application. There are several ways how Lua can interact with your program but it's very easy to …

1. Write a function that calls some C functions and receives data from a Lua function call
2. Register the function as a Lua function
3. Just execute some Lua code that calls the function (thereby calling your C function and so one)

I turned my very inflexible OpenFrameworks Visuals System into a live coding environment very easily.

Google will provide you with some basic tutorials on that. Programming in Lua is a very good ressource for learning Lua.

http://www.lua.org/pil/


If you need speed then LuaJIT might be a good choice:
http://luajit.org/

It also includes the FFI library which looks very interesting to integrate your C function calls – haven't tested it yet!
http://luajit.org/ext_ffi.html


It also would be possible to deactivate certain Lua functionality if you don't want it in your system.


cheers,
Patrick
Received on Sat Dec 31 2011 - 13:53:26 GMT

This archive was generated by hypermail 2.4.0 : Sun Aug 20 2023 - 16:02:23 BST