Simple C Program in WebAssembly

Marco Kuoni
WebAssembly
Published in
7 min readSep 10, 2023

--

JavaScript doesn’t always make sense for every use case. Other languages can offer advantages in performance, security, or simplicity. Additionally, existing programs in other languages may potentially be used easily.

Multiplying in C

As already mentioned in the previous articles, a multiplication function is used as an example.

#include <stdio.h>

int multiply(int a, int b) {
return a * b;
}

int main() {
int a = 2;
int b = 21;
int result = multiply(a, b);
printf("%d * %d = %d\n", a, b…

--

--

Marco Kuoni
WebAssembly

CTO lemonbrain, BSc electrical engineering, cand. BSc computer science