Skip to content

Commit 8a538e0

Browse files
Optimized for clipboard copy action.
- When marking a code snippet with bash, $ should ideally be ignored. - Also, the primary purpose should be to guide user `How to run` and output can be omitted. Signed-off-by: Aditya Poddar <115938518+primeagen-rustaceans@users.noreply.github.com>
1 parent 6e63e2e commit 8a538e0

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

docs/develop/rust/hello_world.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ cargo build --target wasm32-wasi --release
2626
We will use the `wasmedge` command to run the program.
2727

2828
```bash
29-
$ wasmedge target/wasm32-wasi/release/hello.wasm
30-
Hello WasmEdge
29+
wasmedge target/wasm32-wasi/release/hello.wasm
3130
```
3231

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

5857
```bash
59-
$ wasmedge --reactor target/wasm32-wasi/release/add.wasm add 2 2
60-
4
58+
wasmedge --reactor target/wasm32-wasi/release/add.wasm add 2 2
6159
```
6260

6361
## Pass parameters with complex data types
@@ -72,19 +70,13 @@ Of course, in most cases, you will not call functions using CLI arguments. Inste
7270
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.
7371

7472
```bash
75-
$ wasmedge compile hello.wasm hello_aot.wasm
76-
77-
$ wasmedge hello_aot.wasm second state
78-
hello
79-
second
80-
state
73+
wasmedge compile hello.wasm hello_aot.wasm
74+
wasmedge hello_aot.wasm second state
8175
```
8276

8377
For the `--reactor` mode,
8478

8579
```bash
86-
$ wasmedge compile add.wasm add_aot.wasm
87-
88-
$ wasmedge --reactor add_aot.wasm add 2 2
89-
4
80+
wasmedge compile add.wasm add_aot.wasm
81+
wasmedge --reactor add_aot.wasm add 2 2
9082
```

0 commit comments

Comments
 (0)