{"id":20805820,"url":"https://github.com/danbugs/wit-bindgen-cs","last_synced_at":"2026-04-21T17:31:19.515Z","repository":{"id":195082568,"uuid":"689055164","full_name":"danbugs/wit-bindgen-cs","owner":"danbugs","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-06T23:03:54.000Z","size":42580,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-12T03:33:45.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danbugs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-08T17:30:53.000Z","updated_at":"2023-09-20T14:08:17.000Z","dependencies_parsed_at":"2023-09-16T12:57:51.403Z","dependency_job_id":null,"html_url":"https://github.com/danbugs/wit-bindgen-cs","commit_stats":null,"previous_names":["danbugs/wit-bindgen-cs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danbugs/wit-bindgen-cs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-bindgen-cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-bindgen-cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-bindgen-cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-bindgen-cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danbugs","download_url":"https://codeload.github.com/danbugs/wit-bindgen-cs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-bindgen-cs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32102127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T19:16:36.684Z","updated_at":"2026-04-21T17:31:19.499Z","avatar_url":"https://github.com/danbugs.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wit-bindgen-cs\n\nThis is the start of C# bindings for [wit](https://github.com/bytecodealliance/wit).\n\nThis is a project started at [\"Componentize The World\" – a hackathon hosted by the Bytecode Alliance](https://www.eventbrite.com/e/bytecode-alliance-componentize-the-world-tickets-681895717447), and was continued at [Microsoft's internal hackathon](https://hackbox.microsoft.com/hackathons/hackathon2023/project/52132) for the period of one week. With that, *it's very much a work in progress and, for now, only works with very specific WIT files (i.e., 1 interface exposing 1 function)*.\n\n## How to use it?\n\nOne of our main focuses was the developer experience, where we hoped to integrate with existing dotnet tooling and abstract away direct interactions w/ `wit-bindgen`, and `wasm-tools`.\n\n### Prerequisites\n\n- .NET 8 Preview 4 or later\n    - This can be downloaded from [Download .NET 8.0 (Linux, macOS, and Windows)](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)\n    - Verify that `dotnet --version` tells you it's .NET 8 Preview 4 or later\n- WASI SDK\n    - Download from [wasi-sdk releases page](https://github.com/WebAssembly/wasi-sdk/releases). If you're using Windows, you need the one with `mingw` in its name.\n      - `curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz`\n    - Create an environment variable called `WASI_SDK_PATH` giving the path where you extracted the WASI SDK download, i.e., the directory containing `bin`/`lib`/`share`.\n- Rust tooling (i.e., cargo, cargo component, etc.) for demo. purposes.\n    - Install from [rustup.rs](https://rustup.rs/)\n    - Install from [cargo-component](https://github.com/bytecodealliance/cargo-component.git)\n      - `cargo install --git https://github.com/bytecodealliance/cargo-component --rev 36c221e4 --locked cargo-component``\n- wasmtime 13.0.0\n    - Install from [1234dddc commit](https://github.com/bytecodealliance/wasmtime/commit/134dddc) by running `cargo install --git https://github.com/bytecodealliance/wasmtime --rev 134dddc wasmtime-cli --features component-model`\n\n\n\u003e Note: \n\u003e\u003e - `wit-bindgen`, and `wasm-tools` are automatically installed with `dotnet component init`.\n\u003e\u003e - preview reactor files can be found [here](https://github.com/bytecodealliance/cargo-component/commit/822308cd2cd87cae6c766983d5619b17898f6dbc), but are already included in this repo..\n\n## Running the demo\n\nThis demo. utilizes the work upstream from the [component-model tutorial](https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/tutorial), but replaces one of the components w/ a C# one.\n\n```sh\n(cd ./csharp-component-generator \u0026\u0026 ./install-tool.sh)\n# ^^^ install the dotnet plugin\nrm -rf MyProject\n# ^^^ remove any existing project directory\nmkdir MyProject\n# ^^^ create a new project directory\n(cd ./MyProject \u0026\u0026 dotnet new console)\n# ^^^ create a new console project\n(cd ./MyProject \u0026\u0026 dotnet component init)\n# ^^^ initialize the project for use with wasm-tools\n(cp ./Program.cs ./MyProject/Program.cs)\n# ^^^ copy the Program.cs with Add impl. into the project directory\n(cd ./MyProject \u0026\u0026 dotnet component generate --wit ../adder.wit)\n# ^^^ generate the C# bindings for the WIT file\n(cd ./MyProject \u0026\u0026  dotnet component build --world adder --wit ../adder.wit --preview ../wasi_snapshot_preview1.reactor.wasm)\n# ^^^ build the project\n./build.sh\n# ^^^ build the Rust components to be composed with the C# component\nwasmtime run --wasm-features component-model final.wasm 1 2 add\n# ^^^ run the composed component\n```\n\n## Video demo\n\n[![](https://i.imgur.com/cagFD38.png)](https://streamable.com/i6f0vl)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbugs%2Fwit-bindgen-cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanbugs%2Fwit-bindgen-cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbugs%2Fwit-bindgen-cs/lists"}