Hi remko,
First off, thank you for this very nice piece of software. I've been struggling for weeks to get anything like emscripten/llvm setup on my OpenBSD computer running without any success. I then came accross your project and a simple npm install gave me the possibility to develop with forth on the browser directly and without any issues! Just for that I am grateful!
Background
Anywho, I am currently porting the uxn vm to the web using WAForth and so far I've pretty much succeeded, one issue is that as soon as I run slightly more involved uxn programs performance becomes a big issue, something like the game of life in a 64x64 grid takes more that 2sec to compute. My forth code probably isn't the most optimized, but my idea was to leverage the CODE in order to write the performance critical piece in raw wasm.
Issue
I've had success creating small words that loop and fetch parts of the memory, but now I want to do a slightly more involved word that will require more than 1 local (which seems to be the default with CODE and :), I am not sure how to do that, I checked the WAT code for WAForth and I guess you do something with the $firstTemporaryLocal and $lastLocal globals, modifying those might give me access to more locals, but I have 2 issues with this:
- I have no idea what the index of those globals are?
- Even if I could modify them, I think I'll only have more
i32 locals, what if I want a v128 local?
Note: I am aware the CODE word is highly experimental, I just found myself really needing it for my project, so if I can help out figuring out how to provide a way to write raw wasm with WAForth, it'll be my pleasure!
Note2: If you want to see the kind of performance issue we are talking about: https://demo.blazebone.com Warning: this will use a lot of CPU as it's pretty inefficient
Thanks again for the work you've been putting on WAForth!
Cheers,
n
Hi remko,
First off, thank you for this very nice piece of software. I've been struggling for weeks to get anything like emscripten/llvm setup on my OpenBSD computer running without any success. I then came accross your project and a simple npm install gave me the possibility to develop with forth on the browser directly and without any issues! Just for that I am grateful!
Background
Anywho, I am currently porting the uxn vm to the web using WAForth and so far I've pretty much succeeded, one issue is that as soon as I run slightly more involved uxn programs performance becomes a big issue, something like the game of life in a 64x64 grid takes more that 2sec to compute. My forth code probably isn't the most optimized, but my idea was to leverage the
CODEin order to write the performance critical piece in raw wasm.Issue
I've had success creating small words that loop and fetch parts of the memory, but now I want to do a slightly more involved word that will require more than 1 local (which seems to be the default with
CODEand:), I am not sure how to do that, I checked the WAT code for WAForth and I guess you do something with the$firstTemporaryLocaland$lastLocalglobals, modifying those might give me access to more locals, but I have 2 issues with this:i32locals, what if I want av128local?Note: I am aware the
CODEword is highly experimental, I just found myself really needing it for my project, so if I can help out figuring out how to provide a way to write raw wasm with WAForth, it'll be my pleasure!Note2: If you want to see the kind of performance issue we are talking about: https://demo.blazebone.com Warning: this will use a lot of CPU as it's pretty inefficient
Thanks again for the work you've been putting on WAForth!
Cheers,
n