A simple implementation of some string functions from libc in WebAssembly.
Contains a simple implementation of strcat, strcmp, strcpy and strlen functions from libc.
For now, contains only an optimized version of strlen function, that reads four bytes per iteration.
- wat2wasm (from WebAssembly Binary Toolkit)
- Node.js (only for running tests)
To build string.wasm:
$ wat2wasm -o build/string.wasm src/string.wat
To build string_opt.wasm:
$ wat2wasm -o build/string_opt.wasm src/string_opt.wat
Or build the two using Makefile:
$ make all
First, build the tests.wasm module:
$ wat2wasm -o tests/tests.wasm tests/tests.wat
Then, run the tests with Node.js:
$ node tests/tests.js
Note: For now, only string.wasm is tested.
$ make tests