Field noteNov 23, 20265 min read1 source

rust-anything v3.3.0 adds PHP and C# bridges into Rust

In one minute

rust-anything v3.3.0 adds bridges that let selected PHP functions and C# methods call Rust implementations through generated wrappers. The release pairs that path with recording and behavior checks, making it a concrete option for teams testing incremental migrations—but its own examples also show that bridge overhead can erase performance gains.

What happened

The v3.3.0 release notes describe PHP and C# as newly bridgeable unit types in rust-anything, a tool for moving compatible code into Rust. The project generates an interface around Rust code rather than requiring a full application rewrite at once. Its record, build, diff, and bench commands are used to exercise original and bridged implementations and compare their behavior.

For PHP, the bridge accepts a unit's top-level functions, namespaced or global, when parameters are scalar, strings, lists, or associative arrays. It generates a JSON dispatcher crate and a php/<crate>.php wrapper that redeclares those functions with their original parameters and calls the Rust library through ext-ffi. The record command runs the original code with a generated driver, loading vendor/autoload.php when present. Omitted middle arguments are passed by name so defaults apply. Build places the library beside the wrapper, while diff and bench exercise it through that wrapper. Comparison includes PHP values, exceptions by class, and printed output. Classes, static methods, object-typed parameters or returns, references, variadics, callables, and generators remain in PHP; shadow and --batch refuse PHP units.

For an undocumented bare PHP array, the bridge uses serde_json::Value; a PHPDoc type can instead guide conversion, such as list<float> to Vec<f64>. The release reports a real-code run on PEAR XML_Util 1.4.5 behind a facade of seven top-level functions, using PHP 8.5.12. All 1,838 recorded cases passed the gate. Yet the JSON bridge made every function slower than PHP in that benchmark, with a 0.09x geometric mean on a busy machine.

The C# bridge covers public static methods on public classes. It generates a JSON dispatcher over the C ABI and a cs/<Lib>.cs wrapper, exposing corresponding classes and signatures under <namespace>.Rust through P/Invoke. Supported argument shapes include scalars, strings, arrays, lists, string-keyed dictionaries, nullable values, and records or plain project classes with public auto-properties and no constructor arguments. Generic, ref/out/in, params, overloaded and async methods, as well as types such as decimal, char, ulong, delegates, tuples, and spans stay in C#. Drivers built with dotnet build compare typed JSON results, exception types, and console output. The Google.Protobuf 3.29.0 test covered 16 methods and 2,941 cases; two lone-surrogate strings are recorded as known differences because Rust String cannot hold them. The release reports call costs of 0.56–3.3 microseconds, making these 29–87 nanosecond functions 0.03x as fast through Rust.

What the archive adds

New Runtime's earlier coverage on 2026-11-19 described rust-anything as a tool for staged application rewrites with behavior checks (the earlier note). This release is a new fact on that known story: it extends the bridge approach to PHP and C#, and reports language-specific compatibility limits and benchmark results.

Trend signal

This does not yet fit a pattern New Runtime tracks. The release is nevertheless notable for treating behavioral comparison—return values, exception types, and printed output—as part of a constrained migration workflow rather than presenting language replacement as a purely mechanical conversion.

Why it matters

A language migration often fails not because Rust cannot express a target function, but because teams cannot establish that the replacement preserves observable behavior. rust-anything's generated drivers make the comparison explicit: values, exceptions, and printed output are all part of the gate. That can help teams isolate a compatible seam instead of committing to a broad rewrite.

The performance figures are equally useful as a warning. The PHP and C# examples both report bridge overhead large enough to make short functions substantially slower, despite passing functional checks. A team should therefore treat these bridges as a way to identify and validate migration candidates, not as evidence that Rust will automatically accelerate an application. Larger or compute-heavy units may have a different cost profile, but the release does not establish that.

What happens next

  • The project will add further language adapters while keeping unsupported constructs explicit. (6 months, 55%). Watch for: release notes adding adapters and documenting which code remains in its original language.

Limits and uncertainty

The measurements are examples from specific libraries and versions, not broad language benchmarks. The release does not establish performance for larger functions, production applications, or other PHP and C# workloads. Compatibility is deliberately partial, and unsupported constructs remain in the source language; teams must determine how much of their real code fits the bridge. The reported tests and timings are project results, not independently replicated here. The release also does not establish whether every generated wrapper or build workflow will behave identically across operating systems and project configurations.

Skill to build now

Choose a small, stable set of functions with clear inputs and outputs, then record baseline cases before moving any implementation behind a bridge. Include exceptions and printed output in the comparison, not just return values. After the behavior gate passes, benchmark the bridged calls separately: for tiny functions, wrapper and FFI costs may outweigh faster Rust execution. Keep unsupported shapes in the original language until a specific adapter supports them.

Reader takeaway

The useful promise in rust-anything v3.3.0 is not “PHP and C# now run faster in Rust.” It is that teams can test selected cross-language replacements against recorded behavior. Use the bridges to find and verify migration seams, and let measured end-to-end performance—not the language switch itself—decide what moves.

How this was made

Written by
New Runtime's AI newsroom, from the sources cited below.
Production record
Per-item production details (models, critic verdict, source counts) are recorded from Nov 27, 2026; this record is older.
Human review
Published without a per-item human sign-off. The editor reviews published items selectively and after the fact; errors we find are listed on the corrections page.

Corrections and error statistics

Evidence / sources

  1. 1github.com/erkamyaman/rust-anything/releases/tag/v3.3.0
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicGoogleExplore the google topic hub.
  2. 02archiveField NotesOpen the latest editorial analysis.
  3. 03sourcesSourcesSee the original sources this archive cites.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract