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

wit-bindgen-csharp

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

15 breaking releases

new 0.28.0 Jul 16, 2024
0.26.0 May 30, 2024
0.23.0 Mar 27, 2024
0.16.0 Dec 5, 2023
0.15.0 Nov 27, 2023

#1178 in WebAssembly

Download history 306/week @ 2024-03-30 97/week @ 2024-04-06 39/week @ 2024-04-13 62/week @ 2024-04-20 416/week @ 2024-04-27 136/week @ 2024-05-04 62/week @ 2024-05-11 261/week @ 2024-05-18 199/week @ 2024-05-25 146/week @ 2024-06-01 83/week @ 2024-06-08 37/week @ 2024-06-15 196/week @ 2024-06-22 381/week @ 2024-06-29 83/week @ 2024-07-06 350/week @ 2024-07-13

1,019 downloads per month
Used in wit-bindgen-cli

Apache-2.0…

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

~6.5MB
~118K SLoC