#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

23 breaking releases

0.36.0 Nov 27, 2024
0.34.0 Oct 8, 2024
0.28.0 Jul 16, 2024
0.23.0 Mar 27, 2024
0.15.0 Nov 27, 2023

#1500 in WebAssembly

Download history 136/week @ 2024-08-19 302/week @ 2024-08-26 250/week @ 2024-09-02 480/week @ 2024-09-09 144/week @ 2024-09-16 202/week @ 2024-09-23 495/week @ 2024-09-30 478/week @ 2024-10-07 152/week @ 2024-10-14 185/week @ 2024-10-21 153/week @ 2024-10-28 91/week @ 2024-11-04 173/week @ 2024-11-11 148/week @ 2024-11-18 375/week @ 2024-11-25 121/week @ 2024-12-02

819 downloads per month
Used in wit-bindgen-cli

Apache-2.0…

245KB
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

~8MB
~135K SLoC