jsxx 是一个编译 JavaScript 为 C++ 的转换器。更多详细信息请参阅 [博客文章]。使用 jsxx 从标准输入读取 JavaScript,然后将其编译为 C++ 代码。
jsxx 是一个编译 JavaScript 为 C++ 的转换器。更多详细信息请参阅 [博客文章]。使用 jsxx 从标准输入读取 JavaScript,然后将其编译为 C++ 代码。
jsxx is a transpiler that compiles JavaScript to C++.
More details can be found in the blog post.
jsxx reads JavaScript from stdin and compiles it to C++ and then uses clang++ to create a binary.
$ cat testprog.js | cargo run
$ ./output
1.000000,2.000000,3.000000If you have WASI-SDK installed, you can also compile straight to WebAssembly:
$ cat testprog.js | \
cargo run -- \
--wasm \
--clang-path $HOME/Downloads/wasi-sdk-16.0/bin/clang++ \
-- -Oz -flto -Wl,--lto-O3
$ wasmtime output.wasm
1.000000,2.000000,3.000000If you want to inspect the generated C++ code, use --emit-cpp.
Apache 2.0
暂无开放 Issues,或尚未同步最近议题。