Writting a wrapper for a customized lua-based scripting language

144 Views Asked by At

I have a program which is an extension of Lua, i.e. it includes a bunch of additional objects and functions. This program can now be used to execute lua scripts which make use of the additional features on top of standard lua. A generic example for such a script would look like this (where the NewObject and the + operation are not standard lua)

   A = NewObject(12, "a string argument", table)
   B = NewObject(1, "another string", other_table)
   C = A+B
   ... do something with C and print the result

Now, I would like to use these objects and functions in python. Therefor I want to write some kind of wrapper that allows me to pass the argument data to my (custom) lua-runtime (and retrieve the results in the end) and make the above calls dynamically. I know that python wrappers for standard lua exist, e.g. lupa. However, I'm not sure if I can make use of it, since I don't use the standard lua-interpreter. Furthermore, I want it to be as light-weight as possible (the data I need to exchange is pretty "standard", i.e. integers, floats, strings, booleans and tables of such types, so no "higher" objects) and maybe LuPa is already doing much more than I need..).

Unfortunately, I have no experience with writing wrappers or language bindings and I don't really know how to get started. I would be happy if anybody can provide me with some reading about the topic or has some suggestions for the present situation.

0

There are 0 best solutions below