RSSAmplifier

Eric's Site · Jul 13, 2022

Zig and wasm on the command line

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

Having just read a short post on compiling zig into WASM , I figured I’d attempt the same. Alas, I didn’t find the instructions particularly clear. First, write a function in zig. // main.zig export fn addInc(a : i32 , b : i32 ) i32 { return a + inc(b); } extern fn inc(a : i32 ) i32 ; now, we compile it: zig build-lib main.zig -target wasm32-freestanding -dynamic -OReleaseSafe to…

Read on /posts/zig-wasm/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.