git.delta.rocks / jrsonnet / refs/commits / 4ea8dc2d6da9

difftreelog

feat(bindings) implement WASM

Лач2020-06-28parent: #85533fe.patch.diff
in: master

3 files changed

modifiedREADME.mddiffbeforeafterboth
20## Bindings20## Bindings
2121
22C bindings (libjsonnet.so) are WIP22C bindings (libjsonnet.so) are WIP
23JS bindings are WIP too, but also available in WASM form
2324
24Something is implemented, but mostly unusable for now
25
26See them in `./bindings/jsonnet/`25See them in `./bindings/jsonnet/`
2726
28## Benchmark27## Benchmark
modifiedbindings/Makefilediffbeforeafterboth
10 ldd ./c/libjsonnet_test_file10 ldd ./c/libjsonnet_test_file
11 valgrind --leak-check=full ./c/libjsonnet_test_file test.jsonnet11 valgrind --leak-check=full ./c/libjsonnet_test_file test.jsonnet
12
13../target/wasm32-wasi/release/jsonnet.wasm:
14 cd jsonnet && cargo wasi build --release -p jsonnet && cd ..
15
16test-js: ../target/wasm32-wasi/release/jsonnet.wasm
17 node --experimental-wasi-unstable-preview1 --experimental-wasm-bigint js/index
1218
13
modifiedbindings/jsonnet/src/lib.rsdiffbeforeafterboth
16 rc::Rc,16 rc::Rc,
17};17};
18
19#[no_mangle]
20pub extern "C" fn _start() {}
1821
19#[no_mangle]22#[no_mangle]
20pub extern "C" fn jsonnet_version() -> &'static [u8; 8] {23pub extern "C" fn jsonnet_version() -> &'static [u8; 8] {