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

wit-bindgen-csharp

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

22 breaking releases

0.35.0 Nov 13, 2024
0.33.0 Sep 30, 2024
0.28.0 Jul 16, 2024
0.23.0 Mar 27, 2024
0.15.0 Nov 27, 2023

#1601 in WebAssembly

Download history 251/week @ 2024-08-02 258/week @ 2024-08-09 138/week @ 2024-08-16 188/week @ 2024-08-23 313/week @ 2024-08-30 522/week @ 2024-09-06 143/week @ 2024-09-13 179/week @ 2024-09-20 493/week @ 2024-09-27 485/week @ 2024-10-04 176/week @ 2024-10-11 186/week @ 2024-10-18 140/week @ 2024-10-25 127/week @ 2024-11-01 161/week @ 2024-11-08 122/week @ 2024-11-15

572 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

~8MB
~136K SLoC