Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

ctor arguments and JIT compiler


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
5 replies to this topic

#1 Lioirc   Members   -  Reputation: 142

Like
0Likes
Like

Posted 06 September 2004 - 12:22 PM

Hi I think the ability of passing arguments to the constructor wrapper class of the regeistered objects (class) is a good addition, that way we can register class factories. CObject* _objectCosntructor(int type, CObject* thisPointer) { return new(thisPointer) registeredObject(type); } i will try to modify the library in the next days (unless there is a specific limitation in the anglescript library to this ctor method), or if i dont have time, i will do it via a preprocesor , anyway, i let you know that passing arguments to constructors can be a good feature to add About the JIT compilation (to improve the execution speed), is there any study going on to implement JIT compilation to angelscript? Here are some links to JIT compilers for bytecode executed on VMs http://www.southern-storm.com.au/libjit.html "The libjit library implements Just-In-Time compilation functionality. Unlike other JIT's, this one is designed to be independent of any particular virtual machine bytecode format or language. The hope is that Free Software projects can get a leg-up on proprietry VM vendors by using this library rather than spending large amounts of time writing their own JIT from scratch" http://softwire.sourceforge.net/ "SoftWire is a run-time x86 assembler, written in C++. It can be used as a JIT compiler back-end for scripting languages, or for dynamic code generation of optimized inner loops." great library you have here (angelScript), im testing it right now, and so far its very good, (implementing in a game framework), but im a little concerned about the speed, im targeting at controlling the game runtime via scripts, so they will be executed every frame and for the game logic, not GUIS or simple functionality Lioric

Sponsor:

#2 Lioirc   Members   -  Reputation: 142

Like
0Likes
Like

Posted 06 September 2004 - 12:38 PM

Hi

i did a little more research and there are very confronted opinions about jit and bytecode copmpiled scripts

but here there is a scripting library that has as addon a jit compiler with source code

http://www.compuphase.com/small.htm

Lioric



#3 Andreas Jonsson   Moderators   -  Reputation: 3334

Like
0Likes
Like

Posted 06 September 2004 - 02:00 PM

Passing arguments in the constructor is indeed a useful feature, as is the copy constructor. I have plans for both of these, but haven't started working on either yet. If you should implement constructors with arguments it would be a great contribution to the library.

I have plans on allowing plugin JIT for AngelScript, but I haven't started studying how that should be implemented. I'm instead spending my time on implementing needed language features. Once the library has matured more I will start looking at JIT.

I already knew about SoftWire, but hadn't heard about libjit. Thanks for the tip.

I don't think you'll have any problems with the performance of the scripting language. Raptor Entertainment is using AngelScript for just about everything in their game and haven't complained about the speed yet. However, I was told in another thread that AngelScript is 2.3 times slower than Lua, so I've spend the last few days trying to improve the performance. I've already managed to improve it quite a lot, but I will do more. AngelScript has potential to be faster than Lua, since its interface with C++ is more direct (same datatypes, no wrapper functions, etc).

I'm very pleased to hear that you like AngelScript and I hope you'll continue to use AngelScript for your projects. I'm sure you will find that it improves very quickly.

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

#4 EddHead   Members   -  Reputation: 140

Like
0Likes
Like

Posted 06 September 2004 - 05:45 PM

We are using AS for AI descision making as well as of now, and I dont seem to have too much problems, the CPU cycles for AI and other AS calculations are about 0.01 Secs, which is okay by far, i guess we could use a bit more speed though.......

[Edited by - EddHead on September 7, 2004 12:45:01 AM]
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.

#5 Lioirc   Members   -  Reputation: 142

Like
0Likes
Like

Posted 07 September 2004 - 10:52 AM

Hi WitchLord,

Im happy to see that you will implement these features in the angelscript future

If modifying the library to pass arguments to constructors doent tak more than a day or a couple of days, i will do it , but if not (the project is a little overtime by now), i will go for the proprocessor way

parse the script for the object declaration:

CObject* _obj = new "sphere"; ( or CObject _obj(OBJECT_TYPE_SPHERE); )

add the object types to a deque of types in the order they are declarated
replace the script lines where the object are declarated with the object pointer declaration only (CObject* _obj;)
compile the script, and whe the registered constructor is called do construct the derived objects

CObject* _objectConstructor(CObject* thisPointer) {
ObjectType type = type_deque.front();
type_deque.pop_front();

return new(thisPointer) registeredObjectClass(type);
}

Im still concerned about the speed of the library (or to be fair with the speed of bytecode execution in general), i know that the new unreal engine uses bytecode scripts (probably a highly optimized compiler and vm).
But as my project is a game framework, the user will have control on the execution or what the game does, so the more speed i can give the end users, the less complains and messages to my tech support guys

I want to let you know that i really want to use your library, i have the angelscript homepage bookmarked for about 6 months by now, and finally the project is in the "implement scripting feature because its a good feature and because the competition has it and its very fast" stage, but overall because angelscript its very good coded and have good features, but i still have some scripting libraries left to try.

About the speed, i saw on the raptorentertaiment page some screenshots, and they report a very low fps, 10.40 in the frist screenshot i saw, and 17.some in the second, but im sure its because they are debug screenshots

best regards,

Lioric



#6 EddHead   Members   -  Reputation: 140

Like
0Likes
Like

Posted 07 September 2004 - 08:37 PM

You're right about the FPS, we had to take them on a DEBUG build, and since we just needed to show our art capabilities. right now we're getting over 50 fps average. as of AngelScript, the speed is pretty good, not seen any bottlenecks. i will come up with a full report so that we can all confirm when i have time.
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.




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