{"id":20712441,"url":"https://github.com/alez-dev/wasm_plugin_system_example","last_synced_at":"2025-09-27T11:30:43.170Z","repository":{"id":261808564,"uuid":"884901403","full_name":"ALEZ-DEV/wasm_plugin_system_example","owner":"ALEZ-DEV","description":"This is an example on how to create a plugin system in rust with WebAssembly using wit-bindgen and wasmtime","archived":false,"fork":false,"pushed_at":"2024-11-08T14:27:03.000Z","size":1079,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-17T02:19:48.265Z","etag":null,"topics":["plugin-system","rust","wasm","wasm-bindgen"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ALEZ-DEV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-07T15:36:55.000Z","updated_at":"2024-11-14T07:43:33.000Z","dependencies_parsed_at":"2024-11-08T15:42:16.826Z","dependency_job_id":null,"html_url":"https://github.com/ALEZ-DEV/wasm_plugin_system_example","commit_stats":null,"previous_names":["alez-dev/wasm_plugin_system_example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALEZ-DEV%2Fwasm_plugin_system_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALEZ-DEV%2Fwasm_plugin_system_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALEZ-DEV%2Fwasm_plugin_system_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALEZ-DEV%2Fwasm_plugin_system_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ALEZ-DEV","download_url":"https://codeload.github.com/ALEZ-DEV/wasm_plugin_system_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234430950,"owners_count":18831488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plugin-system","rust","wasm","wasm-bindgen"],"created_at":"2024-11-17T02:19:47.471Z","updated_at":"2025-09-27T11:30:37.729Z","avatar_url":"https://github.com/ALEZ-DEV.png","language":"Rust","readme":"# Plugin system for Rust with WebAssembly\n## This is a proof of concept!\n\nThis repo is an proof of concept (or simply an example) on how you would be able to implement a plugin system with WebAssembly for your rust app\n\nThis repo was started because of the interesting [Zed blogpost](https://zed.dev/blog/zed-decoded-extensions) and the code is heavily inspired of the [zed_extension_api crate](https://github.com/zed-industries/zed/tree/main/crates/extension_api), so thanks to them  \nDon't hesitate to use the code as you want\n\n\u003e [!WARNING]\n\u003e PLS take what I say with a pinch of salt, I'm not an expert on the subject. \n\u003e This was only an exploration on the subject for my owns projects\n\n### Architecture\n\nThe architecture of the system is really simple, it's separated in 3 parts :\n- Runner\n  - This is the native part of the app, which will run our Wasm compiled code\n- API (or you could say library or SDK or whatever, I don't really care)\n  - This is where you will implement your API, all the methods and types that the plugin dev can use will be there. This part can theoretically be implemented in any language, all you need is the wit file and check if [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen) can generate the code for the concerned language\n- Plugin\n  - This part will be implemented by the user of your library (The API part), this one can theoretically be implemented in any language too\n\n### WIT file\n\nWIT stand for Wasm Interface Type, put it simply, this is your interface where you will describe your API\n\nIn your wit file you will need to add a \"world\", it's a set of imports and exports\n- Imported function\n  - This will be the method that you can implement in your runner, the Wasm user will be able to call it afterward in is plugin code\n- Exported function\n  - This is the method which will be implemented by the Wasm user, you will be able to call them to execute custom code\n\nI think I needed to clarify this part because the docs is NOT CLEAR at all and a bit outdated\n\n### Note\n\nI won't go further in the details, because I think that exploring the code is the best way to learn\n\nIf this repo is outdated, don't hesitate to open a issue or make a PR to update it\n\n### Source\n\nThere's some source to help you understand the code\n\n[WIT Documentation](https://component-model.bytecodealliance.org/design/wit.html#worlds)  \n[Wasmtime book](https://docs.wasmtime.dev/)  \n[Wasmtime rust doc](https://docs.rs/wasmtime/latest/wasmtime/)  \n[Zed blogpost](https://zed.dev/blog/zed-decoded-extensions)  \n[Zed wasm crate](https://github.com/zed-industries/zed/tree/main/crates/extension_api)  \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falez-dev%2Fwasm_plugin_system_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falez-dev%2Fwasm_plugin_system_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falez-dev%2Fwasm_plugin_system_example/lists"}