website icon indicating copy to clipboard operation
website copied to clipboard

AS3 and Actionsctipt Virtual Machine

Open Alan12312020 opened this issue 5 years ago • 3 comments

Huge volume of games written in Actionscript 3, please include this language

Alan12312020 avatar Dec 19 '20 17:12 Alan12312020

Where do you think it should be mentioned on the website? AS 3 is a different technology and not really related to WebAssembly, but maybe I'm missing something?

chicoxyzzy avatar Feb 18 '21 09:02 chicoxyzzy

The target of AS3 compilation was a (partly) statically typed, ahead-of-time verified, ahead-of-time jitted, compact bytecode for the AVM2 virtual machine, which ran in web browsers. I dunno, "different"? The spec should be the top hit if you google "avm2 specification". The AVM2 was not great at executing JS-style code (and had other problems) but did very well when presented with typed code, which AS3 accomodated. Large web applications - larger than those really accomodated by JS at the time - were built using AS3 and the Flex toolkit.

We'd have to ask @kripken about the origins of emscripten to be sure, but one project at Adobe in the AVM2 era was Alchemy, which compiled C++ to well-typed AVM2 code to allow it to run with good performance on the web, see eg https://en.wikipedia.org/wiki/CrossBridge. It's somewhat plausible that this was an inspiration for what later became emscripten, then asm.js, and then wasm.

lars-t-hansen avatar Feb 19 '21 09:02 lars-t-hansen

@lars-t-hansen It existed before, but it wasn't an inspiration for Emscripten as it happens. It could have been though, had I known about it...

Yes, there were big similarities. I was definitely aware of Alchemy by 2012 when I gave part of a GDC Online talk about Emscripten. I remember we compared to Alchemy there. That might have been the height of Alchemy's popularity, I remember they gave a talk about it at the same event (I still have some swag they handed out actually). And yeah, like Emscripten and later asm.js and wasm, Alchemy allowed compiled C++ (or really LLVM IR) to be run on a VM that wasn't originally intended for it, and at the time Flash was in almost all browsers so it was an effective way to reach users (but not free - they charged 9% of revenue IIRC).

(Emscripten's inspiration FWIW was basically "let's see if I can translate LLVM IR into JavaScript so I can run my game engine on the Web".)

kripken avatar Feb 19 '21 17:02 kripken