Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized for clipboard copy action. #254

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions docs/develop/rust/hello_world.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ cargo build --target wasm32-wasi --release
We will use the `wasmedge` command to run the program.

```bash
$ wasmedge target/wasm32-wasi/release/hello.wasm
Hello WasmEdge
wasmedge target/wasm32-wasi/release/hello.wasm
```

## A simple function
Expand Down Expand Up @@ -56,8 +55,7 @@ cargo build --target wasm32-wasi --release
We will use `wasmedge` in reactor mode to run the program. We pass the function name and its input parameters as command line arguments.

```bash
$ wasmedge --reactor target/wasm32-wasi/release/add.wasm add 2 2
4
wasmedge --reactor target/wasm32-wasi/release/add.wasm add 2 2
```

## Pass parameters with complex data types
Expand All @@ -72,19 +70,13 @@ Of course, in most cases, you will not call functions using CLI arguments. Inste
If we don't have extra notes for AoT, all the WASM file will be executed in the interpreter mode, which is much slower. To achieve native Rust performance for those applications, you could use the `wasmedge compile` command to AOT compile the `wasm` program and then run it with the `wasmedge` command.

```bash
$ wasmedge compile hello.wasm hello_aot.wasm

$ wasmedge hello_aot.wasm second state
hello
second
state
wasmedge compile hello.wasm hello_aot.wasm
wasmedge hello_aot.wasm second state
```

For the `--reactor` mode,

```bash
$ wasmedge compile add.wasm add_aot.wasm

$ wasmedge --reactor add_aot.wasm add 2 2
4
wasmedge compile add.wasm add_aot.wasm
wasmedge --reactor add_aot.wasm add 2 2
```
Loading