Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

Pointers in AngelScript: Really necessary?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
33 replies to this topic

#21 kaysik   Members   -  Reputation: 382

Like
0Likes
Like

Posted 27 October 2004 - 01:58 PM

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

Sponsor:

#22 abrken   Members   -  Reputation: 130

Like
0Likes
Like

Posted 28 October 2004 - 12:07 AM

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

#23 Andreas Jonsson   Moderators   -  Reputation: 3240

Like
0Likes
Like

Posted 28 October 2004 - 03:44 AM

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

#24 Lioirc   Members   -  Reputation: 142

Like
0Likes
Like

Posted 28 October 2004 - 10:44 AM

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




#25 kaysik   Members   -  Reputation: 382

Like
0Likes
Like

Posted 28 October 2004 - 03:34 PM

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

#26 abrken   Members   -  Reputation: 130

Like
0Likes
Like

Posted 28 October 2004 - 06:18 PM

Don't worry about my opinion, it's just mine.

Change your lib as you want.




#27 Andreas Jonsson   Moderators   -  Reputation: 3240

Like
0Likes
Like

Posted 29 October 2004 - 04:15 AM

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

#28 Mortal   Members   -  Reputation: 132

Like
0Likes
Like

Posted 30 October 2004 - 08:57 PM

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.

#29 Wuntvor   Members   -  Reputation: 170

Like
0Likes
Like

Posted 30 October 2004 - 11:54 PM

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.

#30 desertcube   Members   -  Reputation: 514

Like
0Likes
Like

Posted 31 October 2004 - 12:20 AM

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.

#31 Andreas Jonsson   Moderators   -  Reputation: 3240

Like
0Likes
Like

Posted 31 October 2004 - 01:25 AM

Mortal:

AngelScript 2 will work with object basically the same way as Java does. There will be a slight performance hit because of this, but it should be negligable in the context of a scripting language. The language syntax will be simpler though, and much more consistent. And of course it will be easier for me to develop further features.

Wuntvor:

AngelScript 2's object variables will basically be smart pointers. The . operator will access the objects methods directly. I'm not sure if the -> will be implemented, probably not.

I may implement the possibility to overload -> for AngelScript 1.x.x though. That should allow you to implement smart pointers.

desertcube:

I agree.


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

#32 Deyja   Members   -  Reputation: 920

Like
0Likes
Like

Posted 01 November 2004 - 11:07 AM

I'm using handle classes exstensivly. Though I don't technically need an operator->, it would simplify a lot of things in my scripts. The handles manage pointers. They are essentially reference counted smart pointers that make calls directly into the engine to manage game resources. Right now, I pass them to global functions. It is, unfortunatly, quite possible to pass a texture to a function that expects a sound. With operator->, I could register the texture class, and all the functions that use it as methods, and continue using my handles - except with type safety! (Assuming, of course, polymorphism works in some future release.)

#33 Gyrbo   Members   -  Reputation: 187

Like
0Likes
Like

Posted 01 November 2004 - 10:05 PM

I would also like the -> operator to remain, but only as an overloaded operator. I don't really need it, but it provides a nicer syntax.

#34 Andreas Jonsson   Moderators   -  Reputation: 3240

Like
0Likes
Like

Posted 02 November 2004 - 01:50 AM

Your wishes has been granted: The overloadable -> operator is on the todo list for AngelScript 1.x.x. [smile]


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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS