Since the zig compiler supports WASM, isn’t this possible?
I’m thinking I could go to a website, copy paste some code into it, and it could compile?
Yes it should work but currently you would also need to build LLVM to wasm to have everything work.
Once the Zig wasm backend is complete (IIRC is not yet, but I haven’t checked in a while, maybe somebody else has a more up to date timeline) then we will be able to create a build of the Zig compiler (without LLVM) that is capable of compiling code to wasm.
At that point we’ll definitely add a Zig playground on the official website.
In the meantime you can see a preview of how that would look like here: https://playground.zigtools.org/
I believe that playground is doing what I described above, it just might run into TODOs in the wasm backend if you try to compile code that is complicated enough :^)
I already maked this and works fine. But you will implement a way to get strings of the memory on js.