Tiny WASI – A tiny WASI runtime written in TypeScript
11–20 of 22 posts
Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#12Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#13 clock_time_get( id: number, precision: number, timeOut: number ): number {
...
view.setUint32( timeOut, ( now * 1000000.0 ) % 0xFFFFFFFF, true );
view.setUint32( timeOut + 4, now * 1000000.0 / 0xFFFFFFFF, true );
Oh no. As they say, something something and off-by-one errors.Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#14Earlier quoted context omitted.
Big downvote from me. Tiny projects are the best way to learn a system. Nobody needs a higher bar for getting started learning some tech. Do a tiny/toy version and keep improving (either in that project or your next one)! Edit: or in this case it seems the tiny is the goal itself. That's cool too. See also: suckless.org, UNIX philosophy, etc.
Are we going to post every 200-line project to HN too? Tiny projects are fine, but they don't all need to be posted to HN.
Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#15This has ~5 syscalls written, almost everything is "undefined", not sure why it got posted. If you want an actual complete tiny WASI runtime in TypeScript, Deno has a full one: https://deno.land/std@0.127.0/wasi/snapshot_preview1.ts
Wasmer has also a Rust-compiled-to-Wasm runtime available for Deno: https://deno.land/x/wasm@v1.0.2/README.md
https://github.com/sagemathinc/JSage/tree/main/packages/wasi
It took me some work to track down the old version, fix some bugs in it, and keep it going. But I personally find the old version very useful too, and if you can see from the comments that it has an interesting history.
Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#16Here an excellent explanation : https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas...
Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#17Earlier quoted context omitted.
Big downvote from me. Tiny projects are the best way to learn a system. Nobody needs a higher bar for getting started learning some tech. Do a tiny/toy version and keep improving (either in that project or your next one)! Edit: or in this case it seems the tiny is the goal itself. That's cool too. See also: suckless.org, UNIX philosophy, etc.
Are we going to post every 200-line project to HN too? Tiny projects are fine, but they don't all need to be posted to HN.
I rather would have more tiny projects, than political discussions to dive in, to be honest.
Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#18clock_time_get( id: number, precision: number, timeOut: number ): number { ... view.setUint32( timeOut, ( now * 1000000.0 ) % 0xFFFFFFFF, true ); view.setUint32( timeOut + 4, now * 1000000.0 / 0xFFFFFFFF, true ); Oh no. As they say, something something and off-by-one errors.
Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#19clock_time_get( id: number, precision: number, timeOut: number ): number { ... view.setUint32( timeOut, ( now * 1000000.0 ) % 0xFFFFFFFF, true ); view.setUint32( timeOut + 4, now * 1000000.0 / 0xFFFFFFFF, true ); Oh no. As they say, something something and off-by-one errors.
Re: Tiny WASI – A tiny WASI runtime written in TypeScript
#20This has ~5 syscalls written, almost everything is "undefined", not sure why it got posted. If you want an actual complete tiny WASI runtime in TypeScript, Deno has a full one: https://deno.land/std@0.127.0/wasi/snapshot_preview1.ts