assemblyscript/README.md

2.1 KiB

AssemblyScript NEXT

Build Status

AssemblyScript is a new compiler targeting WebAssembly while utilizing TypeScript's syntax and node's vibrant ecosystem. Instead of requiring complex toolchains to set up, you can simply npm install it - or run it in a browser.

By compiling syntactially (not necessarily semantically) valid TypeScript to Binaryen IR, the resulting module can be validated, optimized, emitted in WebAssembly text or binary format and converted to asm.js as a polyfill.

Note, though, that this version of the compiler (0.5.0, NEXT) is relatively new and does not yet support some features a TypeScript programmer might expect, e.g., strings, arrays and classes.

See the AssemblyScript wiki for additional information and documentation.

Examples

A few early examples to get an idea:

Getting started

If you'd like to try it today or even plan to contribute, this is how you do it:

$> git clone https://github.com/AssemblyScript/next.git
$> cd next
$> npm install

Author your module using either

and run:

$> node bin/asc yourModule.ts

Building

Building an UMD bundle to dist/assemblyscript.js (does not bundle binaryen.js):

$> npm run build

Running the tests:

$> npm test