Pointers in AngelScript: Really necessary?

Started by
32 comments, last by WitchLord 19 years, 5 months ago
Quote:Original post by jetro
Pointers and syntax stuff related to them are hard to understand for beginning/novice coders. Because of this I'd also like the '->' operator go away and have just '.' instead - it works pretty well with Java already. :)


If I'm not mistaken then when pointers are removed you can simple use the '.' operator as normal with your Obj_ptr class instead of overloading the '->' operator which will give you exactly what your after while letting anyone who wants it, access to the '->' operator.

but i could be wrong :P
Advertisement
Quote:Original post by jetro
Pointers and syntax stuff related to them are hard to understand for beginning/novice coders. Because of this I'd also like the '->' operator go away and have just '.' instead - it works pretty well with Java already. :)


That's why in my application when the user type '.' it is automaticaly changed to '->' if needed.

To express myself on this subject more than with a angry face, this is my full point of view, and why it make me "monter la moutarde aux nez quand je lis ce genre de truc" sorry I cant translate.

Why did I choose AS :
I have tried LUA with ToLUA++. The integration of LUA in my project was pretty easy. Everything was working well when there come time to make script. The LUA language make me search for another scripting library that was much "natural" to write script with.
I have integrated the VBScript engine in another project, and definitively this was not the solution, or I had to write COM handler for all the classes I wanted to insert into VBScript.
So, as I was looking for AS for longtime ago, I have decided to give it a try.
The integration of AS was pretty easy, and script was also easy to write. So I have choosed it (from 1.8.x).

Then time passed, and AS has become to change.
The library has changed the include path to angelscript.h . Of course this is not a pb, but with a source controled project this is not good. So now every time I want to integrate a new version, I have to change the include of as_xxxxx files that point to the new path.
This is not a pb ...

Time has passed and I have integrated AS in a much closer way than more of AS user has did (I think). I have make my own asIScriptEngine derived class to be able to process registered func/var/class/method that let the script write get tool tips that help to write script with syntax hilight and other feature.
The library then has change the asISScriptEngine interface !

Nowaday, I've got a fully working application, with lot of script using it and it's about to change a CORE functionnality !

Quote:Original post by Desdemona
I have the unfortunate feeling that the change will wrack with my current game since it is so dependant on AS. I am using 1.9.2 and am almost finished with my engine. Everything is working perfectly so I have not had any intentions of upgrading, but I'd probebly take a stab at it for simpler syntax.


This resume perfectly my feeling.

No library is perfect. This is a fact !

AbrKen
abrken:

well, I'm aware that removing the pointers will break some existing functionality. But I don't think it will break that much.

In fact, without the pointers in the scripting language, your application could be simplified as well, can't it?

If you wanted a stable library for your project then I'm afraid AngelScript wasn't the right choice.

---------

Well, in either case. I've decided to not remove the pointers for AngelScript 1.10.0. Though the future is still unsure.

I'm still trying to decide on how to go on from this. I may even start a derivative project, that will take all that is good in AngelScript and remove the bad stuff. I would also make all objects work with references like Java. This will simplify doing context serialization, and also make it easier to introduce classes declared in the script language.

Maybe I'll start on AngelScript 2, for this. I could keep supporting AngelScript 1.10.0 with bug fixes and minor improvements. After all, AngelScript 1.10.0 will be a complete scripting language with almost everything except script defined structures or classes.

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

Hi WitchLord

Im using AS with tons of pointers functionality (but as you know, a very modified AS 1.8.2b1 version as well, so im not using the as a lib but more like an engine integrated directly in my project), but here we need to look for what is best for the library future, so i know that changing how pointers are handled will make the library better/easy for new features to implement. So pointers need to be changed, and what you are saying is a good way of handle them in a script (im a little worried about the perfomance, well you know me :) )

Most of the users of a script library will use it for giving his application the ability of be modified/improved by final users, and here is where pointers are a bit of a problem, as new users or non-technical users can have problems

I dont know why there are complaints about changing pointers, if what is going to change is mostly the interface, not the CORE, and if this change will benefit the library as well the end users/script writters, this is a good direction to go, because at the end, this (end users) will be the factor that make our projects a success

Changing them in AS 1 or implementing in a new AS 2, either way, but its some that have to be done

Best Regards,

Lioric


I'd hate to see you keep supporting something thats holding the library back - people don't have to updated if you remove a feature they really like or they can write their own scripting engine. I'm not trying to make your remove points, just don't like to see good ideas goto waste. Rewriting a bit of code to accomodate new changes to AS seems like a small price to pay for such a sweet scripting lib to me. I doubt I'll ever vote against something that would improve the lib even if it meant a rewrite to my own code. It is your lib though so you have the final word but most people in this thread voted to drop pointers:

Drop - myself, Lioirc, jetro, desertcube, Desdemona, MichaelT, zola, Deyja
Keep - abrken

With a few people such as Aggrav8d and LogicalError not espressing an strong oppinion either way. I do understand your concerns for backwards compatability, and I see abrken's point but sometimes improving things is worth the effort. Still I like the idea of AS2 - it sounds cool :D
Don't worry about my opinion, it's just mine.

Change your lib as you want.


Thanks everyone for giving your opinions. I've made my decisions:

1. AngelScript 1.10.0 will be released with full support for arrays and still keep pointers around.

2. After that I will start working on AngelScript 2.0.0 that will take lot of inspiration from Java and get rid of pointers and make all objects be passed around by references. This will make the treatment of objects more uniform, which will make it much easier for me to introduce script declared classes and context state serialization, etc.

3. Further development of features will go under the 2.x.x versions, but I will keep supporting version 1.x.x with bug fixes and perhaps a few minor changes to make it easier to use (mainly an improved interface for calling script functions).

It's not possible to please everyone, but I try to do my best. I'm pleased to know that the majority agree with my decision. I know that Abrken may be a bit sad to see the pointers go, but I hope that he will in the future move over to AngelScript 2.x.x as well.

I didn't see any word from EddHead (Raptor Entertainment) but he is still using version 1.7.1 so I'm sure whatever I decide the work to upgrade would be quite big anyway.

Once more: Thanks everyone.

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

I've been following AngelScript for awhile now, and have been taking some Java classes recently. While I hate Java as a language, I think it would be awesome to see the way they handle Objects in AngelScript. And anything that can speed up the library is always a plus.
Would it be possible to integrate smart pointers into this? It would remove the need to have raw pointers, what I'd like to have is the possibillity to just use it like Class->Method when Class is actually a smart pointer.
I am not sure if this would still allow you to simplify AS as a whole, but if it was, this would be nice. Shouldn't be too hard either, basically there'd just need to be some way to register a function for the script engine that would allow it to retrieve the actual class on which it would then execute the method.
Quote:Original post by Wuntvor
Would it be possible to integrate smart pointers into this? It would remove the need to have raw pointers, what I'd like to have is the possibillity to just use it like Class->Method when Class is actually a smart pointer.


Personally, I think if you're going to remove pointers from the script, you should also remove the operator->. This would simplify the the syntax of the language, as it can only be used with pointers (since I belive AS doen't allow you to overload operator-> in your classes.)

Just my thoughts on the matter though.

This topic is closed to new replies.

Advertisement