#bindings-generator #component-model #wit-bindgen #c-sharp #generate #run

wit-bindgen-csharp

C# bindings generator for WIT and the component model, typically used through the wit-bindgen-cli crate

21 breaking releases

0.34.0 Oct 8, 2024
0.32.0 Sep 10, 2024
0.28.0 Jul 16, 2024
0.23.0 Mar 27, 2024
0.15.0 Nov 27, 2023

#1252 in WebAssembly

Download history 166/week @ 2024-07-17 65/week @ 2024-07-24 254/week @ 2024-07-31 299/week @ 2024-08-07 133/week @ 2024-08-14 151/week @ 2024-08-21 307/week @ 2024-08-28 456/week @ 2024-09-04 264/week @ 2024-09-11 126/week @ 2024-09-18 482/week @ 2024-09-25 249/week @ 2024-10-02 442/week @ 2024-10-09 166/week @ 2024-10-16 186/week @ 2024-10-23 116/week @ 2024-10-30

970 downloads per month
Used in wit-bindgen-cli

Apache-2.0…

240KB
5K SLoC

generate the c# and the component module

The following will generate the c# code given a wit file:

cargo run c-sharp --string-encoding utf8 --out-dir testing-csharp tests/codegen/floats.wit

Setup

To run the runtime tests with Native AOT, you need some additional set up

// install wasi-sdk and set env
curl.exe -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0.m-mingw64.tar.gz | tar xzvf -
$env:WASI_SDK_PATH="c:\users\jstur\wasi-sdk-22.0+m\"

Dependencies

~7MB
~123K SLoC