From b2fa4ed624114e749eb081ba6a6626b72fd1d40a Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Wed, 31 May 2023 12:35:38 +0600 Subject: [PATCH 1/5] Loadable Plug-in update Signed-off-by: Mahfuza --- docs/contribute/plugin/intro.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/contribute/plugin/intro.md b/docs/contribute/plugin/intro.md index e815858d..e74a7534 100644 --- a/docs/contribute/plugin/intro.md +++ b/docs/contribute/plugin/intro.md @@ -14,9 +14,35 @@ In current, developers can follow the guides to implement the plug-ins in [C API ## Loadable Plug-in -Loadable plugin is a standalone `.so`/`.dylib`/`.dll` file that WasmEdge can load during runtime environment, and provide modules to be imported. +Loadable plugins are standalone shared libraries (`.so`/`.dylib`/`.dll` files) that can be loaded by the WasmEdge runtime environment at runtime. These plugins can provide additional functionality to the WasmEdge runtime environment, such as new modules that can be imported by WebAssembly modules. -Please [refer to the plugin example code](https://github.com/WasmEdge/WasmEdge/tree/master/examples/plugin/get-string). +To create a loadable plugin for WasmEdge, developers can use the WasmEdge Plugin SDK, which provides a set of C/C++ APIs for creating and registering plugins. The SDK also includes [example code](https://github.com/WasmEdge/WasmEdge/tree/master/examples/plugin/get-string) that demonstrates how to create a simple plugin that returns a string. + +Once a loadable plugin has been created, it can be loaded by the WasmEdge runtime environment using the WasmEdge_LoadWasmFromFile or WasmEdge_LoadWasmFromBuffer API. The plugin can then be used to provide functionality to WebAssembly modules, such as access to system resources or specialized hardware. + +Here's a flowchart that shows the basic steps involved in creating and using a loadable plugin in WasmEdge: + +
+
+ graph TD + A[Create Plugin] + B[Compile Plugin] + C[Load Plugin] + D[Register Plugin] + E[Load WebAssembly Module] + F[Import Plugin Module] + G[Execute WebAssembly Module] + + A --> B + B --> C + C --> D + D --> E + E --> F + F --> G +
+
+ +This flowchart shows the basic steps involved in creating and using a loadable plugin in WasmEdge. The first step is to create the plugin, which involves writing the code for the plugin functions and compiling the code into a shared library. ## WasmEdge Currently Released Plug-ins From 5ba52966872d56967f5e02e4e0fac51a03390fab Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Wed, 31 May 2023 12:38:48 +0600 Subject: [PATCH 2/5] update discussion about flowchart Signed-off-by: Mahfuza --- docs/contribute/plugin/intro.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/contribute/plugin/intro.md b/docs/contribute/plugin/intro.md index e74a7534..f7a0ccf2 100644 --- a/docs/contribute/plugin/intro.md +++ b/docs/contribute/plugin/intro.md @@ -44,6 +44,11 @@ Here's a flowchart that shows the basic steps involved in creating and using a l This flowchart shows the basic steps involved in creating and using a loadable plugin in WasmEdge. The first step is to create the plugin, which involves writing the code for the plugin functions and compiling the code into a shared library. +Once the plugin has been compiled, it can be loaded by the WasmEdge runtime environment using the `WasmEdge_LoadWasmFromFile` or `WasmEdge_LoadWasmFromBuffer` API. The plugin can then be registered with the runtime environment using the `WasmEdge_RegisterImport` API. + +After the plugin has been registered, a WebAssembly module can be loaded using the `WasmEdge_LoadWasmFromFile` or `WasmEdge_LoadWasmFromBuffer` API. The module can then import the plugin module using the `WasmEdge_VMRegisterModule` API. +Finally, the WebAssembly module can execute its functions, which may call the functions provided by the plugin module. The plugin functions can then perform their specific tasks, such as accessing system resources or specialized hardware. + ## WasmEdge Currently Released Plug-ins There are several plug-in releases with the WasmEdge official releases. From aa1955cb88a8c3c7c40780a59af9988289276b0c Mon Sep 17 00:00:00 2001 From: Mahfuza Date: Thu, 8 Jun 2023 09:40:37 +0600 Subject: [PATCH 3/5] updating as per review "Signed-off-by: mhmohona " --- docs/contribute/plugin/intro.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/contribute/plugin/intro.md b/docs/contribute/plugin/intro.md index f7a0ccf2..65dac764 100644 --- a/docs/contribute/plugin/intro.md +++ b/docs/contribute/plugin/intro.md @@ -16,7 +16,7 @@ In current, developers can follow the guides to implement the plug-ins in [C API Loadable plugins are standalone shared libraries (`.so`/`.dylib`/`.dll` files) that can be loaded by the WasmEdge runtime environment at runtime. These plugins can provide additional functionality to the WasmEdge runtime environment, such as new modules that can be imported by WebAssembly modules. -To create a loadable plugin for WasmEdge, developers can use the WasmEdge Plugin SDK, which provides a set of C/C++ APIs for creating and registering plugins. The SDK also includes [example code](https://github.com/WasmEdge/WasmEdge/tree/master/examples/plugin/get-string) that demonstrates how to create a simple plugin that returns a string. +To create a loadable plugin for WasmEdge, developers can use the WasmEdge Plugin SDK, which provides a set of Rust or C/C++ APIs for creating and registering plugins. The SDK also includes [example code](https://github.com/WasmEdge/WasmEdge/tree/master/examples/plugin/get-string) that demonstrates how to create a simple plugin that returns a string. Once a loadable plugin has been created, it can be loaded by the WasmEdge runtime environment using the WasmEdge_LoadWasmFromFile or WasmEdge_LoadWasmFromBuffer API. The plugin can then be used to provide functionality to WebAssembly modules, such as access to system resources or specialized hardware. @@ -47,6 +47,7 @@ This flowchart shows the basic steps involved in creating and using a loadable p Once the plugin has been compiled, it can be loaded by the WasmEdge runtime environment using the `WasmEdge_LoadWasmFromFile` or `WasmEdge_LoadWasmFromBuffer` API. The plugin can then be registered with the runtime environment using the `WasmEdge_RegisterImport` API. After the plugin has been registered, a WebAssembly module can be loaded using the `WasmEdge_LoadWasmFromFile` or `WasmEdge_LoadWasmFromBuffer` API. The module can then import the plugin module using the `WasmEdge_VMRegisterModule` API. + Finally, the WebAssembly module can execute its functions, which may call the functions provided by the plugin module. The plugin functions can then perform their specific tasks, such as accessing system resources or specialized hardware. ## WasmEdge Currently Released Plug-ins From 9b96815a4274e3cfbe8b26b77432a0f881a76fd9 Mon Sep 17 00:00:00 2001 From: Mahfuza Date: Thu, 8 Jun 2023 10:11:33 +0600 Subject: [PATCH 4/5] updating Signed-off-by: mahfuza Signed-off-by: Mahfuza --- docs/contribute/plugin/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contribute/plugin/intro.md b/docs/contribute/plugin/intro.md index 65dac764..c90051fe 100644 --- a/docs/contribute/plugin/intro.md +++ b/docs/contribute/plugin/intro.md @@ -16,7 +16,7 @@ In current, developers can follow the guides to implement the plug-ins in [C API Loadable plugins are standalone shared libraries (`.so`/`.dylib`/`.dll` files) that can be loaded by the WasmEdge runtime environment at runtime. These plugins can provide additional functionality to the WasmEdge runtime environment, such as new modules that can be imported by WebAssembly modules. -To create a loadable plugin for WasmEdge, developers can use the WasmEdge Plugin SDK, which provides a set of Rust or C/C++ APIs for creating and registering plugins. The SDK also includes [example code](https://github.com/WasmEdge/WasmEdge/tree/master/examples/plugin/get-string) that demonstrates how to create a simple plugin that returns a string. +To create a loadable plugin for WasmEdge, developers can use the WasmEdge Plugin SDK, which provides a set of Rust, C and C++ APIs for creating and registering plugins. The SDK also includes [example code](https://github.com/WasmEdge/WasmEdge/tree/master/examples/plugin/get-string) that demonstrates how to create a simple plugin that returns a string. Once a loadable plugin has been created, it can be loaded by the WasmEdge runtime environment using the WasmEdge_LoadWasmFromFile or WasmEdge_LoadWasmFromBuffer API. The plugin can then be used to provide functionality to WebAssembly modules, such as access to system resources or specialized hardware. From 6e337223b2a2d6c6f2e5b017c9c3691757837ba7 Mon Sep 17 00:00:00 2001 From: Mahfuza Date: Thu, 8 Jun 2023 10:20:39 +0600 Subject: [PATCH 5/5] remove whitespace Signed-off-by: Mahfuza --- docs/contribute/plugin/intro.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/contribute/plugin/intro.md b/docs/contribute/plugin/intro.md index c90051fe..78aa55cb 100644 --- a/docs/contribute/plugin/intro.md +++ b/docs/contribute/plugin/intro.md @@ -32,7 +32,6 @@ Here's a flowchart that shows the basic steps involved in creating and using a l E[Load WebAssembly Module] F[Import Plugin Module] G[Execute WebAssembly Module] - A --> B B --> C C --> D