difftreelog
feat(bindings) implement WASM
in: master
3 files changed
README.mddiffbeforeafterboth20## Bindings20## Bindings212122C bindings (libjsonnet.so) are WIP22C bindings (libjsonnet.so) are WIP23JS bindings are WIP too, but also available in WASM form232424Something is implemented, but mostly unusable for now2526See them in `./bindings/jsonnet/`25See them in `./bindings/jsonnet/`272628## Benchmark27## Benchmarkbindings/Makefilediffbeforeafterboth--- a/bindings/Makefile
+++ b/bindings/Makefile
@@ -10,3 +10,8 @@
ldd ./c/libjsonnet_test_file
valgrind --leak-check=full ./c/libjsonnet_test_file test.jsonnet
+../target/wasm32-wasi/release/jsonnet.wasm:
+ cd jsonnet && cargo wasi build --release -p jsonnet && cd ..
+
+test-js: ../target/wasm32-wasi/release/jsonnet.wasm
+ node --experimental-wasi-unstable-preview1 --experimental-wasm-bigint js/index
bindings/jsonnet/src/lib.rsdiffbeforeafterboth--- a/bindings/jsonnet/src/lib.rs
+++ b/bindings/jsonnet/src/lib.rs
@@ -17,6 +17,9 @@
};
#[no_mangle]
+pub extern "C" fn _start() {}
+
+#[no_mangle]
pub extern "C" fn jsonnet_version() -> &'static [u8; 8] {
b"v0.16.0\0"
}