|
5 | 5 |
|
6 | 6 | **AssemblyScript** compiles a strict subset of [TypeScript](http://www.typescriptlang.org) (basically JavaScript with types) to [WebAssembly](http://webassembly.org) using [Binaryen](https://github.com/WebAssembly/binaryen). It generates lean and mean WebAssembly modules while being just an `npm install` away.
|
7 | 7 |
|
8 |
| -Try it out in [WebAssembly Studio](https://webassembly.studio)! |
| 8 | +Check out the [documentation](https://docs.assemblyscript.org) or try it out in [WebAssembly Studio](https://webassembly.studio)! |
9 | 9 |
|
10 | 10 | ---
|
11 | 11 |
|
@@ -43,60 +43,20 @@ Motivation
|
43 | 43 |
|
44 | 44 | > I do think [compiling TypeScript into WASM] is tremendously useful. It allows JavaScript developers to create WASM modules without having to learn C. – Colin Eberhardt, [Exploring different approaches to building WebAssembly modules](http://blog.scottlogic.com/2017/10/17/wasm-mandelbrot.html) (Oct 17, 2017)
|
45 | 45 |
|
46 |
| -Getting started |
47 |
| ---------------- |
| 46 | +Instructions |
| 47 | +------------ |
48 | 48 |
|
49 |
| -All the details are provided in the [AssemblyScript wiki](https://github.com/AssemblyScript/assemblyscript/wiki) - make sure to pay it a visit. With that being said, the easiest way to get started with AssemblyScript is to point npm at the GitHub repository (for now) |
50 |
| - |
51 |
| -``` |
52 |
| -$> npm install --save-dev AssemblyScript/assemblyscript |
53 |
| -``` |
54 |
| - |
55 |
| -followed by [scaffolding](https://github.com/AssemblyScript/assemblyscript/wiki/Using-the-CLI#scaffolding-with-asinit) a new project including the necessary configuration files, for example in the current directory: |
56 |
| - |
57 |
| -``` |
58 |
| -$> npx asinit . |
59 |
| -``` |
60 |
| - |
61 |
| -Once the project is set up, it's just a matter of using your existing [TypeScript tooling](https://code.visualstudio.com) while coding, and [using the CLI](https://github.com/AssemblyScript/assemblyscript/wiki/Using-the-CLI) to build to WebAssembly, either manually, or using (and maybe modifying) the generated build task in the generated `package.json`: |
62 |
| - |
63 |
| -``` |
64 |
| -$> npm run asbuild |
65 |
| -``` |
66 |
| - |
67 |
| -The CLI API can also [be used programmatically](./cli). |
68 |
| - |
69 |
| -If you rather prefer an installation suitable for development, pretty much the same can be achieved by cloning the GitHub repository instead: |
| 49 | +For general usage instructions, please refer to the [documentation])(https://docs.assemblyscript.org) instead. The following sets up a *development environment* of the compiler, for example if you plan to make a pull request: |
70 | 50 |
|
71 | 51 | ```
|
72 | 52 | $> git clone https://github.com/AssemblyScript/assemblyscript.git
|
73 | 53 | $> cd assemblyscript
|
74 | 54 | $> npm install
|
75 | 55 | $> npm link
|
| 56 | +$> npm clean |
76 | 57 | ```
|
77 | 58 |
|
78 |
| -**Note** that a fresh clone of the compiler will use the distribution files in `dist/`, but it can also run [the sources](./src) directly through ts-node after an `npm run clean`, which is useful in development. This condition can also be checked by running `asc -v` (it is running the sources if it states `-dev`). |
79 |
| - |
80 |
| -Examples |
81 |
| --------- |
82 |
| - |
83 |
| -* **[Conway's Game of Life](./examples/game-of-life)** [ [demo](https://assemblyscript.github.io/assemblyscript/examples/game-of-life) | [fiddle](https://webassembly.studio/?f=gvuw4enb3qk) ]<br /> |
84 |
| - Continuously updates the cellular automaton and visualizes its state on a canvas. |
85 |
| - |
86 |
| -* **[Mandelbrot Set](./examples/mandelbrot)** [ [demo](https://assemblyscript.github.io/assemblyscript/examples/mandelbrot) | [fiddle](https://webassembly.studio/?f=m6hbiw9wyq) ]<br /> |
87 |
| - Renders the Mandelbrot set to a canvas. |
88 |
| - |
89 |
| -* **[i64 polyfill](./examples/i64-polyfill)**<br /> |
90 |
| - Exposes WebAssembly's i64 operations to JavaScript using 32-bit integers (low and high bits). |
91 |
| - |
92 |
| -* **[PSON decoder](./examples/pson)**<br /> |
93 |
| - A simple decoder for the PSON binary format. |
94 |
| - |
95 |
| -* **[WASM parser](./lib/parse)**<br /> |
96 |
| - A WebAssembly binary parser in WebAssembly. |
97 |
| - |
98 |
| -* **[N-body system](./examples/n-body)** [ [demo](https://assemblyscript.github.io/assemblyscript/examples/n-body) ]<br /> |
99 |
| - An implementation of the N-body system from the [Computer Language Benchmarks Game](https://benchmarksgame-team.pages.debian.net/benchmarksgame/). |
| 59 | +Note that a fresh clone of the compiler will use the distribution files in `dist/`, but after an `npm clean` it will run [the sources](./src) directly through ts-node, which is useful in development. This condition can also be checked by running `asc -v` (it is running the sources if it states `-dev`). Also please see our [contribution guidelines](./CONTRIBUTING.md) before making your first pull request. |
100 | 60 |
|
101 | 61 | Building
|
102 | 62 | --------
|
|
0 commit comments