Updates the requirements on [cbindgen](https://github.com/mozilla/cbindgen) to permit the latest version. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/mozilla/cbindgen/releases">cbindgen's releases</a>.</em></p> <blockquote> <h1>0.29.0</h1> <ul> <li>Support no-export annotation for statics and functions.</li> <li>Fixed conditional fields of constexpr literal structs</li> <li>Add rename rule for generated associated constant</li> <li>Upgrade heck to 0.5</li> <li>Add support for an optional nullable attribute</li> <li>docs.md: Fix deprecated_with_note and deprecated_variant_with_note being spelled as 'notes'</li> <li>Fix generic with "void" default</li> <li>Fixed error generation of structures using the keyword as inside arrays</li> <li>Added test for unsafe(no_mangle) attribute</li> <li>Fixed handling of trait methods containing the unsafe attribute</li> <li>Rename -Zparse-only</li> </ul> <h1>0.28.0</h1> <ul> <li>Parse unsafe attributes in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1020">mozilla/cbindgen#1020</a></li> <li>Fix local override of enum prefix-with-name by jsgf in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1006">mozilla/cbindgen#1006</a></li> <li>Add rename-all=prefix in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1021">mozilla/cbindgen#1021</a></li> <li>ir: add support for UnsafeCell and SyncUnsafeCell by alekitto in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1003">mozilla/cbindgen#1003</a></li> <li>Implement mangling for arrays in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1022">mozilla/cbindgen#1022</a></li> <li>Fix: Ignore <code>CARGO_BUILD_TARGET</code> in tests by bryango in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1010">mozilla/cbindgen#1010</a></li> <li>Newline for each field for constexpr field constants by youknowone in <a href="https://redirect.github.com/mozilla/cbindgen/pull/988">mozilla/cbindgen#988</a></li> <li>Fix clippy warnings by youknowone in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1026">mozilla/cbindgen#1026</a></li> <li>Add aarch64/arm64 to CI by NickeZ in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1036">mozilla/cbindgen#1036</a></li> <li>Add <code>unstable_ir</code> feature flag that makes the ir pub by heesooy in <a href="https://redirect.github.com/mozilla/cbindgen/pull/1011">mozilla/cbindgen#1011</a></li> <li>Support generated a symbols file by TheElectronWill in <a href="https://redirect.github.com/mozilla/cbindgen/pull/916">mozilla/cbindgen#916</a></li> </ul> <h1>0.27.0</h1> <ul> <li>Revert: The <code>Config</code> struct now has a private member.</li> <li>Allow users to specify a crate version for bindings generation (<a href="https://redirect.github.com/mozilla/cbindgen/issues/901">#901</a>).</li> <li>Update MSRV to 1.74 (<a href="https://redirect.github.com/mozilla/cbindgen/issues/912">#912</a>, <a href="https://redirect.github.com/mozilla/cbindgen/issues/987">#987</a>).</li> <li>Support #[deprecated] on enum variants (<a href="https://redirect.github.com/mozilla/cbindgen/issues/933">#933</a>).</li> <li>Support integrating the package_version information in a header file comment (<a href="https://redirect.github.com/mozilla/cbindgen/issues/939">#939</a>).</li> <li>Add a language backend (<a href="https://redirect.github.com/mozilla/cbindgen/issues/942">#942</a>).</li> <li>Support generics with defaulted args (<a href="https://redirect.github.com/mozilla/cbindgen/issues/959">#959</a>).</li> <li>Add <code>VaList</code> compatibility (<a href="https://redirect.github.com/mozilla/cbindgen/issues/970">#970</a>).</li> </ul> <h1>0.26.0</h1> <ul> <li>Fix swapping of <code>>>=</code> and <code><<=</code> in constants.</li> <li>Add support for #[deprecated] (<a href="https://redirect.github.com/mozilla/cbindgen/issues/860">#860</a>).</li> <li>Built-in support for bitflags 2.0.</li> <li>Support for "C-unwind" ABI.</li> <li>Generate bindings for non-public extern items if they are #[no_mangle].</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/mozilla/cbindgen/blob/master/CHANGES">cbindgen's changelog</a>.</em></p> <blockquote> <h1>0.29.0</h1> <pre><code> * Support no-export annotation for statics and functions. * Fixed conditional fields of constexpr literal structs * Add rename rule for generated associated constant * Upgrade heck to 0.5 * Add support for an optional nullable attribute * docs.md: Fix deprecated_with_note and deprecated_variant_with_note being spelled as 'notes' * Fix generic with "void" default * Fixed error generation of structures using the keyword as inside arrays * Added test for unsafe(no_mangle) attribute * Fixed handling of trait methods containing the unsafe attribute * Rename -Zparse-only </code></pre> <h1>0.28.0</h1> <pre><code> * Parse unsafe attributes in https://github.com/mozilla/cbindgen/pull/1020 * Fix local override of enum prefix-with-name by jsgf in https://github.com/mozilla/cbindgen/pull/1006 * Add rename-all=prefix in https://github.com/mozilla/cbindgen/pull/1021 * ir: add support for UnsafeCell and SyncUnsafeCell by alekitto in https://github.com/mozilla/cbindgen/pull/1003 * Implement mangling for arrays in https://github.com/mozilla/cbindgen/pull/1022 * Fix: Ignore `CARGO_BUILD_TARGET` in tests by bryango in https://github.com/mozilla/cbindgen/pull/1010 * Newline for each field for constexpr field constants by youknowone in https://github.com/mozilla/cbindgen/pull/988 * Fix clippy warnings by youknowone in https://github.com/mozilla/cbindgen/pull/1026 * Add aarch64/arm64 to CI by NickeZ in https://github.com/mozilla/cbindgen/pull/1036 * Add `unstable_ir` feature flag that makes the ir pub by heesooy in https://github.com/mozilla/cbindgen/pull/1011 * Support generated a symbols file by TheElectronWill in https://github.com/mozilla/cbindgen/pull/916 </code></pre> <h1>0.27.0</h1> <pre><code> * Revert: The `Config` struct now has a private member. * Allow users to specify a crate version for bindings generation ([#901](https://github.com/mozilla/cbindgen/issues/901)). * Update MSRV to 1.74 ([#912](https://github.com/mozilla/cbindgen/issues/912), [#987](https://github.com/mozilla/cbindgen/issues/987)). * Support #[deprecated] on enum variants ([#933](https://github.com/mozilla/cbindgen/issues/933)). * Support integrating the package_version information in a header file comment ([#939](https://github.com/mozilla/cbindgen/issues/939)). * Add a language backend ([#942](https://github.com/mozilla/cbindgen/issues/942)). * Support generics with defaulted args ([#959](https://github.com/mozilla/cbindgen/issues/959)). * Add `VaList` compatibility ([#970](https://github.com/mozilla/cbindgen/issues/970)). </code></pre> <h1>0.26.0</h1> <pre><code> * Fix swapping of `>>=` and `<<=` in constants. * Add support for #[deprecated] ([#860](https://github.com/mozilla/cbindgen/issues/860)). * Built-in support for bitflags 2.0. * Support for "C-unwind" ABI. * Generate bindings for non-public extern items if they are #[no_mangle]. </code></pre> <h2>0.25.0</h2> <pre><code> * Re-release of yanked 0.24.6 as a major release </code></pre> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="802154245e"><code>8021542</code></a> Release 0.29.0</li> <li><a href="f3a0ecd2a9"><code>f3a0ecd</code></a> Support no-export annotation for statics and functions.</li> <li><a href="14fa2d0669"><code>14fa2d0</code></a> conditional fields of constexpr literal structs</li> <li><a href="021f3f3a42"><code>021f3f3</code></a> Add LiteralStructField</li> <li><a href="4b2396dabf"><code>4b2396d</code></a> Github action: Add aarch64 to deploy</li> <li><a href="2320ac4296"><code>2320ac4</code></a> Add rename rule for generated associated constant</li> <li><a href="5ac9dc046b"><code>5ac9dc0</code></a> Upgrade heck to 0.5</li> <li><a href="9f9da30c60"><code>9f9da30</code></a> Add support for an optional nullable attribute</li> <li><a href="36b9f0df42"><code>36b9f0d</code></a> docs.md: Fix deprecated_with_note and deprecated_variant_with_note being spel...</li> <li><a href="0328601dc1"><code>0328601</code></a> Fix generic with "void" default</li> <li>Additional commits viewable in <a href="https://github.com/mozilla/cbindgen/compare/0.28.0...0.29.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Overview
Extism is a lightweight framework for building with WebAssembly (Wasm). It supports running Wasm code on servers, the edge, CLIs, IoT, browsers and everything in between. Extism is designed to be "universal" in that it supports a common interface, no matter where it runs.
Note: One of the primary use cases for Extism is building extensible software & plugins. You want to be able to execute arbitrary, untrusted code from your users? Extism makes this safe and practical to do.
Additionally, Extism adds some extra utilities on top of standard Wasm runtimes. For example, we support persistent memory/module-scope variables, secure & host-controlled HTTP without WASI, runtime limiters & timers, simpler host function linking, and more. Extism users build:
- plug-in systems
- FaaS platforms
- code generators
- web applications
- & much more...
Supported Targets
We currently provide releases for the following targets:
- aarch64-apple-darwin
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- x86_64-apple-darwin
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
For Android we suggest taking a look at the Chicory SDK for a pure Java Extism runtime.
Run WebAssembly In Your App
Pick a SDK to import into your program, and refer to the documentation to get started:
| Type | Language | Source Code | Package |
|---|---|---|---|
| Rust SDK | https://github.com/extism/extism/tree/main/runtime | Crates.io | |
| JS SDK | https://github.com/extism/js-sdk (supports Web, Node, Deno & Bun!) |
NPM | |
| Elixir SDK | https://github.com/extism/elixir-sdk | Hex | |
| Go SDK | https://github.com/extism/go-sdk | Go mod | |
| Haskell SDK | https://github.com/extism/haskell-sdk | Hackage | |
| Java SDK | https://github.com/extism/java-sdk | Sonatype | |
| .NET SDK | https://github.com/extism/dotnet-sdk (supports C# & F#!) |
Nuget | |
| OCaml SDK | https://github.com/extism/ocaml-sdk | opam | |
| Perl SDK | https://github.com/extism/perl-sdk | CPAN | |
| PHP SDK | https://github.com/extism/php-sdk | Packagist | |
| Python SDK | https://github.com/extism/python-sdk | PyPi | |
| Ruby SDK | https://github.com/extism/ruby-sdk | RubyGems | |
| Zig SDK | https://github.com/extism/zig-sdk | N/A | |
| C SDK | https://github.com/extism/extism/tree/main/libextism | N/A | |
| C++ SDK | https://github.com/extism/cpp-sdk | N/A |
Compile WebAssembly to run in Extism Hosts
Extism Hosts (running the SDK) must execute WebAssembly code that has a
PDK, or Plug-in Development Kit, library
compiled in to the .wasm binary. PDKs make it easy for plug-in / extension
code authors to read input from the host and return data back, read provided
configuration, set/get variables, make outbound HTTP calls if allowed, and more.
Pick a PDK to import into your Wasm program, and refer to the documentation to get started:
| Type | Language | Source Code | Package |
|---|---|---|---|
| Rust PDK | https://github.com/extism/rust-pdk | Crates.io | |
| JS PDK | https://github.com/extism/js-pdk | N/A | |
| Python PDK | https://github.com/extism/python-pdk | N/A | |
| Go PDK | https://github.com/extism/go-pdk | Go mod | |
| Haskell PDK | https://github.com/extism/haskell-pdk | Hackage | |
| AssemblyScript PDK | https://github.com/extism/assemblyscript-pdk | NPM | |
| .NET PDK | https://github.com/extism/dotnet-pdk (supports C# & F#!) |
Nuget | |
| C PDK | https://github.com/extism/c-pdk | N/A | |
| C++ PDK | https://github.com/extism/cpp-pdk | N/A | |
| Zig PDK | https://github.com/extism/zig-pdk | N/A |
Generating Bindings
It's often very useful to define a schema to describe the function signatures and types you want to use between Extism SDK and PDK languages.
XTP Bindgen is an open source framework to generate PDK bindings for Extism plug-ins. It's used by the XTP Platform, but can be used outside of the platform to define any Extism compatible plug-in system.
1. Install the xtp CLI.
See installation instructions here.
2. Create a schema using our OpenAPI-inspired IDL:
version: v1-draft
exports:
CountVowels:
input:
type: string
contentType: text/plain; charset=utf-8
output:
$ref: "#/components/schemas/VowelReport"
contentType: application/json
# components.schemas defined in example-schema.yaml...
See an example in example-schema.yaml, or a full "kitchen sink" example on the docs page.
3. Generate bindings to use from your plugins:
xtp plugin init --schema-file ./example-schema.yaml
> 1. TypeScript
2. Go
3. Rust
4. Python
5. C#
6. Zig
7. C++
8. GitHub Template
9. Local Template
This will create an entire boilerplate plugin project for you to get started
with. Implement the empty function(s), and run xtp plugin build to compile
your plugin.
For more information about XTP Bindgen, see the dylibso/xtp-bindgen repository and the official XTP Schema documentation.
Support
Discord
If you experience any problems or have any questions, please join our Discord and let us know. Our community is very responsive and happy to help get you started.
Usage
Head to the project website for more information and docs. Also, consider reading an overview of Extism and its goals & approach.
Contribution
Thank you for considering a contribution to Extism, we are happy to help you make a PR or find something to work on!
The easiest way to start would be to join the
Discord or open an issue on the
extism/proposals issue tracker, which
can eventually become an Extism Improvement Proposal (EIP).
For more information, please read the Contributing guide.
Who's behind this?
Extism is an open-source product from the team at:
Reach out and tell us what you're building! We'd love to help: hello@dylibso.com