I totally agree that trying bytecode for tests is essential. A lot of things
in swf output are upside down with what you would expect in regards to
speed.

At Xamlon our output was 100% arrays (no text other than in strings). So all
class/method tables were arrays, all locals, etc. (this was coming from C#).
This was really fast, and allowed pretty well all featrues of statically
typed languages to be implemented fairly easily (overloading, ctor
overloads, type checking, safe casting, static ctors, override chains etc).
It has been a while, but it seems to me arrays were much faster if they
didn't have gaps (otherwise it seemed to fall back to hashing).

But you really do need to test.

The nail in the coffin for AS to be is that it is dynamic. For scaling,
dynamic languages are a complete waste of time, and the average size of a
Flash project bears this out. As it gets bigger, it gets harder, and static
languages don't. 

Cheers,
Robin

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Nicolas Cannasse
Sent: Tuesday, September 11, 2007 3:57 AM
To: Open Source Flash Mailing List
Subject: Re: [osflash] Anybody interest in developing a new compiler?

>> if you try to access index 11 in array n, an IndexOutOfBounds 
>> Exception is thrown. Same for C#, Objective C and obviously C. This 
>> is fundamental and basic to all professional languages and 
>> Actionscript 3 doesn't have it? Why? Who knows but it's not there.
> 
> But a compiler could optinally create code for array bounds check, if 
> the language allows defining the array size.
> I see that getMember is a slow operation, however on more dimensional 
> arrays we lay them out as a flat array and use mulitiplacation to 
> access array elements.

That would be even slower. You should consider experimenting first with
hxASM (http://haxe.org/hxasm) to manipulate the Flash9 AVM2 bytecode and do
some timing of different operations.

Compared to lowlevel languages compilers such as C, there is little room for
performances improvement in AVM2. There is in fact only a few good ways to
generate bytecode from a given implementation.

The way to get better performances is then through high level language
features support that permits the compiler to optimize things aggressively
by using the most appropriate lowlevel implementation.

This way you all the benefits at the same time : programs are faster to
write, easier to maintain, and runs faster. The only requirement is to learn
to use these highlevel constructs.

Nicolas

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org


_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to