Re:Walt: JavaScript-like syntax for WebAssembly
by RussianCow on Wednesday October 10, 2018 @07:16PM
(#18189783)
From a quick glance, it looks like AssemblyScript compiles TypeScript, whereas Walt uses its own dialect of JS with WebAssembly types.
[ Parent
| on HN ]
Re:Walt: JavaScript-like syntax for WebAssembly
by sramam on Wednesday October 10, 2018 @08:53PM
(#18190254)
A quick look at a sample .assembly file [0], make it look like a very different language from TypeScript.
That said, the familiar tooling, editor support, are wins over other WASM options.
[0] https://github.com/AssemblyScript/assemblyscript/blob/master...
Re:Walt: JavaScript-like syntax for WebAssembly
by torch2424 on Wednesday October 10, 2018 @09:08PM
(#18190320)
I help out every once and a while on the AssemblyScript team with like issues, docs, and things. And made wasmboy, which uses AssemblyScript: https://github.com/torch2424/wasmBoy
But that being said, usually when people are interested in the language, we usually direct them to the "n-body" example: https://github.com/AssemblyScript/assemblyscript/blob/master... . Which kind of looks more typescript-y :)
Also, just to stay on topic, I think walt is awesome. Stoked to see so many projects coming up with a "Wasm for JS devs" approach/story.
Re:Walt: JavaScript-like syntax for WebAssembly
by saosebastiao on Thursday October 11, 2018 @12:11AM
(#18190920)
Apart from the explicit number types (`i32` instead of `number`, etc.) it looks like standard typescript. What looks different to you?
Re:Walt: JavaScript-like syntax for WebAssembly
by sramam on Thursday October 11, 2018 @06:51PM
(#18197670)
Incredibly, the segment below is valid TypeScript.
@inline
function rot(x: u32, y: u32, v: u32): void {
var a = max<i32>((v >>> 24) - BIT_ROT, 0);
set(x, y, (a << 24) | (v & 0x00ffffff));
}
You must be working on a different set of problems than me to be able to identify this as vanilla TypeScript.Not given the context of a file extension, I would forgive anyone for mistaking this to be some kind of low level driver code and be confused on source language.
It is so impressive that this is valid TS though!
[edit: code formatting]