Skip to content

Commit 3991760

Browse files
authored
changed fibonacci.wasm to fibonacci.wat (WasmEdge#180)
* changed fibonacci.wasm to fibonacci.wat Signed-off-by: tushar <[email protected]> * added note regarding wat2wasm Signed-off-by: tushar <[email protected]> --------- Signed-off-by: tushar <[email protected]>
1 parent a4dd7ba commit 3991760

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

docs/embed/c/intro.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ The WasmEdge C API is also the fundamental API for other languages' SDK.
1010

1111
## Quick Start Guide for the WasmEdge Runner
1212

13-
The following is an example of running a WASM file. Assume that the WASM file [fibonacci.wasm](https://github.com/WasmEdge/WasmEdge/raw/master/examples/wasm/fibonacci.wasm) is copied into the current directory, and the C file `test_wasmedge.c` is as follows:
13+
The following is an example of running a WASM file. Assume that the WASM file [fibonacci.wasm](https://github.com/WasmEdge/WasmEdge/raw/master/examples/wasm/fibonacci.wat) is copied into the current directory, and the C file `test_wasmedge.c` is as follows:
14+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
1415

1516
```c
1617
#include <wasmedge/wasmedge.h>
@@ -55,7 +56,8 @@ Get result: 3524578
5556

5657
## Quick Start Guide for the WasmEdge AOT compiler
5758

58-
Assume that the WASM file [fibonacci.wasm](https://github.com/WasmEdge/WasmEdge/raw/master/examples/wasm/fibonacci.wasm) is copied into the current directory, and the C file `test_wasmedge_compiler.c` is as follows:
59+
Assume that the WASM file [fibonacci.wasm](https://github.com/WasmEdge/WasmEdge/raw/master/examples/wasm/fibonacci.wat) is copied into the current directory, and the C file `test_wasmedge_compiler.c` is as follows:
60+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
5961

6062
```c
6163
#include <wasmedge/wasmedge.h>

docs/embed/c/reference/latest.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,8 @@ In this partition, we will introduce the functions of `WasmEdge_VMContext` objec
740740
741741
### WASM Execution Example With VM Context
742742
743-
The following shows the example of running the WASM for getting the Fibonacci. This example uses the [fibonacci.wasm](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wasm), and the corresponding WAT file is at [fibonacci.wat](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat).
743+
The following shows the example of running the WASM for getting the Fibonacci. This example uses the [fibonacci.wasm](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat), and the corresponding WAT file is at [fibonacci.wat](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat).
744+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
744745
745746
```wasm
746747
(module
@@ -762,8 +763,9 @@ The following shows the example of running the WASM for getting the Fibonacci. T
762763

763764
1. Run WASM functions rapidly
764765

765-
Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wasm) is copied into the current directory, and the C file `test.c` is as following:
766-
766+
Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat) is copied into the current directory, and the C file `test.c` is as following:
767+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
768+
767769
```c
768770
#include <stdio.h>
769771
#include <wasmedge/wasmedge.h>
@@ -1070,7 +1072,9 @@ In WebAssembly, the instances in WASM modules can be exported and can be importe
10701072

10711073
1. Register the WASM modules with exported module names
10721074

1073-
Unless the module instances have already contained the module names, every WASM module should be named uniquely when registering. Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wasm) is copied into the current directory.
1075+
Unless the module instances have already contained the module names, every WASM module should be named uniquely when registering. Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat) is copied into the current directory.
1076+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
1077+
10741078

10751079
```c
10761080
WasmEdge_VMContext *VMCxt = WasmEdge_VMCreate(NULL, NULL);
@@ -1163,7 +1167,9 @@ In WebAssembly, the instances in WASM modules can be exported and can be importe
11631167

11641168
1. Asynchronously run WASM functions rapidly
11651169

1166-
Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wasm) is copied into the current directory, and the C file `test.c` is as following:
1170+
Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat) is copied into the current directory, and the C file `test.c` is as following:
1171+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
1172+
11671173

11681174
```c
11691175
#include <wasmedge/wasmedge.h>
@@ -1341,7 +1347,9 @@ Sometimes the developers may have requirements to get the instances of the WASM
13411347

13421348
2. List exported functions
13431349

1344-
After the WASM module instantiation, developers can use the `WasmEdge_VMExecute()` API to invoke the exported WASM functions. For this purpose, developers may need information about the exported WASM function list. Please refer to the [Instances in runtime](#instances) for the details about the function types. Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wasm) is copied into the current directory, and the C file `test.c` is as following:
1350+
After the WASM module instantiation, developers can use the `WasmEdge_VMExecute()` API to invoke the exported WASM functions. For this purpose, developers may need information about the exported WASM function list. Please refer to the [Instances in runtime](#instances) for the details about the function types. Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat) is copied into the current directory, and the C file `test.c` is as following:
1351+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
1352+
13451353

13461354
```c
13471355
#include <wasmedge/wasmedge.h>
@@ -1477,7 +1485,9 @@ In this partition, we will introduce the objects of WasmEdge runtime manually.
14771485

14781486
### WASM Execution Example Step-By-Step
14791487

1480-
Besides the WASM execution through the [`VM` context](#wasmedge-vm), developers can execute the WASM functions or instantiate WASM modules step-by-step with the `Loader`, `Validator`, `Executor`, and `Store` contexts. Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wasm) is copied into the current directory, and the C file `test.c` is as following:
1488+
Besides the WASM execution through the [`VM` context](#wasmedge-vm), developers can execute the WASM functions or instantiate WASM modules step-by-step with the `Loader`, `Validator`, `Executor`, and `Store` contexts. Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat) is copied into the current directory, and the C file `test.c` is as following:
1489+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
1490+
14811491

14821492
```c
14831493
#include <wasmedge/wasmedge.h>
@@ -2796,7 +2806,9 @@ WasmEdge runs the WASM files in interpreter mode, and WasmEdge also supports the
27962806

27972807
### Compilation Example
27982808

2799-
Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wasm) is copied into the current directory, and the C file `test.c` is as following:
2809+
Assume that the WASM file [`fibonacci.wasm`](https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/examples/wasm/fibonacci.wat) is copied into the current directory, and the C file `test.c` is as following:
2810+
Please Note: In the example directory, `fibonacci.wat` file is provided and users should convert it into corresponding wasm file using [WABT tool](https://github.com/WebAssembly/wabt)
2811+
28002812

28012813
```c
28022814
#include <wasmedge/wasmedge.h>

0 commit comments

Comments
 (0)