Pike: Integration with C++? - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Programming Languages & Scripting (/forum-8.html)
+--- Thread: Pike: Integration with C++? (/thread-6715.html)
Pike: Integration with C++? - DoG - Sep 30, 2003 02:10 PM
I was looking the whole day, searching for something on how to integrate the pike scripting language with C++ to be used as a game script language. Found nothing (only sth about sth called CMOD, not really helpful), so any pointers (no pun intended) are appreciated.
Pike: Integration with C++? - OneSadCookie - Sep 30, 2003 02:28 PM
That's the problem with Pike unfortunately... nice language, no docs on integration with C.
Go with Lua or Ruby instead. Nice languages both (though for somewhat different purposes), and easy, well-documented APIs.
Pike: Integration with C++? - DoG - Oct 1, 2003 08:32 AM
That, ummm, sucks.
I will try to contact the Pike dev's on this. The project that this is needed for will eventually be fully documented, including Pike integration, if it is possible after all.
Pike: Integration with C++? - DoG - Oct 1, 2003 09:01 AM
In the meanwhile, since these dudes seem a little inaccessible, any other languages with C++ integration possibilities? How is that with Python, Lua, Ruby?
Pike: Integration with C++? - Josh - Oct 1, 2003 06:54 PM
For lua look at OSC's uDG entry for last year. For Ruby look at his entry for this year. Do we see a theme?
Pike: Integration with C++? - OneSadCookie - Oct 4, 2003 08:16 PM
Both Lua and Ruby are very easy to integrate with C/C++, Ruby's easier to translate OO between the languages, but it just depends what you want to use the scripting language for.
Mail me if you need source/example projects.
Pike: Integration with C++? - DoG - Oct 5, 2003 02:10 AM
Quote:Originally posted by OneSadCookie
We have also made Lua and Ruby final candidates, no success with contacting the Pike dudes.
Ruby seems to be working with SWIG nicely, though I have not tried it myself, but the other guy on the project got it to run.
As for Lua, it is still a pain. I got a Lua VM working, no problem executing script files, but I have yet to do the C++ integration. Tolua++ doesn't work, it seems to have no hang on namespaces. Even though it compiles, and I can load my lib to the Lua VM (in this case just a test Vector3D), and it seems like the namespace and class are there (the tables exist), but I cant create an object instance.
Today, I will see what luabind brings, though the compilation of that was already a little shaky.
Pike: Integration with C++? - OneSadCookie - Oct 5, 2003 02:27 AM
Yeah, Lua isn't great for OO stuff... you probably don't want Vector3D to cross the language barrier anyway though
As I said before, it just depends what you want to use the language for. Ruby's a great language for writing large amounts of high-level code very quickly in. You could quite happily put all your game logic and higher-level event handling, object management, UI, &c code in Ruby and just leave C/C++ for the low-level performance-sensitive stuff.
Lua's good for being a small scripting language... simple responses to events, for example... but it's not great for high-level stuff where you really want good object orientation. It has the advantage though that you can easily make sure that scripts can't harm anything, and that you can have multiple interpreters simultaneously.
I really wish Pike had a better API / docs to become a sort of halfway house... but it looks like that'll be a wee way off yet.
Pike: Integration with C++? - DoG - Oct 5, 2003 03:42 PM
You didn't happen to use luabind for your bindings, did you? I had no success with it, looked through all the examples, made a really simple test (just a constructor is bound), yet it doesn't compile (though, right now, not even vector<>::iterator compiles).
Luabind seems to be quite nice, though, much cleaner and efficient than tolua++. Too bad none works.
We want to use lua as a general scripting language, potentially ranging from game logic scripting to AI, possibly UI scripting, and more. Though, all of the UI will be contained with a single OpenGL view, so far. Thinking about it, since all graphics will be in a hierarchical tree, drawing themselves, it might be possible to script large parts of the UI.
So long, I have to get the whole Carbon OpenGL thingy working, can't do it in Cocoa this time
Pike: Integration with C++? - OneSadCookie - Oct 5, 2003 05:09 PM
I'd say Ruby is a better bet for such large-scale scripting.
I never used any automatic binding stuff for lua, I did all the bindings myself... particularly binding classes seems quite difficult, since Lua doesn't directly have the concept of a class.
Does SWIG not have a Lua back-end?
Pike: Integration with C++? - DoG - Oct 6, 2003 08:38 AM
Quote:Originally posted by OneSadCookie
No. Ruby and Python have, among others.