Comments (13)
I have SWIG working with ofxLua now: check the swig
branch. It's planned to become the new master and now works with the ProjectGenerator.
Also, if you're into SWIG, I spun out the interface for the OF API into a separate repo: https://github.com/danomatika/swig-openframeworks
from ofxlua.
I'm not sure I understand. SWIG generates language bindings for C/C++ libraries through a separate build step. Luabind does this through templating at runtime so we already have this.
I agree I'd like to drop Boost which means dropping Luabind at some point, but so far Luabind is the easiest Lua binding library to use around .. once you have it linking in your project that is.
ofxLUA is not intended to be "OF in lua" but more of a wrapper for Luabind to make that and other custom things possible. You can make a feature complete OF wrapper with it if you want.
from ofxlua.
In looking into SWIG more I think it could be a good method to replace Luabind. Instead of writing a Luabind header you write a SWIG module file.
I can tell from first hand experience that writing the headers by hand is a pain. I have most of OF already wrapped here: https://github.com/danomatika/robotcowboy/tree/master/src/bindings and it took forever.
I'll look into it when I return to that project. Luabind is definitely a huge beast ... boost as well.
from ofxlua.
For reference: SWIG and Lua manual
from ofxlua.
Thanks for your answers !
Yes wrapping everything by hand takes forever ! That's why I was wondering if there is an automatic solution (a tool which reads the c++ headers and generate the wrappers automatically). I think SWIG can do that, maybe LuaBind as well, I didn't try anything yet to be honest ;-) I just played with your nice ofxLua and it's great !
I saw http://vimeo.com/9243889 by the way, great style !! I love it ;-)
from ofxlua.
Well both Luabind and SWIG do most of the wrapping but you still need to specify what you want wrapped. Even doing that for a larger api takes time, either way.
from ofxlua.
I gave SWIG the cold college try, but it can't handle some things that Luabind does automatically. That work is sitting in the swig branch: https://github.com/danomatika/ofxLua/tree/swig
After that didn't work out, I decided to port the OF wrapper I had from an earlier stalled project and now we have an almost full set of bindings for OF in ofxLua. Oh well, bite the bullet sometimes.
from ofxlua.
Wouaw I saw that you recenty updated your project, and I just looked at all the bindings you added, that's insane! Great work, thanks a lot!
Did you really make everything by hand, or you made some ruby scripts helper?
Now I had two problems when I used lua:
- there is no binding for stdlib by default! I've seen that there are some things like that here http://lua-users.org/wiki/LuaAddonsArchive but not really standard and well documented,
- there is no standard way to do a lua class,
How do you solve those problems?
from ofxlua.
I didn't solve them. That's why I went back to Luabind which does. :P
from ofxlua.
Oh yes, I just read http://www.rasterbar.com/products/luabind/docs.html and saw that Luabind provides classes! Nice! What about std lib data structures (map, set, queues, etc.)?
from ofxlua.
Actually the stl containers work I think, you just have to explicitly overload them: http://stackoverflow.com/questions/3624306/msvc-10-luabind-stdvector-refuse-to-compile Naturally, it's not a direct conversion to a lua table ... but that could be possible via the Lua api.
Also, one of the example scripts uses the Luabind class in lua: https://github.com/danomatika/ofxLua/blob/master/example/bin/data/scripts/polygonExample.lua#L2
from ofxlua.
Thanks a lot! I'll have a closer look soon! 👍
from ofxlua.
Also to note:
- SWIG can wrap the stl classes
- I have class support working in ofxLua using SWIG by using a class function from the Lua wiki, see https://github.com/danomatika/ofxLua/tree/swig#classes. It doesn't allow you to inherit C++ classes, but I think that's a decent tradeoff for not requiring Boost, keeping track of Luabind changes, and much easier distribution of the generated .cpp bindings.
from ofxlua.
Related Issues (20)
- ofBindings.cpp not compiling anymore on linux, HOT 5
- Cannot build ofxLua on Android Studio HOT 4
- How to call OF functions that take pointer argument HOT 3
- ofFboSettings ignored? HOT 2
- Cannot include "glm/gtc/functions.hpp" in OF 0.11.0 HOT 8
- ofxLua projects compiled for debugging crashes on start HOT 10
- Problem adding vertex to mesh HOT 4
- error getting unique faces from 3D primitive HOT 3
- Compile error on pi3b+ ofxLuaBindings HOT 11
- bad swig reference? HOT 1
- example not compiling on linux debian buster HOT 13
- Semantic issue: ofxLuaBindings.cpp No viable overloaded '=' HOT 15
- getErrorMessage() is not defined anymore HOT 4
- fails to compile on Arch (Manjaro) due to Boost version? HOT 1
- Compile Error on ofxLuaFileWriter.cpp ofToDataPath() HOT 1
- of::filesystem::path HOT 11
- ostringstream instead of stringstream HOT 4
- wrap oF 0.12 additions
- luaL_openlibs() does work with ofxLua but not with ofxOfelia since the update to Lua 5.4.6
- luaExample Visual Studio getAsTimespec() HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofxlua.