Jump to content

  • Log In with Google      Sign In   
  • Create Account

Andreas Jonsson

Member Since 26 Mar 2000
Offline Last Active Today, 08:25 AM

Topics I've Started

AngelScript 2.31.0 is finally out

26 February 2016 - 07:38 PM

Wow, it's been 6 long months since the last release. Never before during the 13 years that I've been working on AngelScript has it been this far between two releases. 
 
Naturally, with such a long period, the number of changes that have been made are also larger than anytime before. As this is a major release, there is also interface breaking changes. Not to worry though the changes are for the better, and I'm certain that it shouldn't take much work for users to upgrade to the new version. 
 
The most significant change to the interface is that the asIObjectType has been removed. Instead the new asITypeInfo has been introduced. asITypeInfo has all the methods that asIObjectType had before to inspect object types, and it also has new methods to inspect enums, typedefs, and funcdefs. With this change I've unified the way that type information can be handled by the application, which I hope should be welcome change.
 
Of course, some methods on the other interfaces, e.g. asIScriptEngine, asIScriptContext, asIScriptModule, etc, have been changed to reflect the move from asIObjectType to asITypeInfo, but developers ought to feel right at home with the changes.
 
These changes to the application interface has also triggered a rather extensive refactoring of the code within the library, so that was another reason for the long period since the last release.
 
Some other enhancements that also made it in to this release are:
  • support for storing an auxiliary pointer with functions registered using asCALL_GENERIC
  • included engine property asEP_ALLOW_UNICODE_IDENTIFIERS for those who do not like the restriction of using only English alphabet in the scripts
  • funcdefs can now be registered/declared as members of classes
  • included a simple datetime script add-on for telling the time
  • added a method getInput in asrun to allow it to take input from the user
I never intended to make AngelScript a stand-alone scripting language, but I've been adding some functionality to the asrun sample every once in a while, and it is has now reached a stage where it can actually be used to script some tasks that I would normally use other script languages for. For example, I now use asrun to prepare the SDK package for the release. It actually feels quite cool to see this work out so well despite it not being the intended use for the library.
 
Regards,
Andreas

AngelScript 2.30.2 is out

30 August 2015 - 12:07 PM

With this version I've spent most of the time on optimizations. Specifically the time for loading pre-compiled byte code has improved significantly for applications that exposes a large interface to the scripts. There are some run-time optimizations too, but those are probably only noticeable in very specific cases.

 

Besides the optimizations I've implemented support for anonymous functions, a.k.a. lambdas, in the script language. The anonymous functions are so far just global functions declared locally in the expression that needs them, but I'll continue to expand on the usefulness of them for future releases.

 

Regards,

Andreas


AngelScript WIP - anonymous functions

28 July 2015 - 07:04 PM

I've added support for anonymous functions in the latest revision (2202) of the AngelScript WIP.

 

The syntax for using anonymous functions look like this:

 

void main()
{
   // Passing an anonymous function to a function expecting a function pointer
   DoSomethingWithACallback(function(a,b) {return a+b});
 
   // Store a pointer to an anonymous function for later use
   callback @cb = function(a,b) {return a*b;}
}
 
// The anonymous function will take on the signature that is expected by the target
funcdef int callback(int, int);
int DoSomethingACallback(callback @cb)
{
   return cb(1, 2);
}

 

Let me know your thoughts, and if you find any problem with this new feature please let me know so I can have it fixed before I make the official release.

 

Observe, the anonymous functions cannot be used as closures yet. That will have to wait for future time (if ever) as it would require a lot more changes in the compiler.

 

 

 

Regards,

Andreas

 


AngelScript 2.30.1 is out

03 July 2015 - 07:24 PM

In this new version I had the fortune to get my hands on a MIPS Creator CI20 board, thanks to Alexandru Voica from Imagination Technologies, so I spent some time on adding support for native calling conventions for MIPS processors on Linux and Android.

 

Adding support for the native calling conventions on Linux was easy enough, since I had already done similar work with ARM, and AngelScript already had support for MIPS on PSP. The ABI used by Linux (MIPS O32) is different than what is used by PSP (MIPS N32) so I still had to do a fair bit of reverse engineering of the ABI by reading assembler code and figure out how values are passed in and out of functions, but the original implementation by Manu Evans for PSP back in 2006 still helped a lot.

 

The Android support took more time. Not because of the ABI itself, which turned out to be identical to Linux, but because I had never worked with Android myself before. But, I decided it was time to sit down and learn the tools, so I went ahead and installed Android Studio, and Android NDK. It took some time to figure out how it works, but I managed to get the regression test suite to compile and upload it to the CI20. I didn't manage to figure out how to debug the native code on Android, but luckily I didn't have to as the ABI worked perfectly so it was mostly a matter of figuring out how to setup the configurations in as_config.h.

 

It's been fun learning about Android. I'm still a newbie in this world, but perhaps sometime in the future I'll start writing apps for Android too.

 

Of course, support for native calling conventions on MIPS is not the only improvement with this version. I've made some optimizations, especially scripts that do a lot of array access operations should hopefully notice a boost in performance. Loading pre-compiled byte-code should also be a lot faster, especially on mobile devices that don't have so much raw computing power.

 

dkrusu contributed a small language enhancement: for-loops can now have multiple increment expressions separated by commas.

 

Other than that, there is the usual load of bug fixes and minor improvements throughout. Refer to the changelist for the details.

 

Regards,

Andreas


AngelScript 2.30.0 is here

22 February 2015 - 09:58 AM

It's been almost exactly 4 months since the last release. This is longest period I've gone without making a new release since this project started back in 2003. This does not mean that development has slowed down though, I merely restrained myself from releasing the code so I could fit more improvements into it. If you take a peek at the change log you'll see that this is by far the largest update too.

 

As always, when I change the middle version number there are some changes in the interface. The changes are not dramatic, but might require some minor code changes. The most dramatic change in the interface is the removal of the behaviours asBEHAVE_REF_CAST and asBEHAVE_VALUE_CAST (+implicit versions). These behaviours should now be registered as object methods with the names opCast and opConv, respectively. The implementation of the functions in the application doesn't change, just how they are registered with the engine.

 

I've improved the internal memory management so that less objects will be placed in the garbage collector. This translates into improved performance as less CPU will be required to clean up the dead objects in the GC. The change will perhaps not be too noticeable at runtime, but during recompilation of scripts and engine shutdown you should definitely see a significant improvement.

 

The script language has gotten some improvements too. The ternary condition operator can now be used as lvalue (as long as both options are lvalues of the same type). Script classes can implement the opCast and opConv operator overloads. Compound assignments can now be used with virtual properties too. Class members can be declared as protected, with the same meaning as in other languages.

 

There are of course enhancements in the add-ons too, but I'll leave the discovery of those to the reader.

 

Regards,

Andreas


PARTNERS