mtasc
Download
Skip this Video
Download Presentation
MTASC

Loading in 2 Seconds...

play fullscreen
1 / 20

MTASC - PowerPoint PPT Presentation


  • 267 Views
  • Uploaded on

Nicolas Cannasse. MTASC. No more Coffee Break while compiling. M otion- T win A ction S cript C ompiler. Rich Internet Applications – RIA . AJAX Dynamic HTML, RAD, Browser Integration Flash Vector Engine, LowLevel, better control, more powerful. MTASC.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'MTASC' - Roberta


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
mtasc

Nicolas Cannasse

MTASC

No more Coffee Break while compiling

Motion-Twin ActionScript Compiler

rich internet applications ria
Rich Internet Applications – RIA
  • AJAXDynamic HTML, RAD, Browser Integration
  • FlashVector Engine, LowLevel, better control, more powerful
mtasc3
MTASC
  • Is an ActionScript version 2 compiler
  • Works from CommandLine
    • Can be integrated in « your favorite IDE  »
  • Is not an IDE :
    • Can’t edit Flash Graphics or Code
  • Is OpenSource
    • GPL License, MotionTwin offering support
the history of mtasc
The History of MTASC
  • Prehistory : ActionScript 1
  • MiddleAge : 09/2003 FlashMX2004 ActionScript2
  • Need More Checks : 12/2003 ASML
  • Need More Types : 04/2004 MotionTypes
  • Back to AS2 : 10/2004 MTASC Beta 1 01/2005 MTASC 1.0 05/2005 FAME Platform / OSFlash.org 07/2005 MTASC 1.09
asml actionscriptmetalanguage
ASML : ActionScriptMetaLanguage
  • December 2003
  • Run before Macromedia Compiler
  • Add « Type Inference » to AS2
  • Check number of parameters (no optional parameters)
  • Faster compilation process
type inference
Type Inference
  • To « Guess » the types at compilation time

function length(o) {

return Math.sqrt(o.x*o.x + o.y*o.y);

}

type inference7
Type Inference
  • To « Guess » the types at compilation time

function length(o : Tmp) : Number {

return Math.sqrt(o.x*o.x + o.y*o.y);

}

Tmp {

var x : Number;

var y : Number;

}

type inference8
Type Inference
  • Pros :
    • Do not write Types
    • Your program is still checked
    • Changes propagate everywhere
  • Cons :
    • You need to understand how it works
    • Error reporting is difficult
    • Typing order matters
motiontypes
MotionTypes
  • April 2004
  • More Types need more Syntax
  • Different Language ( .mt files )
  • Anonymous Types :var o : { x : Number, y : Number };
  • Lambda Types :var onConnect : Boolean -> Void;
  • First AS1 generation, then SWF generation
mtasc10
MTASC
  • Back to AS2 : compatibility
  • Improves Macromedia Compiler :
    • Faster
    • More strict
  • Use SWF generation developed for MotionTypes
  • Ready for RIA :
    • V2 Components
    • ActionStep
mtasc internals
MTASC Internals
  • Bunch of AS text files
  • Lexing : produce tokens
  • Parsing : build AST
  • Typing : type-check the AST
  • SWF Code-Generation
  • MTASC is Written in OCAML (www.ocaml.org)
flash bytecode
Flash Bytecode

function add

x : reg0

y : reg1

push reg0

push reg1

add

ret

function add(x,y) {

return x + y;

}

Stack-based Virtual Machine.

Registers for local variables (since Flash7).

flash bytecode13
Flash Bytecode

function max

x : reg0

y : reg1

push reg0

push reg1

lt

condjump +2

push reg1

ret

push reg0

ret

function max(x,y) {

if( x < y )

return y;

else

return x;

}

Conditional Jumps

from as2 to as1
From AS2 to AS1

if( !Ref ) {

_global.Ref = function(r) {

this.r = r;

}

Ref.prototype.add = function(p) {

this.r = this.r + p.r;

}

}

class Ref {

var v : Number;

function Ref(v) {

this.v = v;

}

function add(r : Ref) {

r += p.r;

}

}

AS2 is Class-based AS1 is Prototype-based

from as1 to swf
From AS1 to SWF

push ‘Ref’

eval

not

compjump +XXX

push ‘_global’

eval

push ‘Ref’

function (r:r1) this:r0

push r0

push ‘r’

push r1

objset

objset

. . . .

if( !Ref ) {

_global.Ref = function(r) {

this.r = r;

}

Ref.prototype.add = function(p) {

this.r = this.r + p.r;

}

}

mtasc in numbers
MTASC in Numbers
  • MTASC sources (without libs) are :
    • 8 files
    • 113 Ko
    • 20’000 words
    • 4’000 lines
  • It takes 3-4 seconds for compiling more than 300 Classes (20-30 seconds with Macromedia Compiler)
the fames platform
The FAMES Platform

A complete OpenSource platform :

  • Flashout : SWF Preview, Log
  • ASDT : AS2 Dev. Eclipse plugin
  • MTASC : AS2 Compiler
  • Eclipse : IDE
  • SwfMill : Resources (Fonts, JPEG,…)
the fames platform18
The FAMES Platform

A complete OpenSource platform :

  • Open Source IDE and Tools
  • Edit / Compile / Test
  • Ready for RIA dev
    • Using Macromedia V2 Components (need license)
    • Using OS Components
  • More complete everyday
    • See http://osflash.org
flash opensource tools
Flash OpenSource Tools
  • A lot of tools Available on OSFlash.org
  • General Purpose
    • AS2Lib, ASUnit…
  • UI Frameworks
    • ActionStep, EnFlash, ARP, AsWing…
  • Debug/Log
    • AdminTool
  • Protocols
    • AMFPHP, OpenAMF…
  • Tutorials, tips, …
ad