Zel-duh
Zel-duh4w ago

Wasm In Fresh

What are some great resources to get started with using WASM in Fresh?
14 Replies
Sun「無用」
Can't you put the .wasm file on the /static folder then load it on the frontend (better to be in an island) Or do mean to bundle fresh into wasm?
Zel-duh
Zel-duhOP4w ago
I was wondering if anyone had any examples of it working or resources for how to implement a .wasm file server side
Sun「無用」
wdym "implement a wasm file" you don't write wasm directly
Zel-duh
Zel-duhOP4w ago
Hopeful to use Deno' first-class support of .wasm modules 🙂 .wat --> .wasm of course
Sun「無用」
use the wat2wasm from the wasm toolkit https://github.com/WebAssembly/wabt
Zel-duh
Zel-duhOP4w ago
Yes, I have that 🙂
Sun「無用」
what's the complication then?
Zel-duh
Zel-duhOP4w ago
I had some complications with the Memory object, but I'm hopeful maybe there are some resources or example repos of it being done 🙂
Sun「無用」
You can either follow the deno integration or the node one (deno should be amble to import it) don't ask to ask, just ask.
Zel-duh
Zel-duhOP4w ago
Also couldn't get the first-class imports working, and wondering if it's not yet ready for Fresh
Sun「無用」
what's the memory problem you have?
Zel-duh
Zel-duhOP4w ago
It was a LinkError but I've put it aside for now, when I get back to it I'll come back here with a log 🙂
Sun「無用」
it's a deno feature, so if it didn't work properly and you found a bug, just make an issue on their gh LinkError mostly means some file wasn't found (aka it couldn't link it) are you trying to import something from js (or typescript, same thing) if yes, I'll probably need some kind of info of how you're structuring your project
Zel-duh
Zel-duhOP2w ago
Updating this thread with a message of success, using wat2wasm was very helpful and now I'm deploying what I have Running into an issue about my deploy instance perhaps not having the latest deno --version to handle the imports I wanted to use

Did you find this page helpful?