Scripting language choice

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.

Which scripting language would you prefer?

AngelScript
5
6%
Lua
29
37%
Python
22
28%
Game Monkey
7
9%
Squirrel
7
9%
Other
8
10%
 
Total votes: 78

pixeljunky
Posts: 19
Joined: Sun Feb 25, 2007 1:31 pm

Post by pixeljunky »

Is there already a swig bindung for irrlicht and how does this work ?
I saw in a thread that the python binding is done with swig. But it needs an
update.
If the python binding is updated then it is possible to use all the other swig supported languages ?Would be really great if the python -venom project would be updated again.

pixeljunky
SiriusCG
Posts: 58
Joined: Tue Feb 14, 2006 1:05 am

Post by SiriusCG »

If you do choose Lua specifically, I recommend tolua++ for C++ bindings. It has a few quirks but it works quite well and is simple to use.
Thx zenaku 8)

We're starting to look at LUA pretty seriously and tolua++ will figure prominently in the implementation...
steveth45
Posts: 14
Joined: Fri Mar 03, 2006 2:42 am
Location: Eugene, OR, USA
Contact:

Post by steveth45 »

The problem with most of the bindings is that they are making a 1:1 binding, so you have to write the same exact function calls, but maybe you don't have to put a semi-colon at the end, because its a scripting language, or whatever. That makes no sense. A scripting language binding should simplify the interface, or else you aren't gaining much. I've made a simplified Python binding using Boost::Python, which is _much_ easier to use than SWIG, IMHO. Don't worry, I'll clean it up and share it with the world, soon enough :). I've simplified a few things. For example, when you do this in Python:

Code: Select all

my_effect.setLifetime(1000)
this gets called:

Code: Select all

void particle_effect::setLifetime(int ms )
{ 
	ISceneNodeAnimator* anim = parent.getSmgr()->createDeleteAnimator(ms);
	node->addAnimator(anim);
	anim->drop();
}
Now, three lines of code can be written in one. Scripting support should simplify things, or there is no point.
+--------+
steveth45
+--------+
Ambassador
Posts: 4
Joined: Sat Mar 17, 2007 11:12 pm
Location: Finland

Post by Ambassador »

steveth45 wrote:Scripting support should simplify things, or there is no point.
Two points for "direct" scripting bindings:
1) You don't have to learn a new api
2) Compiling process gets eliminated
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

Ambassador wrote:
steveth45 wrote:Scripting support should simplify things, or there is no point.
Two points for "direct" scripting bindings:
1) You don't have to learn a new api
2) Compiling process gets eliminated
thats not sereous points. if guy is capable to implement script engine then he is capable to learn some new api (but i dont see what new api.. eh whatever). Compiling is done every time you run a script so its not eliminated, it just slows down application. you can use precompiled bytecode to eliminate compiling on the run then you gain faster launch and oportunity to compile bytecode yourself. as we see if you want to get something (in our case simplicity) we must give something (in our case speed). if we use precompiled bytecode then scripting engine is umm... useless i gues. so in any case it hits performance.

i can think lots of reasons why scripting engine shouldnt be used but somehow i think that there is no other better choice. i was thinking about making something like my mission file format where info would be provided and my application would simply parse it and do whatever was written there but that means im inventing another scripting language which is far from beeing good.

so it looks like i just said my opinion and objected to myself. i gues i could be good lawyer :lol:
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

ya python would be cool but the problem that the last binding for python was for v0.14!!!
ahh,how do i make a binding for a language!?
iZigoo
Posts: 53
Joined: Fri Feb 23, 2007 1:32 pm

Post by iZigoo »

hey steveth45,

great idea ....
I am really excited to see your python project ...
It is really good for irrlicht to have better python support.

izigoo
-------------------------------------------------------
iZigoo - The open 3D internet

iZigoo Homepage
Ambassador
Posts: 4
Joined: Sat Mar 17, 2007 11:12 pm
Location: Finland

Post by Ambassador »

roxaz wrote:if guy is capable to implement script engine then he is capable to learn some new api (but i dont see what new api.. eh whatever).
Who said that scripting language users are capable of implementing script engines? Besides, even though thousands of people are able to code scripting engines and even full 3d engines, they don't, because that would just take too much time. Scripting languages are meant to simplify the development process and make it faster, weather it is a new api or not. For some people, the same old api is better than the new one. Likewise for some people a new api might be better.
roxaz wrote:Compiling is done every time you run a script so its not eliminated, it just slows down application.
Scripting languages use interpreters, not compilers, except for byte compilers which are significantly faster than c++/c compilers which I was talking about. (sorry for not making it clear enough ;)
Athlon_Jedi
Posts: 156
Joined: Wed Jul 21, 2004 4:29 am
Location: Mishawaka, In

Stackless Python

Post by Athlon_Jedi »

something we have been playing with is using stackless python as our scripting language. from what I understand stackless is a bit more effecent than standard python as it uses threads instead of the c stack.

not to mention games like WOW and Eve online use it to great extent so its already been proven a stable , production quality language.
Eternl Knight
Posts: 313
Joined: Tue Nov 01, 2005 5:01 am

Slight Clarification

Post by Eternl Knight »

Actually the efficiency of Stackless comes from the fact that it does not use THREADS for multi-tasking, but instead relies on co-operative multi-tasking (of which C stack switching is only a necessary part).

I too use Stackless & Richard Tew recently uploaded my example implementation to the Stackless SVN. The reason Stackless fits gaming better (in my opinion) is because it is possible to create a separate execution context ("tasklet") for all dynamic objects (i.e. enemy characters, rockets, elevators, etc) without having to create a dedicated "thread" (which uses too much OS resources).

Given certian conditions, it is also possible to "freeze" then game world & save it by pickling the tasklets and their objects to disc. Something I have been using in some simulation work I have been fiddling with.

--EK

P.S. I was unaware that WoW used Stackless... I was under the impression it used Lua. Can you give me a reference on this?
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

where have all these people gone to?

is anybody here still playing around with stackless python?
Image
torleif
Posts: 188
Joined: Mon Jun 30, 2008 4:53 am

Post by torleif »

I've had a bad experience with lua, the lack of documentation led to me manipulating the stack more than necessary to do the simplest task

Next time I have a shot at it, I'm definitely going with angle script.
full.metal.coder
Posts: 68
Joined: Sat May 10, 2008 11:30 am
Contact:

Post by full.metal.coder »

Playing around with Lua and SLB (Simple Lua Binder) which allows me to dynamically expose function and classes with a really straightforward syntax. All the binding is done at run-time with no need to rewrite your existing classes/methods (though if you want to use global functions you'll have to rely on lua stack but you can still create a dummy object for this). THe only drawback is the poor documentation of SLB but the examples provided are enough for my basic needs
bull
Posts: 36
Joined: Wed Sep 12, 2007 8:49 am
Location: s1Ng4p0R3

Post by bull »

I use GameMonkey because
-It has similar concept to Lua
-It has C++ syntax( if(){} instead of if then end)
-Easy to bind
-Source code written in C++ so it's simple to read and learn.
My name is bull, for we are many ...
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

In my engine I use Squirrel + SqPlus. It's quick and easy. Squirrel script has got similar structure to native C++ code. This is sample script:

Code: Select all

local Distance = Character.C1.getPosition() - Character.C12.getPosition();

if(Distance.getLength() < 70)
Character.C12.setVisible(0);
else
Character.C12.setVisible(1);
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply