Have some free time on my hands so I thought I'd try out Odin, an interesting language I came across a few weeks ago. I haven't dived too far into it but so far from what I understand, it's another language in a similar vain of Rust and Zig(both also very good)
Since as far as I can tell, though Odin does support WebAssembly, how specifically to build for it is not well documented so I thought I should post a very basic setup for WebAssembly.
All the Odin app does is
- export a function that called
setup
that calls an imported JS function getWindowWidth
- In the JS, it calls
setup
and logs the result.
When building the Odin code, the command is roughly
odin build -target="js_wasm32" -out=""