You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can run in a browser console on https://dt.plumbing and will fail (for now on purpose) when trying to call fd_write
The above code could be fleshed out and refactored into something reasonable. It could be TS-ified and etc.
That said, it will be a kinda gross JS inter-op to try to fit everything into stdin/stdout file read and writes... Not fun in a browser context, although fine for something that interprets in an OS context, like Wasmer (probably?).
A better interface:
A one-shot WebAssembly function that interprets code
Running dt from WebAssembly and calling the
main()
function (via _start()) is a bit involved.(This is my first time ever trying to use WebAssembly APIs btw)
This can run in a browser console on https://dt.plumbing and will fail (for now on purpose) when trying to call fd_write
The above code could be fleshed out and refactored into something reasonable. It could be TS-ified and etc.
That said, it will be a kinda gross JS inter-op to try to fit everything into stdin/stdout file read and writes... Not fun in a browser context, although fine for something that interprets in an OS context, like Wasmer (probably?).
A better interface:
export fn interpret(code: []const u8) []const u8 { ... }
Dt
instanceexport fn instance() Dt { ... }
The text was updated successfully, but these errors were encountered: