#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

24 breaking releases

new 0.37.0 Jan 10, 2025
0.36.0 Nov 27, 2024
0.35.0 Nov 13, 2024
0.28.0 Jul 16, 2024
0.15.0 Nov 27, 2023

#1200 in WebAssembly

Download history 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 131/week @ 2024-10-30 61/week @ 2024-11-06 209/week @ 2024-11-13 157/week @ 2024-11-20 378/week @ 2024-11-27 87/week @ 2024-12-04 90/week @ 2024-12-11 27/week @ 2024-12-18 16/week @ 2024-12-25 22/week @ 2025-01-01

172 downloads per month
Used in wit-bindgen-cli

Apache-2.0…

250KB
5.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

~9MB
~159K SLoC