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
setupthat calls an imported JS functiongetWindowWidth - In the JS, it calls
setupand logs the result.
When building the Odin code, the command is roughly
odin build -target="js_wasm32" -out=""