assemblyscript
assemblyscript copied to clipboard
A TypeScript-like language for WebAssembly.
Given the amount of foregoing heated discussions on the topic, especially in context of Interface Types and GC, I am not getting the impression that anything of relevance is going...
### Bug description ``` TS2322: Type '~lib/as-bignum/assembly/integer/u128/u128 | null' is not assignable to type '~lib/as-bignum/assembly/integer/u128/u128'. : 278 │ return value === null || !(value.lo | value.hi); │ ~~~~ └─ in...
### Feature suggestion I think it will improve the software community ecology if we can support bind wasm which satisfies the requirement of [linking](https://github.com/WebAssembly/tool-conventions/blob/main/Linking.md). It means we can call c/c++(maybe...
This speedup `indexOf` matching, especially for long strings and single character. Benchmark results: ```txt Old - SAMPLE22_0:ok: 69.700 ms - SAMPLE22_0:eof: 49.000 ms - SAMPLE63_1:ok: 90.700 ms - SAMPLE63_1:eof: 87.200...
### Bug description ```ts export interface CoreVisitor { visitBool(v: boolean): T; } class A implements CoreVisitor, CoreVisitor { // @ts-ignore visitBool(v: boolean): string { throw new Error("Method not implemented."); }...
I find the decorator support property access expression. ```ts parseDecorator( tn: Tokenizer ): DecoratorNode | null { // at '@': Identifier ('.' Identifier)* '(' Arguments var startPos = tn.tokenPos; if...
I decide to start discussion about simple closure implementations. Some obvious (and may be naive) implementation is using generation class context which I prefer to demonstrate in following example: ```ts...
Link: [here](https://www.assemblyscript.org/editor.html#IyFvcHRpbWl6ZT1zcGVlZCZydW50aW1lPXN0dWIKY2xhc3MgQiB7fQpjbGFzcyBBIHsKICBiOiBCOwogIGM6IEI7CiAgY29uc3RydWN0b3IoKSB7CiAgICB0aGlzLmIgPSBuZXcgQigpOwogICAgdGhpcy5jID0gdGhpcy5iOwogIH0KCn0KCi8qKiBDYWxjdWxhdGVzIHRoZSBuLXRoIEZpYm9uYWNjaSBudW1iZXIuICovCmV4cG9ydCBmdW5jdGlvbiBmaWIobjogaTMyKTogaTMyIHsKICBsZXQgYSA9IG5ldyBBKCk7CiAgcmV0dXJuIDA7Cn0KIyFodG1sCjx0ZXh0YXJlYSBpZD0ib3V0cHV0IiBzdHlsZT0iaGVpZ2h0OiAxMDAlOyB3aWR0aDogMTAwJSIgcmVhZG9ubHk+PC90ZXh0YXJlYT4KPHNjcmlwdCB0eXBlPSJtb2R1bGUiPgpjb25zdCBleHBvcnRzID0gYXdhaXQgaW5zdGFudGlhdGUoYXdhaXQgY29tcGlsZSgpLCB7IC8qIGltcG9ydHMgKi8gfSkKY29uc3Qgb3V0cHV0ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ291dHB1dCcpCmZvciAobGV0IGkgPSAwOyBpIDw9IDEwOyArK2kpIHsKICBvdXRwdXQudmFsdWUgKz0gYGZpYigke2l9KSA9ICR7ZXhwb3J0cy5maWIoaSl9XG5gCn0KPC9zY3JpcHQ+) Minimal reproduction: (as far as I can reduce it) ```ts class B {} class A { b: B; c: B; constructor() { // this should be safe? this.b...
Right now, when encountering an open brace in a statement context, the parser simply assumes a block ```ts { ... } ``` whereas it is also possible that the respective...
Hey! TypeScript has these handy reverse mappings! From https://www.typescriptlang.org/docs/handbook/enums.html: ``` enum Enum { A, } let a = Enum.A; let nameOfA = Enum[a]; // "A" [Try](https://www.typescriptlang.org/play/#code/KYOwrgtgBAou0G8BQUoEEA0SC+SkBtgAXKAQygF5Z4A6NAbgOKhFImAHkAzNS6yANqkAuvSgB6cVABEaaUA) ``` TypeScript compiles this...