Skip to content

voorhoede/code-class-webassembly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Class WebAssembly

Run the project

In your terminal run:

./server

Or if the server file is not executable:

chmod u+x server
./server

Visit http://localhost:8008/ in a browser supporting WebAssembly.

Calculator

MAKE SURE EMSCRIPTEN IS INSTALLED IN THE HOME DIRECTORTY OF THE PROJECT

To compile calculator.c to .wasm, run:

emcc calculator/calculator.c -O2 -s WASM=1 -s SIDE_MODULE=1 -o calculator/calculator.wasm

Stringinator

MAKE SURE EMSCRIPTEN IS INSTALLED IN THE HOME DIRECTORTY OF THE PROJECT

To compile calculator.c to .wasm, run:

emcc stringinator/stringinator.c -O2 -s WASM=1 -s 'EXTRA_EXPORTED_RUNTIME_METHODS=["stringToUTF8", "UTF8ToString"]'  -o stringinator/stringinator.js