tschneidereit at gmail.com
Wed Jun 22 19:10:02 CEST 2005
> What kind of optimizations are you thinking about ?
> Flash is inherently difficult to optimize because very dynamic, so every
> change in code structure might break something somewhere else.
One thing I'd like is some sort of -nondynamic mode, where MTASC doesn't allow the following features of AS:
- dynamic classes
- dynamic access through myObject["myMember"]. This might be ok if casted to the desired type: myVar:MyType = MyType(myObject["myMember"])
- eval. Might also be ok if the result is casted.
and maybe even forces the developer to cast to the desired type when accessing Arrays, though that might not be necessary.
As I see it, this would have the following advantages:
- forces a cleaner style, that doesn't leave as much space for bugs.
- would allow for a much higher amount of bytecode optimizations like inlining of static functions and variables.
- is still 100% compatible with MMC.
The only possible problem I can see is with using the code from external swf's that expect a certain structure, but this only means that it's not wise to use this compilation mode when developing binary libraries to be used by other projects.
As far as I can tell, the community as a whole is moving into the direction of using a more conventional, i.e. Java or C# style, approach to developing AS projects anyway, so this might be a good time to reap the benefits this enables.
More information about the mtasc