Advantages over Lua?

Started by
12 comments, last by WitchLord 18 years, 6 months ago
Hi There Ive been looking at your lib for a while now and Iam wondering if you could tell me what advantages Angel Code has over Lua, is it faster, does it use less memory etc. I currently use Lua in my engine but your lib seems to be a more elegant and cleaner system than Lua. Will I gain anything for the time it will take to change the engine and scripts over to Angel Code? Many thanks Chris
Advertisement
I hope someone reading this post can answer your question because I cannot. I have never used any other scripting library so I can't do any comparisons other than theoretical ones.

In either case I'll try to list a few of the advantages:

* AngelScript is strongly typed, which makes it faster when working with primitives. (This also depends on how optimized the VM is of course, but the potential limit is better for AngelScript).

* AngelScript uses mostly the same type as the host application, which makes for a much thinner interface between the script engine and host application, which in turn also makes the library potentially more effective.

* AngelScript is under heavy development, which gives you opportunities to affect its direction.

There are likely disadvantages as well of course. One is that AngelScript is much less mature than Lua, a lot of features aren't implemented yet, and some features may change with future versions or even be removed completely. I try not to have to remove features, but if I do it will be for the greater good of the library.

Lua also has a larger library of utilities, whereas AngelScript has next to nothing finished. The idea is that you should register the same utilities that you use in your C++ application, so you should have to use a lot of independent libraries.

My suggestion is that you give AngelScript a try, and see if you like it. Afterwards I would be interested in hearing your comparisons of the two.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Why did I choose angelscript ?

I have choosen AngelScript because of its easy integration in my programm with EXISTING class (no need to do anything except register my class to angelscript).

I have tried Lua before AngelScript and try the same integration using CtoLua utility (I do not remember the exact name of this utility).
The code that was generated was really big, ununderstood by me.
Then trying to use Lua language I discovered that it was a new language to learn that was unknow to endusers.

I'm using 1.10 version of angelscript because of pointer use that was abandonned in 2.x .

Also, as angelscript is very close to C++, I have recently discovered its great functionnality translating pure C++ to angelscript for test purpose (the inverse is also very usefull !)

Also, angelscript (1.10 from my own experience) is very stable and very fast. My application run 24/24 7/7 and never crash (every minute (or less), an angelscript script is run on this planet !)

The other advantage (and this is not a small one !) using this library is the support that is made by WitchLord.

AbrKen.
My experience with AngelScript is limited, but as far as I can tell it is a scripting language which is very similar to C/C++; more so than Lua. I'm not talking about things like braces, or ! for "not"... those things are mere syntax differences, and won't confuse any half-decent programmer. Lua's dynamic and (somewhat) weak typing and its extensive support for upvalues mark it as a language without much of a C pedigree, and someone who's never used languages other than C/C++/Java might have a difficult time harnessing its full power (users without programming experience will probably find it easy to learn). Also, AngelScript is built from the ground up to integrate easily with C++... Lua's integration system is simple and powerful, but can be extremely tedious to use.
I really like how easy it is to bind my code to AngelCode. There are excellent libraries for Lua, I have to admit that (for example luabind), but that's another layer in-between that can add complexity at times. A big plus compared to luabind for me is that the code is generally pretty understandable, which can't be said about all that template-magic in luabind (plus, compiling doesn't take hours for the same reason).

If you already have a game running, I am not sure if it would be worth it to change that now, but otherwise I have found that AngelCode has been giving me a lot less problems, most of the time it just works.
Thanks guys for those statements!

I'm especially pleased that you all seem to list advantages which are part of my original goals with AngelScript. :D

I'd very much like to hear more thoughts on the use of AngelScript. So if you're using AngelScript or have used it, please let me know what you think.

And should it be that you only have disadvantages to list you're welcome to post that too. At least that way I will know what I need to improve upon :)

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Angelscript is strongly typed? How could I miss this? It seems I finally found a good script language for my game

A disadvantage / advantage (depends) is that it is seriously too much like C++

It is good because it is powerful and great for c++ users, bad when you are targetting for games and would want players to use the script for maps or mods thus it would perhaps be one of their first languages

But strongly typed is a great feature, seriously cause when you develop on non typed script languages you often end being confused not knowing what the heck you are doing (or is it just me?)

Although a good solution would be creating a GUI in your game that generates the angelscript code for the player.
------ XYE - A new edition of the classic Kye
People often refer to the C++ syntax as being difficult to new comers. I really can't understand why. Sure if a new comer has to take a program written by an experienced C++ programmer it would be difficult to understand it. But using only the most simple language constructs, C++ is just as easy as any other language. We just use {} instead of 'begin' 'end', and = instead of :=, or whatever else the other languages look like.

Whatever syntax you choose, a new comer will need help to understand how things work. I mean, a new comer will not intuitively know that an if statement is written as if a = b then begin ... end, nor if( a == b ) { ... }.

Your suggestions about having a GUI generate much of the code for you is definitely a good way to help new comers. This could also be called a Wizard, much like how MSVC and other programming IDEs have.

In my opinion, strongly and weekly typed, both have their advantages and disadvantages. Strongly type is more effective since the VM doesn't have to dynamically determine the type at run time and do unecessary conversions in order to do calculations. AngelScript is also able to take advantage of this by passing the exact same type between scripts and the host application. Weekly typed is good because it simplifies features such as dictionaries, serializations, etc. In a future version of AngelScript I hope to be able to implement a true variant type, which will allow weekly typed programming to be used as well.

Keep the comments coming. I'm taking these as inspirations to make AngelScript even better in the future.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Well the thing over c++ syntax is that it doesn't have certain candy other languages may have.

But once you get used to it , you preffer c like syntax. It is a good approach cause php and java also have this kind of syntax so for c++, c, php and java guys learning it is not a big trouble


while we are at suggestion stance, could we please get a lib/project file for Borland C++ builder?
------ XYE - A new edition of the classic Kye
True, some other languages have language constructs that C++ doesn't have and that can simplify things. Yet, this is true for most languages, all have their advantages and disadvantages.

I'm opening a new thread about the Borland Compiler. Please go here if you wish to continue that discussion: Borland thread

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement