Skip to content

Commit 27d9ab6

Browse files
committed
Move some stuff around, update README
1 parent adc2f7e commit 27d9ab6

File tree

16 files changed

+263
-303
lines changed

16 files changed

+263
-303
lines changed

README.md

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
**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.
77

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)!
99

1010
---
1111

@@ -43,60 +43,20 @@ Motivation
4343
4444
> 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)
4545
46-
Getting started
47-
---------------
46+
Instructions
47+
------------
4848

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:
7050

7151
```
7252
$> git clone https://github.com/AssemblyScript/assemblyscript.git
7353
$> cd assemblyscript
7454
$> npm install
7555
$> npm link
56+
$> npm clean
7657
```
7758

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.
10060

10161
Building
10262
--------
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

std/assembly/typedarray.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ export class Uint8ClampedArray extends ArrayBufferView {
202202
return FILL<Uint8ClampedArray, u8>(this, value, start, end);
203203
}
204204

205-
sort(comparator: (a: u8, b: u8) => i32 = COMPARATOR<u8>()): Uint8ClampedArray {
206-
return SORT<Uint8ClampedArray, u8>(this, comparator);
205+
sort(fn: (a: u8, b: u8) => i32 = COMPARATOR<u8>()): Uint8ClampedArray {
206+
return SORT<Uint8ClampedArray, u8>(this, fn);
207207
}
208208

209-
subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint8ClampedArray {
210-
return SUBARRAY<Uint8ClampedArray, u8>(this, begin, end);
209+
subarray(start: i32 = 0, end: i32 = 0x7fffffff): Uint8ClampedArray {
210+
return SUBARRAY<Uint8ClampedArray, u8>(this, start, end);
211211
}
212212

213213
reduce<T>(

0 commit comments

Comments
 (0)