remko / waforth

Small but complete dynamic Forth Interpreter/Compiler for and in WebAssembly
https://mko.re/waforth
MIT License
491 stars 27 forks source link

Question: Would attempting to support Wasix be practical? #59

Closed gmlewis closed 6 months ago

gmlewis commented 10 months ago

I read this amazing article by Dave Gauer: https://ratfactor.com/forth/the_programming_language_that_writes_itself.html and thought it would be cool to make a ~threading~ Forth in WebAssembly. (~I honestly don't know if this implementation is threaded yet or even if that is possible with Wasm.~ EDIT: After reading through the code, I see that WebAssembly prohibits threading.)

Then I came across this repo and also came across the Wasix announcement here: https://wasmer.io/posts/announcing-wasix and thought the combination might be incredibly powerful.

Does this seem practical and/or beneficial, or do I simply not understand enough about the ecosystem yet?

Thank you!

remko commented 6 months ago

AFAIK, WASI would make it possible to let WAForth use a 'standard' API for some of the I/O operations, instead of the custom implementations it has now. Then again, WAForth only uses very basic I/O operations (in total only a few lines of code), last time I checked these weren't in WASI yet, and there would still be a need for a custom API because WAForth needs access to the WASM loading infrastructure, so it wouldn't really simplify anything.