5 ms·
Tiny WASI – A tiny WASI runtime written in TypeScript
- gavinray 5y agoThis 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 https://deno.land/std@0.127.0/wasi/snapshot_preview1.ts
- felipellrocha 5y agoFor the fun of it?
- miunau 5y agoThe aim isn't to be complete, it's to be tiny like the name says! Real-world usage: https://github.com/qrdate/mt63_wasm/blob/master/src/MT63-tx.ts https://github.com/qrdate/mt63_wasm/blob/master/src/MT63-tx....
- eatonphil 5y agoNice work! Do you plan to implement the rest as well or is this done?
- miunau 5y agoThe motivation was to try to get the MT63 encoder into as small of a footprint as possible, trying to minimise the Lambda bootup time and memory usage from API requests on our end, while learning WASI at the same time. It worked well for that! Ideas are welcome though! It's live on our site (https://qrdate.org https://qrdate.org). Press the "Sonify" button to hear the transmission.
- jahewson 5y agoFair
- eatonphil 5y agoBig 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.
- mushyhammer 5y agoAre 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.
- eyelidlessness 5y agoLots of tiny projects get posted here and get lots of positive attention. It seems mostly to depend on the audience who looks and the time of day when it becomes widely visible. HN itself welcomes posting projects, “show” being a first class part of the site (which if I’m not mistaken this was originally a “show” post). Maybe just show your lack of interest by looking at the next thing?
- hutzlibu 5y ago"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.
- jedisct1 5y agoOnly if they are written in Rust.
- syrusakbary 5y agoWasmer has also a Rust-compiled-to-Wasm runtime available for Deno: https://deno.land/x/wasm@v1.0.2/README.md https://deno.land/x/wasm@v1.0.2/README.md
- williamstein 5y agoAnd here is the more lightweight and flexible (in some ways) one from Wasmer, before they completely rewrote it in Rust: https://github.com/sagemathinc/JSage/tree/main/packages/wasi 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.
- krona 5y agoThe Deno WASI runtime doesn't run in a browser, it only runs in Demo. So this tiny mostly unimplemented API is still infinitely more useful to me than the Deno implementation.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- ridiculous_fish 5y agoclock_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.
- macray 5y agoI didn't know what WASI was/stands for. Here an excellent explanation : https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas...
- kateinoigakukun 5y agoThis is great! I used wasmer's polyfill for a while, but that was too much and too complex for most of the use case. This project seems really simple and tiny well.