Page 2 of 2

SWIG

Posted: Tue Feb 10, 2004 11:48 pm
by jvff
As pointed out above, SWIG is a tool for scripting. What I can't understand is what it does. I read at the site that it translates C++ code into other languages code. I still don't see how I can use SWIG as an intermediate for executing scripts in my c++ program. Could anyone please give me a basic explanation? Thanks in advance,

JVFF

:)

Posted: Wed Feb 11, 2004 12:30 am
by stodge
SWIG doesn't translate C++ into something else. It generates extra code (bindings) to allow scripting languages, such as Python, to access variables, types and enums (C/C++) and instances of classes (C++).

You should download SWIG and take a look at it.

Posted: Sat Mar 06, 2004 1:04 pm
by nebukadnezzar
I want to integrate a console in my game (like in q2, hl ..).
(means to input commands and then a c function is called)
(and is it possible to use if clauses??)
Should i write my own parser or is there an parser which is lightweight (fast) for doing this stuff??

Posted: Sat Mar 06, 2004 4:13 pm
by stodge
keless wrote:
stodge wrote:As I said before, look at the source here:

http://habitat3d.sf.net

The source is messy and the demo doesn't work, as the image files were created under Linux and don't seem to load under Windows. But the source for the ScriptManager is in the Core directory.

Oh and it only supports Lua 4 and toLua.
I dont see a source download on that page, or the 'project page'
Are you blind? The fourth line down has a link to the Sourceforge page. From there you can browse CVS or download using CVS.

wow...cool it...

Posted: Sun Mar 07, 2004 3:09 am
by buhatkj
hey dude...take it easy, maybe he just missed it...no need to get angry....
-ted

AngelScript

Posted: Sun Mar 07, 2004 1:35 pm
by AngelCode
Please don't dismiss AngelScript so quickly. I'm the author of it, and I am working hard on making it as easy to use as possible. If there is something missing, just tell me and I'll do what I can to include it.

I believe that what buhatkj said earlier in this thread is not entirely true anymore, as he himself said that AngelScript has progressed a lot since he last looked at it. (ref http://irrlicht.sourceforge.net/phpBB2/ ... php?t=1390).

I, or AngelScript, doesn't force you to load the dll manually. It is just that I haven't distributed the lib file for doing it automatically. AngelScript can be linked statically as well (although as it currently is LGPL it would mean that you would have to make your source open as well, the license will be changed so that this will no longer be necessary). The project files for compiling AngelScript into both static library and dll is included with the SDK.

AngelScript is also supported on both Linux and Win32. Although I as the author can't give help with the Linux part if you need it as I don't have any experience with it. Other programmers have helped me make sure the library is working on that system.

As AngelScript is still a very young library it doesn't have any utilities for automatic binding, but I'm sure that you'll find that the binding is not that difficult to do. AngelScript can directly call both global functions and class methods, so you will not have to write any proxy functions. It obviously allows registration of classes as well, with attributes and members.

Please give AngelScript a chance, take a look at it, and if it doesn't suit your needs today, come back later on to see how it is developing. As I said before, tell me if there is anything you think is needed in AngelScript. Your feedback is the only way I have to make AngelScript the best it can be.

Regards,
Andreas Jonsson
Author of AngelScript
www.AngelCode.com[/url]

Posted: Sun Mar 07, 2004 1:45 pm
by Jedive
Hi AngelCode. I haven taken a look at AngelScript, and I like it a lot. Do you know if it is possible to port it to MacOSX? If it works on Linux, it would probably work on OsX too, unless you are using ASM code in AngelScript.

Posted: Sun Mar 07, 2004 1:49 pm
by nebukadnezzar
maybe i'm dumb but how get i angelscript to be compiled with MinGW as DLL?

Posted: Mon Mar 08, 2004 2:04 pm
by AngelCode
Jedive:

It should be possible to port to MacOSX as well, even though I am using some assembler code. There is not very much asm code though, just a couple of minor functions, and these are already available in Intel syntax (MSVC) and AT&T syntax (GCC, DJGPP, Dev-C++/MinGW) so if any MacOSX compiler uses these syntaxes the port shouldn't be too hard. Of course I don't know how the PowerPC processor handles function calls, but I'm betting that it is quite similar to the Intel processor.

If anyone is willing to do a port for MacOSX I'm more than willing to include the necessary changes in the main project (with credits to the contributer, of course).

nebukadnezzar:

In the 1.6.1 beta 3 version of the SDK there are working project files for compiling AngelScript both as a static library and DLL with Dev-C++/MinGW. Perhaps you can use these?

Note that MinGW exports functions without the "_" so if you are planning on loading the DLL dynamically you'll have change the function name when calling GetProcAddress().

keless:

I'm sorry for hijacking your thread like this. Since AngelScript doesn't seem to suit your purposes (you seem to want a typeless scripting language) I guess it is not really appropriate of me to talk about AngelScript here.

everyone:

Please direct your questions on AngelScript to my e-mail ( andreas@angelcode.com ) instead of posting them here.

Regards,
Andreas Jonsson
Author of AngelScript
www.AngelCode.com

Posted: Mon Mar 08, 2004 2:15 pm
by nebukadnezzar
oh i did it with mingw yesterdy the devcpp makefile was very useful...
may be your going to put up a forum on angelcode? - (i hate these mail. lists, sorry)...

Posted: Mon Mar 08, 2004 9:00 pm
by AngelCode
nebukadnezzar

Yes, I probably should set up some forum for AngelCode. I think I'll ask GameDev.net for one (they host my web site).

keless:

Hmm, I think I confused you with the author of the other thread I mentioned earlier. If you don't have any preference towards typeless scripting languages AngelScript should be a viable choice for you, as it have all that you asked for in your inicial post. I would also bet that AngelScript is faster than both Lua and Python (since it is strongly typed and doesn't have to convert variants into C++ types, and can call the C++ functions directly without proxy functions), but that is probably irrelevant since the processor heavy tasks ought to be written in C++ (or C) anyway.

Regards,
Andreas Jonsson
Author of AngelScript
www.AngelCode.com

Posted: Mon Mar 15, 2004 3:30 am
by Miwa
I would also bet that AngelScript is faster than both Lua and Python (since it is strongly typed and doesn't have to convert variants into C++ types, and can call the C++ functions directly without proxy functions), but that is probably irrelevant since the processor heavy tasks ought to be written in C++ (or C) anyway.
I'd code up the examples in the Great Script Shootout and see how you do against Lua before making such a statement. Lua has been pretty optimized for some pretty good execution times, it's faster than just about every other script language tested... (well, QSceme was darn fast on a few of their tests too, but I'd rather not deal with lisp).

I'm really going to be happy when Lua 5.1 comes out, as it's likely to have a generational garbage collector, so I can get deterministic behavior from the garbage collector. That's real nice, since I use Lua not only on host computers, but also on many different embedded targets and real-time systems. Also makes it easier to make sure the gc doesn't cause a hitch when writing a 3d game too. :)

http://dada.perl.it/shootout/

Re: AngelScript

Posted: Thu Mar 18, 2004 5:27 am
by Guest
AngelCode wrote:...although as it currently is LGPL it would mean that you would have to make your source open as well, the license will be changed so that this will no longer be necessary.........
Regards,
Andreas Jonsson
Author of AngelScript
www.AngelCode.com[/url]
LGPL allows commercial without exposing your source. However if some one changes angelcode it self he will need to post changings.