Skip to content

Commit

Permalink
moar assemblyscript details
Browse files Browse the repository at this point in the history
  • Loading branch information
torgeir committed Apr 28, 2024
1 parent 15ea241 commit 60f983f
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions slides/presentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,27 +162,42 @@ template: inverse
# Assemblyscript: Why

- WASM is tedious
- The interop is limited

- Interop is limited

- Simplify WASM calling JS

- Simplify JS calling WASM

- `npx asinit .`

---

# Assemblyscript: How

- WASM with a _Typescript-like_ language

- Limited set of Typescript syntax

- Initially only with WASM types `i32` & `f32`

- [Stricter](https://www.assemblyscript.org/concepts.html#strictly-typed) than Typescript
- No `any` or `undefined`
- No union types (yet)
- No `type`
- Objects must be typed, using `Map` or `class`:
- [`.get(x)` on uninitialized arrays throw](https://www.assemblyscript.org/stdlib/array.html#array)
- [`.get(x)` on maps without the key throws](https://www.assemblyscript.org/stdlib/map.html#map)

- [Host bindings](https://www.assemblyscript.org/compiler.html#host-bindings) for [`esm`](https://tc39.es/ecma262/#sec-modules)
- Number
- String
- Array
- BigInt
- ArrayBuffer
- StaticArray
- Object without constructors (by-copy)
- Object with constructors (by-reference)
- `Number`
- `String`
- `Array`
- `BigInt`
- `ArrayBuffer`
- `StaticArray`
- `Object` without `constructor()` (by-copy)
- `Object` with `constructor()` (by-reference)

---

Expand Down

0 comments on commit 60f983f

Please sign in to comment.