Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


- - - - -

AngelScript 2.28.2 is out


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

#1 Andreas Jonsson   Moderators   -  Reputation: 3417

Like
5Likes
Like

Posted 18 March 2014 - 07:13 PM

My primary goal with this version was to implement the grid add-on, which basically a 2D array with rectangular dimension. Multi-dimensional were already supported in the script language as arrays-of-arrays, but this would often become cumbersome to work with when a rectangular area was wanted as each subarray had to be resized individually. Accessing elements in arrays-of-arrays is also not particularly efficient as there is a lot of overhead.

 

In order to properly support the grid add-on (and any other multi-dimensional array implementation that developers imagine) the library was enhanced to allow multiple arguments in the opIndex overload, and the list pattern declaration gained a new keyword 'repeat_same' to tell the compiler that all sub-lists should be of the same size.

The grid add-on itself is currently quite basic with very little functionality besides setting up a 2D area and allowing the script to access the elements, but it serves it's main purpose of showing developers how multi-dimensional arrays can be implemented. Ideas for how to make it a truly useful add-on are most welcome.

 

Other enhancements in this version that are worth mentioning include; added support for opCall operator to allow the implementation of functor objects in scripts, implemented support for anonymous objects initialized with lists, improved compiler rules for implicit casts in expressions, reduced size of saved bytecode, more efficient bytecode sequences.

 

Some other add-ons have also received improvements. The array add-on now supports custom memory routines (a side effect of this, is that when instantiated from C++ it is now necessary to use factory functions instead of allocating with new). The dictionary add-on has received enhancements to improve interaction from the C++ side with a method to retrieve the type id of a stored value, and an iterator with support for C++11 range-for loops. The math add-on also has a new function closeTo() that should be used to compare floats or doubles when one wants to do approximate comparisons to handle numerical impression in float and double calculations.

 

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

Sponsor:

#2 Jake Albano   Members   -  Reputation: 647

Like
0Likes
Like

Posted 21 March 2014 - 10:46 AM

Anonymous objects? Is that anything like in C#?

 

var obj = {
    str = "a string",
   num = 100
};


#3 Andreas Jonsson   Moderators   -  Reputation: 3417

Like
0Likes
Like

Posted 21 March 2014 - 04:00 PM

It's something like this:

 

void main()
{
  doSomethingWithArray( array<int> = {1,2,3,4,5,6} );
  doSomethingWithDictionary( dictionary = {{'apple', 1}, {'banana', 2}, {'orange', 3}} );
}

 

It's no longer necessary to first declare and initialize a variable, in order to use it in an expression.


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 Jake Albano   Members   -  Reputation: 647

Like
0Likes
Like

Posted 22 March 2014 - 09:21 PM

Ah, very nice!



#5 gjl   Members   -  Reputation: 208

Like
0Likes
Like

Posted 28 March 2014 - 04:16 AM

Great! Thanks for the opCall addition. Haven't had time to check it out yet (still running my patched 2.28!)



#6 gjl   Members   -  Reputation: 208

Like
0Likes
Like

Posted 28 March 2014 - 04:18 AM

By the way, is there any change in the bytecode that would require a new version of the JIT that worked with 2.28.0?



#7 Andreas Jonsson   Moderators   -  Reputation: 3417

Like
0Likes
Like

Posted 28 March 2014 - 11:12 AM

There shouldn't be any changes in this version that break the compatibility with the JIT compiler from BlindMind studios. Though, I can't make any guarantees on that as I don't use the JIT compiler myself.


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

#8 gjl   Members   -  Reputation: 208

Like
0Likes
Like

Posted 28 March 2014 - 11:17 AM

Thanks. The fact that there are new bytecode instructions  in 2.28.1 does not impact existing JIT compilers? (I am not sure how JITs and angelscript handle this)



#9 ThyReaper   Members   -  Reputation: 487

Like
0Likes
Like

Posted 28 March 2014 - 11:49 AM

Our JIT falls back to Angelscript execution if it doesn't know a specific bytecode, so it will keep working as long as no existing bytecodes were changed. This can cause a performance hit.



#10 gjl   Members   -  Reputation: 208

Like
0Likes
Like

Posted 31 March 2014 - 02:48 AM

ok, that's really cool, and well designed! Thanks :-)






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