gokeeps the file's other classes in the original as well as its other functions. It kept
only functions, so portingget_close_matchesfromdifflibalso bridgedHtmlDiff, and
diffandgatecould not pass on stubs the task said to leave alone.- Generated Python bindings allow
clippy::too_many_arguments: a function or method with many
parameters madegatefail on rust-anything's ownlib.rs. gotakes the repository root as its first argument, asprofiledoes
(rust-anything go . -- node bench.mjs);--rootstill works.docs/STATUS.md's table of which command covers which language (XiaoBinGan, #201) has rows
for C++, Swift, Dart, PowerShell, CUDA and Assembly (whole apps only, no adapter yet), from
his audit in #200.- PHP units cross into Rust:
bridgeno longer refuses them. A PHP unit's top-level functions
(namespaced or global) with scalar, string, list and assoc-array parameters get a JSON
dispatcher crate andphp/<crate>.php, which redeclares each function in its namespace with the
original parameters and calls the Rust library throughext-ffi.recordruns the original
under a generateddriver.php(aftervendor/autoload.phpwhen present; omitted middle
arguments are passed by name so their defaults apply),buildputs the library beside the
wrapper, anddiffandbenchcall it through the wrapper. Results are compared as PHP values
(int and float, key order,[]and{}as PHP sees them), exceptions by class, printed output
too. Static methods, classes, object-typed parameters or returns, references, variadics,
callables and generators stay in PHP with the reason;shadowand--batchrefuse PHP units.
A barearrayparameter or return now gives way to its phpdoc type (list<float>is
Vec<f64>), and an undocumented one is aserde_json::Value, since it may be a list or a map. - Real-code run: PEAR
XML_Util1.4.5 behind a facade of seven top-level functions, PHP 8.5.12:
1,838/1,838 recorded cases, gate passes; through the JSON bridge every function is slower than
PHP (0.09x geometric mean on a busy machine), asbenchreports
(demo/real-world/php-xml-util-rs,docs/real-world-languages.md). - C# units can be bridged.
bridgetakes the public static methods of a unit's public classes
and generates a JSON dispatcher over the C ABI (Kind::Ffi) pluscs/<Lib>.cs: the same
classes and signatures (defaults kept) under<namespace>.Rust, each calling Rust through
P/Invoke. Arguments may be scalars, strings, arrays, lists, string-keyed dictionaries, nullable
values, and records or plain classes from the project (public auto-properties, no constructor
arguments), which cross as JSON objects. Generic,ref/out/in,params, overloaded and
async methods, anddecimal,char,ulong,object, delegates, tuples and spans stay in
C# with the reason.record,diffandbenchbuild a console driver withdotnet build
from the owning project's sources and package references, call each method by reflection, and
compare results as typed JSON, exceptions by type andConsole.Outoutput. An input that does
not convert to a parameter type (alongfor anint) is not recorded.buildcopies the
library intocs/.shadowand--batchrefuse C# units with the reason. Verified on
Google.Protobuf 3.29.0'sCodedOutputStream.ComputeSize.cs: 16 methods, 2,941/2,941 with two
lone-surrogate strings listed inknown-diffs.jsonl(a RustStringcannot hold them), gate
passes. Calls cost 0.56-3.3 µs, so these 29-87 ns functions are 0.03x as fast through Rust.