Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 798 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 798 Bytes

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