lunatic
lunatic copied to clipboard
How to lunch the app ?
Hello,
I try to follow the docs to try lunatic (https://crates.io/crates/lunatic)
here the code I'm working on https://github.com/parweb/test-lunatic/
I succeed to build the app after adding extern crate lunatic;
cargo build --release --target=wasm32-wasi
But where I find the binary lunatic ? lunatic target/wasm32-wasi/release/<name>.wasm
The documentations is a bit rough and I will definitely need to improve it. Especially the getting started part.
Lunatic consists of 2 parts:
- Libraries for different languages - This allows you to generate lunatic compatible WASM files. This is the part you did!
- The Lunatic runtime - This is the lunatic binary. For now you need to build it yourself. Using rust nightly and doing
cargo build --releaseat the top of this repository should generate it. Don't forget to clone git submodules.
I will also provide pre-built binaries for different operating systems next week when hopefully networking support lands.
I run
git clone --recurse-submodules https://github.com/lunatic-lang/lunatic/
cargo build --release
but got this error
error[E0425]: cannot find function `available_concurrency` in module `thread`
--> src/lib.rs:35:24
|
35 | let cpus = thread::available_concurrency().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^ not found in `thread`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0425`.
error: could not compile `lunatic-vm`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
You will need to use the latest rust nightly. available_concurrency was a recent addition to Rust.
For other newcomers
rustup update
cargo build --release
then
path/to/lunatic/repo/lunatic/target/release/lunatic-vm target/wasm32-wasi/release/test_lunatic.wasm