Skip to content

Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.

1.3 KB
Raw Blame

title: C# description: Bridge public static C# methods to Rust, or record and replay a CLI or ASP.NET server.

C#

Unit a folder of public static methods
Bridge a JSON dispatcher over P/Invoke
Today Unit bridges and whole apps. Use app record, app replay and the front door for CLIs and ASP.NET servers (dotnet <app>.dll).
Status Verified on Google.Protobuf 3.29.0's CodedOutputStream.ComputeSize.cs: 2,941/2,941 with 2 lone-surrogate cases in known-diffs.jsonl, gate passes; no shadow, no --batch

analyze reads .csproj projects and their NuGet packages (mapped to crates), resolves using directives to folders, and flags what C# does differently: decimal, dynamic, LINQ's deferred queries, Task, lock, reflection.

Record a built app:

rust-anything app record . -- dotnet out/app.dll
rust-anything app record . --http -- dotnet out/app.dll --urls http://127.0.0.1:{port}
rust-anything app replay .
rust-anything app front-door .

Public static methods bridge through P/Invoke; the ones that cannot cross stay in C# with the reason.

CI installs .NET only on macOS, so the C# tests run in CI there and skip on Linux and Windows. Kotlin, PowerShell and Swift have their own pages; open an issue (or upvote one) for a language that is missing.