assemblyscript
assemblyscript copied to clipboard
A TypeScript-like language for WebAssembly.
This valid typescript code: ```ts export function escape(): i32 { var t: i32; jail: { t = 0xDEADFA11; break jail; }; return t; } ```
**Problem 1:** We have a very big array we need to pass to wasm function **Solution:** We cannot rely on the bindings because arrays are always copied. So we may...
It is awkward, but TypeScript officially supports using `.js` in import specifiers, like so: ```ts import {foo} from './path/to/some/file.js' console.log(foo) ``` where `./path/to/some/file.js` does not actually exist, but the file...
# Problem Currently, plain objects (objects without constructors or functions) are emit to the deceleration file as generically named interface types, in the form of `__Record{classId}`. ``` // ./assembly/index.ts class...
Assembly script fails on parsing union string literals (https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types). An example as simple as this fails: ```ts export type BufferEncoding = 'utf8' | 'ascii'; ``` ``` ERROR TS1005: 'null' expected....
I have the following code: ```as.ts add export function add(...args: Uint32Array): i32 { return args.reduce((a, b) => a + b, 0) } ``` I'm getting error "AS215: Optional parameter must...
Hey there, Type guards is now an old feature in typescript and an assemblyscript would be really beneficial: ```ts const trait = Symbol(); interface MyTrait { [trait]:string } export function...
Support following declarations: ```ts import type { Foo } from "./foo"; import type * as Foo from "./foo"; ``` This will introduced in TS 4.5 so support this as well:...
In some cases like importing an `interface`, in portable mode, we don't want the output JS to include the type import. So for regular TypeScript projects we'd write this: ```ts...
As of today, there are [various inline-assembler-like builtins](https://github.com/AssemblyScript/assemblyscript/blob/7d133cca5a33e786553fa618f9d2d51b737b4fb6/src/builtins.ts#L202) implementing the WebAssembly instruction set, but these only cover instructions that cannot be represented by a simple unary or binary expression, for...