为rust-anything打分
给出您宝贵的评分:
手机端可长按图片保存,分享到朋友圈 / 社群
使用 rust-anything,你可以:
支持TS、Python、C、Go等语言,逐模块把应用改写为Rust,对比原始行为,保障迁移前后逻辑一致。
用户评论 (0)
2026年11月23日
2026年11月24日
v5.0.1
2026年11月26日
- rust-anything is now dual licensed under MIT OR Apache-2.0, the usual license for Rust projects. You
can keep using it under MIT exactly as before; Apache-2.0 adds an explicit patent grant.LICENSEis
nowLICENSE-MIT, next to a newLICENSE-APACHE, and both ship in the crate, the npm package and
the release archives. mapcounts units, not crates, in its first line: one unit bridged twice (napi and wasm, or a
secondbridge --out) reads1 of 1 unit has a Rust portinstead of2 of 2 units have. The
Ports table still lists every crate (#609 by @Aadithya-kl).fuzz --timegiven a negative or non-finite value says
`--time` must be 0 or more seconds (0 runs one round), not -1instead of
`--time` takes seconds, and--time -1(with a space) gets the same message instead of clap's
unexpected argument '-1' found. The MCPfuzztool'stimesays the same (#612).bridge --as-json Qstops before writing anything when no export declaresQas a type
parameter, with--as-json `Q` is not a type parameter of `src/math.ts` (type parameters: T)
(or "it has none"), instead of ignoring the name and leaving the generic export in TS, as
--keepalready does for unknown exports (#608).
v5.0.0
2026年11月26日
The old program is the judge, now with sharper eyes: every mismatch says where it starts and
which bug it belongs to, live traffic can be shadowed, drift is checked in CI, and gate catches
ports that copy the recording instead of computing it. Ideas from Anthropic's write-up on moving
the Messages API to Rust.
-
bridgeon a crate folder that already has a port names the next step: run
rust-anything refresh <crate>to regenerate the bindings, pass--outor--namefor a new
crate, or remove the folder to start over (#568, #599 by @alvaroalonsoparrondo-a11y). -
bridge --kind napi(orwasm) on a unit that is not TS/JS stops before writing anything, with
--kind napi is for TS/JS units; mathy.py is Python and is bridged with PyO3, instead of writing a
napi crate for a Python unit that only fails atdiff. The--kindhelp says it is for TS/JS units
(#575, #598 by @alvaroalonsoparrondo-a11y). -
--float-tolerance -0.5(with a space) onrecord,diffandapp recordgets the range message
instead of clap'sunexpected argument '-0' found, anddiffchecks the tolerance before it
reads or runs anything (#574, #597 by @alvaroalonsoparrondo-a11y). -
diffnames where each mismatch first differs, asatin the JSON: the channel (return,
throw,return vs throworcall Nfor a class scenario), the JSON path ($.items[2].name),
the kind (value,type,missing key,extra key,length) and, for strings, the character
with a little context around it.app replaydoes the same for each failing field: the line
and column of text output, the JSON path in a JSON body, the status change (200→500). -
diff,app replayandreportgroup the failing cases that differ the same way into
distinct differences, each with a short stable id and a count, so 40 mismatches from one bug
read as one line.rust/app-cases/replay-report.mdgains a "Distinct differences" table before
the failing cases,reporta "Remaining differences" table (anddifferencesin its JSON)
while cases still differ, andgohands the agent each difference once with an example and
where it starts, instead of the first five raw mismatches. -
diff --redactandapp replay --redact(MCPredact: true) print mismatches as shapes only:
where they differ, types, lengths and hashes, never arguments, outputs or request paths. The
replay report is written redacted too, so it can be pasted into an issue or handed to another
agent. -
app shadowchecks a server build on live traffic: a proxy answers every request with the
original, then sends it to the build and compares status, headers and body with the saved
normalizers. The build's outbound HTTP and mail go to local sinks and its--freshfiles to a
copy of its own, so no side effect happens twice. Mismatches are logged to
rust/app-cases/shadow/mismatches.jsonlas redacted shapes (where each field first differs,
never values) and grouped into distinct differences at the end;--keepsaves the requests in
app record --inputsformat.--upstreamuses an original that is already running,
--requestsstops after a count. Servers only, no MCP tool. -
app drift [REPO] [--build CMD](MCPapp_drift) checks that the recording still describes
the original and the port still matches: it replays the original againstrust/app-cases
(cases it no longer matches changed upstream), lists examples in its docs that no case records,
and replays the build (rust/app, built with cargo, by default), marking each case "original
changed, port still old" or "port regression". It writesrust/app-cases/drift-report.md,
leavesreplay-report.mdas it was, and exits 1 on any change.docs/whole-apps.mdhas a
GitHub Actions workflow that runs it on a schedule. -
gatehas a cheat guard.literalsfails when the port writes three or more recorded arguments
or results (strings of 8 or more characters, numbers with 5 or more significant digits) that the
original's source never spells out, or namescases.jsonl,known-diffs.jsonlor
recorded-from.json; one or two are named and pass, and// recorded-literal: <reason>on a line
lets a library constant stay.testsfails when the crate has fewer#[test]s or assertions, or
more#[ignore]s, than at its last passing gate (kept in.rust-anything/tests.json).record
now also saves the number and hash of the recorded lines inrecorded-from.json, andrecording
fails when one of them was edited or removed; appended cases (fuzz --keep) still pass, and older
recordings are not checked until recorded again.go's TASK.md says so. -
ruleskeeps port rules inrust/RULES.md:rust-anything rules <repo>lists them and
--add "<rule>"appends one (an exact duplicate is skipped; a crate folder stands for its
repository).goputs them in TASK.md (and so in every retry prompt), both MCP prompts end with
them, and the MCP server's instructions, therulestool and the skill tell agents to read them
before porting and to add each correction the user makes. -
Docs and tests: translated READMEs link the Types and packaging pages, CONTRIBUTING lists every
test file, the FAQ states the PHP and .NET requirements,buildandrefreshhelp covers every
language, and new unit tests coverc_literal,local_module_version,shell_quoteand the
base64 helpers (#564 by @Lewandox, #578 by @XiaoBinGan, #585 to #596 and #600 to #603 by
@alvaroalonsoparrondo-a11y).
Upgrading
rust/app-cases/replay-report.mdgains a "Distinct differences" section and anatline above
each failing field, so a committed report differs once after upgrading: replay and commit it
again.gatehas newliteralsandtestschecks and an extendedrecordingcheck, which can fail
ports that passed before. A constant the original really takes from a library can stay with
// recorded-literal: <reason>on its line; to accept fewer tests on purpose, delete
<crate>/.rust-anything/tests.jsonand rungateagain to save a new baseline.
v4.2.0
2026年11月26日
- MCP boolean arguments (
force,dry_run,whole_app,ignore_key_order,pin_clock,partial,
traps,http,library,check,skip_gate) given a non-boolean such as"false"or1are
refused with`<key>` must be a boolean, instead of silently falling back to the default
(#563 by @Lewandox). app recordandapp replaywithout a fixed--portpick a port that is free on both127.0.0.1
and[::1], and try another one if something takes it before the server starts, instead of
failing now and then withport <N> is already in use(#562 by @Lewandox).bench --min-ms 0andreport --min-ms 0(and MCPbench/reportwithmin_ms: 0) are refused
with`--min-ms` must be at least 1, likefuzz --cases 0, instead of timing a single pass
(#561 by @ardazeybek).- A failed MCP tool call whose program is missing (
`cargo` not found on PATH) gets the
missing_toolcode withrust-anything doctoras the next step, instead of a genericfailed
(#557 by @Lewandox). record --count 0(and MCPrecordwithcount: 0) without--inputsor--from-testsstops
with an error before touchingcases.jsonlor the manifest, likefuzz --cases 0: it used to
replace the recording with an empty file and exit 0.--count 0 --inputs <file>still records
just the given cases (#539, #546 by @alvaroalonsoparrondo-a11y, with the early check and a test
from #556 by @ardazeybek).enable --partialandenable --only(without--force) on a crate with nocases.jsonlsay
no cases.jsonl in <crate> (run `rust-anything record` first)like plainenable, instead of
the bareNo such file or directory (os error 2)(#540, #545 by @alvaroalonsoparrondo-a11y).- MCP tools refuse a numeric argument of the wrong type, a negative one or one out of range
(count,rounds,cases,seed,min_ms,time,float_tolerance,port,pace,
ready_timeout) instead of silently using the default; aportabove 65535 is an error rather
than no port (#543 by @Lewandox). - The "not found on PATH" check behind
build,gateand the other outside-tool steps looks up a
program the way it is spawned: on Windows only the name and<name>.execount (a bare.cmd
script no longer does), and on Unix a relativePATHentry is resolved from the command's
working directory (#541 by @Lewandox). - MCP
bridgerefuses akindother than"napi"or"wasm",record,buildanddiffrefuse a
non-stringprofile, andfuzzrefuses a non-stringkeep, instead of silently falling back to
the default (#530 by @Lewandox). bridge --name(and MCPbridge'sname) is refused before any folder is written when it is
not a valid Cargo crate name: empty, padded, a path such as../escape, a leading digit, a Rust
keyword or a reserved Windows file name. A unit whose file name starts with a digit or has no
letters gets a valid default name (unit-123-rs,unit-rs) (#529 by @Lewandox).build,gateand the other steps that run an outside tool say`cargo` not found on PATH
withdoctor's install command when the program is missing, instead of the rawNo such file or directory (os error 2);gateno longer tells you to fix a compile error when the build never
started (#498, #525 by @Lewandox).bridge --keeprefuses a name that is not an export or class of the unit, listing the ones it
has, before writing anything: a typo used to bridge the export it meant to keep. A bare
--keep ' add 'is trimmed like--keep "add: reason"already was (#499, #522 by
@alvaroalonsoparrondo-a11y).--batch function:paramwith an unknown function or parameter lists the onessrc/port.rshas
((functions: add),(parameters: a, b)), and an empty side (add:or:a) gets the same
"write it as function:param" error as a spec without a colon (#504, #521 by
@alvaroalonsoparrondo-a11y).enable --only(and--partial) with an unknown name lists the unit's exports after the unknown
ones, so the right spelling is in the error (#500, #520 by @Papito084).package --version(and MCPpackage'sversion) is refused before anything is written,
--dry-runincluded, unless it isMAJOR.MINOR.PATCHwith an optional-prerelease: an empty,
padded or malformed version used to land in the package and fail only at publish time (#502, #519 by
@alvaroalonsoparrondo-a11y).gate'ssizecheck andgo's "no hot function to port" message say1 lineand
1 hot functionfor one, likeanalyze's plan (#503, #516 by @Papito084).- The
port_unitandport_whole_appMCP prompts strip the skill's front matter whenSKILL.md
has CRLF line endings, as on a Windows checkout withcore.autocrlf=true(#501, #515 by @Papito084). - Generated Go, Java, Kotlin and Ruby bridges pass a zero-argument fallible port function straight
torun/guard(run(port::pong)) instead of wrapping it in a closure, so freshly bridged code
passesgate's clippyredundant_closurecheck again (#310, #487 by @Lewandox). app record --no-httpturns a saved server recording back into a CLI,--no-argsand
--no-freshclear the saved--argand--freshlists (removing an unused snapshot), and
--port 0drops a saved fixed port; MCPapp_recordtakeshttp: false,args: [],fresh: []
andport: 0the same way. A new run command re-infers an inferred app name, while one given
with--nameis kept (#330, #486 by @Lewandox).app record --timeout 0andapp replay --timeout 0(and MCPapp_record/app_replaywith
timeout: 0) are refused before anything runs, instead of killing every run at once; a saved
timeout_secsof 0 is refused too, with a hint to pass--timeout(#497, #514 by @aloneangel45).app record --ready-timeout SECS(and MCPapp_record'sready_timeout) sets how long a server
start waits for its port instead of a fixed 60 seconds. It is saved with the cases and used by
replay and the front door; 0 restores the default (#332, #478 by @XiaoBinGan).tests/skill.rsfails when the skill names a command the CLI does not have, andscripts/skill-eval/
compares skill versions on a fixed port task, scored bygate(turns and cost from the agent's JSON).analyzeprefers a matching sibling source file over a directory index for extensionless
TypeScript and JavaScript imports, as TypeScript's bundler resolution does
(#476, #477 by @isnaenihidayat).- Ruby ports turn
Err("Mod::Error: message")into that namespaced exception, and Java, Ruby and
PHP replays load the project's own classes, so a port that returns a project-defined exception
matches the recordederror_type. The Ruby wrapper reopens each receiver withclass << Mod,
so it also loads over a class the original defined (#372, #457 by @SPD-RYUK). app recordspreads CLI and HTTP traps round-robin across every base case, deduplicates traps
before capping at 300, always keeps the HTTP unknown-route probe (GET /rust-anything-missing),
and reports how many traps were dropped (traps_droppedin JSON and CLI output) (#335, #454 by @Lewandox).- HTTP cases support binary request bodies via
body_base64andbody_filein--inputsand case
.tomlfiles,curl --data-binary @filereads raw bytes instead of UTF-8 text, andcurl -F/
--formbuilds deterministicmultipart/form-datauploads (#336, #452 by @Lewandox). app record --effect-response 'METHOD /path=STATUS [BODY|@FILE]'(and MCPapp_record's
effect_response) lets the HTTP effect sink answer matching requests (supporting*wildcards)
with canned statuses and bodies, saved with the cases so replay sees identical replies
(#334, #451 by @Lewandox).bench,reportand the MCPbenchtool leave functions whose recorded cases do not all match
out of the overall speedup and the advice, and name them: a port that still panics was timed at
the cost of catching the panic, which pulled the verdict down (#341, #470 by @AyhamJo7).app recordkeeps the saved effects a run does not name:--effectsreplaces the kinds,
--effect-envadds or replaces one variable, and--db-reset/--db-dumpreplace only
themselves, so re-recording with one flag no longer drops the HTTP sink and its variables
(#331, #468 by @XiaoBinGan).- Java bridges ordered sets (
SortedSet,NavigableSet,TreeSet,LinkedHashSet) as arrays
across the reflection converter and binary wire, and refuses unorderedSetandHashSetwith
"an unordered collection" instead of treating them as project classes (#366, #449 by @Lewandox). docs/types.mdlists, for each language, what each source type becomes inport.rsand the
reason a type keeps a function in its language; a test checks every row against the code
(#373, #456 by @puretechteam).- Docs: the README unit-port caption and the FAQ runtime extras table include PowerShell (#505,
#506), the translated READMEs got a+ add yourslanguage link (#513), the PHP and C# unit
bridges are documented in the Azerbaijani, Uzbek, Turkish, Ukrainian, Simplified Chinese and
Korean READMEs (#479, #480, #481, #482, #483, #484), theport.rscomment is translated in the
Vietnamese, Kazakh, Kyrgyz and Turkmen READMEs (#485), and the Turkish, Ukrainian, Azerbaijani,
Vietnamese, Hindi and Arabic READMEs mention Gradle and Kotlin detection (#507, #508, #509,
#510, #511, #512), by @Papito084; whole-app support for any language (#445), the
rust/app-cases/rust-anything.jsonsettings (#446) and the Japanese Gradle and Kotlin note
(#444) by @Papito084; the Persian, Kazakh, Kyrgyz, Turkmen, Tatar, Uyghur and Uzbek READMEs
mention Gradle and Kotlin detection (#547, #548, #549, #550, #551, #552, #553) and include
PowerShell in the unit-port caption (#559, #560), by @alvaroalonsoparrondo-a11y; the Arabic,
French, Spanish, German, Italian and Portuguese captions (#555 by @Lewandox) and the Turkish and
Azerbaijani ones (#558 by @ardazeybek) do too; the Japanese README says PHP and C# units port
now (#460 by @XiaoBinGan); the Simplified and Traditional Chinese READMEs mention Gradle and
Kotlin detection (#471, #473 by @hkhkkh); a Thai README was added (#475 by @matavanary); and the
plugin directory copy ofSKILL.mdis back in sync (#474 by @AyhamJo7). - Tests: end-to-end Python and Node profile workloads (#447) and a report on a built crate (#459)
by @Papito084; the busy-port and exiting-build messages (#458) and a check that a forked server
is gone after record (#544) by @XiaoBinGan.
v4.1.0
2026年11月25日
-
enable --only <fn>(repeatable) switches on just the named functions of a unit, and--partial
switches on every function whose recorded cases all match, so a unit with many exports can go
over one function at a time. Running it again widens or narrows the marked block in place (#351, #412 by @Lewandox). -
reporttakes--resolve-from <dir>likebenchandfuzz, in the CLI and the MCP tool, for
repositories whosenode_moduleslives elsewhere (#349, #402 by @XiaoBinGan). -
analyze's Start here details name the sibling a unit imports in the same package, which is what
puts it in a later wave (#348, #422 by @XiaoBinGan). -
A Kotlin unit that takes or returns
ByteArray,ShortArrayorFloatArraysays that the Java
wire cannot carry that array type yet, instead of calling it a class (#369, #386 by @XiaoBinGan). -
bridge --batchon a C unit, andrefresh --batchon a C, PHP, C# or PowerShell crate, fail with
"--batchis not available for units yet" instead of saving a batch that generates
nothing (#434, #440 by @SPD-RYUK). -
Java and Kotlin ports turn
Err("Type: message")into the same exception on the JSON, typed, wire
and batch paths, and look injava.timeandjava.util.concurrenttoo, so a typed call no
longer throwsRuntimeExceptionforDateTimeException(#359, #438 by @SPD-RYUK). -
reportsays "Nx slower" for a port slower than the original in the card'saria-labeland in
REPORT.md's speedup rows, instead of "0.0x faster" and0.0x(#433, #437 by @draarivpatel-ui). -
analyzeandmapcount lines of code the waygate's size check does, leaving out comment
lines, so licence headers and JSDoc no longer move a file's Lines, Start here or priority (#342, #435 by @AyhamJo7). -
profileandgoon a Node that refuses--cpu-profinNODE_OPTIONS(22.14) pass it to anode
command as arguments, and stop with a clear message for wrappers such asnpx(#346, #429 by @AyhamJo7). -
profileleaves a script's top level (Python's<module>, Node's line-1 module function) out of
"What to port" and no longer advises porting it with a function it calls in a loop (#344, #428 by @AyhamJo7). -
Java and Kotlin parameters accept covariant wildcards and projections (
List<? extends CharSequence>,
List<out CharSequence>,Map<String, ? extends Integer>,Array<out String>) through both the
reflection converter and the binary wire; return positions,? super Tandin Tstay refused (#367, #439 by @Lewandox). -
app record --effects smtprecords each email as its decodedFrom,To,CcandSubject
and its MIME parts (attachments as name, type, size and SHA-256), so the same mail sent with
different MIME framing matches.--effects smtp-rawkeeps the raw DATA, and cases recorded
before this keep replaying against the raw form until recorded again (#333, #426 by @Lewandox). -
Go ports map matching error messages back to the package's exported sentinel errors, so callers using
errors.Iskeep working (#365, #413 by @Lewandox). -
record --ignore-key-ordersaves the choice with the crate, sogate,enable,reportand
gocompare objects regardless of key order too;--no-ignore-key-orderundoes it (#352, #409 by @XiaoBinGan). -
mapgives each unit without a portanalyze's status and lists the blocked and kept ones
with the reason, so they no longer read as work left to port (#350, #421 by @XiaoBinGan). -
On Windows,
profileandgofind the project's own functions in a Node workload: Node's
file:///C:/...frame URLs kept the slash before the drive letter, so no frame matched the
project root andgostopped withno hot function to port(#407, #408 by @Momentum96). -
app recordandapp replayfail withport <port> is already in usebefore spawning a server
on an occupied port and check whether the child exited before treating the port as ready (#326, #395 by @brixtonpham). -
Err("Outer+Inner: message")in a C# port throws the nested exception the recording names,
likeAcme.Parser+ParseException, instead of falling back toInvalidOperationException(#363, #423 by @draarivpatel-ui). -
Recording again removes the cases the last recording wrote and this one did not (an input that
was removed or renamed, or a case that timed out), for CLIs and inhttp/, so replay no longer
compares against them. Cases added by hand are kept and named in the output, as are the files
a kept case reads throughfs.base; switching between a CLI and--httpremoves nothing (#329, #420 by @puretechteam). -
app record --httpandapp replaystop the whole server when it was started through a wrapper
(npm start,sh -c, a.batfile): every process it started, waiting until all are gone.
Ctrl-C duringapp record --httpstill stops the server too.
The real server used to keep running, so the next run met it on the port and a replay could
pass against it (#325, #419 by @puretechteam). -
record,fuzz,diffandbenchpass--experimental-strip-typesto Node 22.6 to 22.17 (and
23.0 to 23.5), which only strip TypeScript types with that flag, so TS units no longer fail with
ERR_UNKNOWN_FILE_EXTENSIONon Node versionsdoctoraccepts (#340, #418 by @puretechteam). -
app record --httpandapp replayfind a server that listens only on::1(alocalhost
bind can get IPv6 only) and send its requests there, instead of waiting 60 seconds and failing
withdid not listen within 60s(#327, #417 by @puretechteam). -
app record --db-resetand--db-dumprun in the folder a CLI case runs in, as they already did
for servers, so a database the app keeps next to it is the one reset and dumped, and the
repository's own copy is left alone. Scripts they name by a relative path with a script
extension (reset.py,"my scripts/seed.sh",< schema.sql) still come from the repository;
output redirects (> dump.sql, also unspaced) stay in the case's folder, and here-document
bodies and#comments are left as written. Quotes, line continuations and( )blocks are
read as sh and cmd read them (#324, #416 by @puretechteam). -
bridgetypes Gouint64anduintasu64anduintptrasusizeinport.rs, alone or as
slice items. They werei64, so a result abovei64::MAXcould not go back to Go and failed
diff(#357, #414 by @AyhamJo7). -
Docs: the FAQ says how each language reads an error type (#387), the MCP
analyzeandfuzz
descriptions name every language (#392), the risks table lists only whatanalyzedetects
(#424) and how readiness, priority and Start here are scored (#436), by @XiaoBinGan; the
shadow --outhelp gives each language's default (#401) and the Spanish, Italian and German
tables gained Kotlin and PowerShell (#396, #399, #400), by @hkhkkh;enablehelp and docs name
PowerShell (#441) and the Russian and Korean READMEs explain Gradle and Kotlin detection (#442,
#443), by @Papito084; the German, French and Portuguese READMEs got the same (#410 by @lyn1dev,
#415 by @sniwas, #411 by @P-r-e-m-i-u-m); CONTRIBUTING lists the missing-folder tests (#391 by
@NYeswanth08); and the site moved to rust-anything.com with every translated languages table
brought up to date.
v4.0.0
2026年11月24日
- A documentation site at rust-anything.com: the README, the guides
and the real-world ports in 18 languages, with search, falling back to English for pages not
translated yet. The README links it, and the project has a Discord. - Python
bytes,bytearrayandmemoryviewhints becomeVec<u8>in the port, and the PyO3
bridge takes any of the three and returnsbyteswithout going through JSON (#370, #381 by
@Lewandox). - An integer default on a Python
floatparameter (def f(x: float = 1)) types asf64instead
of failing the bridge (#380 by @d0ukan). doctorchecksadb, which Android recording needs (#308 by @XiaoBinGan).analyzerefuses a folder that does not exist (#294 by @AyhamJo7), andanalyze --langfor a
language the folder does not hold is an error that names the language it found and why any
files were left out, instead of an empty plan with exit 0 (#345, #385 by @puretechteam).analyzelists distinct lines as a risk's samples, so several hits on one line no longer hide
the next location (#347, #382 by @puretechteam).mapsays when no unit was found (#296 by @AyhamJo7), refuses a file instead of printing an
empty map (#307 by @XiaoBinGan), and refuses--writewith--jsoninstead of printing JSON
and writing nothing (#343, #383 by @puretechteam).diff,disable,reportandshadowon a missing folder say to runbridgefirst (#306 by
@P-r-e-m-i-u-m, #302 by @Kiddo4993).app recordjoins example commands wrapped with a trailing\, so a curl example split over
lines becomes its request (#328, #384 by @puretechteam).- Parsers: C integer specifiers in any order (#374), Java wildcards named as wildcards and still
refused (#375), Java C-style array parameters keep their dimensions (#378), phpdoc types that
contain a space (#376), and YARD@paramtags in either order (#377), all by @XiaoBinGan. - HTTP recording treats only two hex digits after
%as an escape (#298 by @XiaoBinGan). benchfor Go says how much slower instead of "1.0x slower" (#299 by @XiaoBinGan), the card
never prints a non-zero fallback rate as 0.0% or a partial one as 100.0% (#304 by
@puretechteam), andreportleaves out the Risk guide when no unit has a risk (#320 by
@puretechteam).- The workflow skill's description names Kotlin, PHP, C# and PowerShell, so agents also pick it
for those ports (#280, #313 by @athrvd77). - Docs: an Indonesian README (#295 by @agusmakmun); the PHP and C# unit bridge in Traditional
Chinese (#316 by @XiaoBinGan), Portuguese (#318 by @XiaoBinGan) and Vietnamese (#379 by @tlq5l);
the Russian README brought up to date (#319 by @onlykushalll); the PHP wrapper and the.Rust
namespace explained (#317), PowerShell named in the descriptions (#312) and the plugin directory
listing updated (#315), by @XiaoBinGan; the runtime versionsdoctorchecks andapp replay's
default timeout documented (#321, #322 by @puretechteam).
v3.4.0
2026年11月24日
- PowerShell units (#209).
analyzereads.psm1modules,.ps1scripts and.psd1manifests,
followsImport-Module,using moduleand dot-sourced files, and adds notes on implicit output
and array unrolling, case-insensitive comparison and implicit conversions.bridgetakes the
functions a module exports (Export-ModuleMember, wildcards included) with[string], integer,
[double],[bool]/[switch], array,[hashtable]and untyped parameters, and writes
ps/<crate>.ps1: each function with its originalparam()block, calling the Rust library
through P/Invoke methods that Reflection.Emit declares at load time, so onlypwsh7.4+ is
needed on Windows, macOS and Linux. Filters,begin/processblocks, pipeline input,
[scriptblock],[ref],$PSCmdletand other .NET types stay in PowerShell with the reason.
record,diff,benchandgaterun a generatedpwshdriver; a result is what
$r = f ...holds, andWrite-Host, warnings and non-terminating errors are recorded as
output.enabledot-sources the wrapper after the module's last function, so its own callers
get Rust too;disablerestores the file byte for byte.doctorcheckspwsh, andprofile
says to time onepwshstart first. Each call costs about 0.1 ms of PowerShell-side encoding on
an Apple M4, more with arrays and hashtables: a port pays off only for functions that do more
work than that, and never for the start-up of a shell per command. - Generated JSON dispatchers read
$nummarkers (NaN, the infinities, -0) inside an optional list
of floats (Option<Vec<f64>>), which failed with "invalid type: map, expected f64". doctorchecks that PHP has theFFIextension loaded (php -m), not only PHP 8.0+
(#240). WhenFFIis missing, the PHP line says so with how to enable or install it, and stays
optional so the report does not fail.profilesays when the time goes to child processes, not code (#208). Time under Node's
execSync,execFileSyncandspawnSync, and under Python'ssubprocesscalls and
os.system, is a new "Child processes" section and achild_processesfield in--json
(command, file, line, function, ms, share; left out when empty), with the advice to keep one
long-lived process open, batch the commands, or call the API directly;child_pctgives the
total. A hot function that waits gets its ownchild_pct, and from half its time that advice
instead of "port it";gopasses over such a function, says why when--functionnames it,
and stops when waiting is half the run or more (--functionstill names a function that does
not itself mostly wait). A function'schild_pctcounts only waits known to happen under it:
a helper shared by several callers, or a recursive call, does not pass its waits to every
caller.child_pctfor the run also counts waits that no user function owns (a library's
timer callback); Python waits count only in the interpreter's ownsubprocessandos
modules, not a dependency's file of the same name;golooks past the 25 rows the report
shows; an executable named on its own (execFileSync("/opt/My Tools/worker"), an argv list)
is shown whole.profileandgojudge each hot exported function with the rulesbridgeapplies. A hot
functionbridgekeeps in the source language (one taking a callback, typed in TypeScript or
in a sibling.d.ts; a Python generator) was advised as "port it", andgopicked it and
stopped with "every export ... must stay in TypeScript/JavaScript" (or Python).profilenow
says whybridgekeeps it (a newjs_onlyfield in--json), andgopasses over it to the
next hot function that can cross, or says none can.go --function fnamesbridge's reason for
such a function and, when two hot functions share the name, takes the one that can cross; the
functionsgoleaves in the original keepbridge's own reason inrust-anything.json
instead of "not hot in the profiled run";profilereads and judges each hot file once.- Python ports can raise the original's own exception classes:
Err("sqlparse.exceptions.SQLParseError: msg")
importssqlparse.exceptionsand raisesSQLParseError("msg"), and any built-in exception goes by
its name (Err("FileNotFoundError: msg")), not only the twelve the bindings matched before. A
name that is noExceptionsubclass still givesValueErrorwith the whole message.diff
compares exception classes, so a library with its own error class could not match before;
diffnow keeps the original's packages importable (put first onsys.pathasrecorddoes,
not imported), as they are in the app. bridgeno longer refuses a Java, Kotlin or C# file because of an overloaded method. Every
overload of a name is kept in the original (the bindings name each export by its name
alone), but the duplicate-name check counted each kept overload, so the unit failed with "pad
is defined twice ... rename one of them" whileanalyzelisted it as ready. An overload set
kept in the original is now one name in one file, also when--keepnames it; other kept
functions that share a name still fail the check. C# blocked only the later overloads and
offered the first one for porting; it now keeps them all, as Java and Kotlin do, soanalyze
stops counting it as bridgeable, and it tells overloads apart by class:Json.Parseand
Xml.Parsein one file are no longer called overloads (bridgestill refuses them as one name
defined twice). The same overloaded name in two files of one unit is still refused.- Fixes from new contributors, each with a test:
/*inside a//comment no longer hides the Gradle dependencies after it (#222 by @XiaoBinGan).- The second
<script>block of a.vue,.svelteor.astrofile keeps its line numbers (#259 by @XiaoBinGan). - A huge
RUST_ANYTHING_COMMAND_TIMEOUT,RUST_ANYTHING_CASE_TIMEOUTorfuzz --timeis rejected or ignored
instead of panicking (#254, #278 by @XiaoBinGan). - The coverage line never rounds 999 of 1000 lines up to 100% (#283 by @XiaoBinGan).
- The card and
cleanprint values just under a unit boundary in the next unit, such as1.0 ms, not
1000.0 µs(#221, #253 by @XiaoBinGan). - Plans and
recordsay "1 line", "1 unit", "1 case" and "1 export" (#282 by @XiaoBinGan, #284 by @tridev-tej). - A wasm port switches on through its wrapper (#205 by @XiaoBinGan), and a Python float subclass is recorded as its
float value (#203 by @fullfud).
- Docs: every CLI flag and MCP parameter is described, and
--helpno longer calls the tool TypeScript-only
(#228, #236, #250, #258 by @XiaoBinGan); the FAQ names the two timeout variables (#230 by @Kiranpjk); CONTRIBUTING
lists every test file and what CI installs (#232 by @XiaoBinGan, #244 by @MikeFTV); the Spanish, Italian, French
and German READMEs describe the PHP and C# unit bridges (#234, #235, #251, #252, #276, #277 by @XiaoBinGan). - Thanks to @OnurrUgur (#206, #211, #212, #255), @fullfud (#203, #207), @XiaoBinGan, @tridev-tej, @ege-arhan (#224),
@Kiranpjk and @MikeFTV: 32 contributions from 7 people since 3.3.0.
v3.3.0
2026年11月22日
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.
v3.2.0
2026年11月22日
- Python
record --from-testskeeps the calls that pass arguments by keyword where Python does
not bind them by position: keyword-only parameters (def f(x, *, flag)) and an argument named
after a skipped default (f(x, fill='*')). They were dropped fromtest-inputs.jsonl; they
are now written with akwargsobject, which the driver already replays. - Python
diffandbenchpass keyword arguments to the Rust bindings under the bindings'
snake_case names (scaleBy=10asscale_by=10); a keyword-only parameter named in camelCase
failed every case withTypeError: unexpected keyword argument. A Python mismatch shows its
keyword arguments after the positional ones, as Ruby's does, so aknown-diffs.jsonlentry
forf(x)no longer explainsf(x, flag=True). - JS/TS
record --from-testsencodes the captured arguments with the codecrecordanddiff
use, instead of a copy of it that had fallen behind. ABufferwas captured as aUint8Array
(sob.toString('hex')recorded"104,105"), aFloat64Arrayor other typed array as an
object with numeric keys, and an object shaped like a marker ({ $date: 'x' }) was replayed as
aDate. A call is now left out, as one that passes a function or a cycle already was, when an
argument is a RegExp, an Error, aURL, anArrayBuffer, a boxed primitive or an object with
toJSON: those were captured as{}, their own fields or theirtoJSONresult, which replay
passed as a different value. A class instance is still captured as its own fields. analyzejudges each export with the same functionsbridgeuses. It had its own copy of
the rules and put units instart_herethatbridgethen refused ("every export ... must
stay in TypeScript/JavaScript"). The copy missed three of them: a JS unit's sibling.d.ts(a
callback declared there), a class method or constructor that takes a function, and a type
alias such astype Pat = RegExp. Such a unit is nowcautionand left out. Both commands
sharebridge::ts_functionsandbridge::class_reason, so in Python, Ruby, Java, Kotlin and
Goanalyzenow also checks class methods.
v3.1.0
2026年11月22日
-
gorunsbenchafter gate and switches a unit on only when it is not slower as its callers
call it; otherwise it stops atslowerwith the measured factor and where the speed is (the
batch class to call from the loop, or the caller to port with it). A wasm port called once per
item from a JS loop was 7.6x slower than the JIT, andgohad switched it on.goalso runs
refreshbefore building a crate with batches, so a<Name>Indexthe agent writes is used.
Both found by runninggo --agent claudeon a TS fixture (tests/fixtures/go-search-ts). -
wasm builds write
pkg/package.jsonwith"type": "commonjs": inside a"type": "module"
project Node loaded wasm-bindgen's CommonJS output as an ES module anddifffailed. -
profilebatches over the innermost loop: with nested loops it named the outer loop's
variable (--batch score:query) instead of the one that runs over the items. -
README: "Only the slow part" in all 20 translations. Website: "Only the slow part" and
"Switch on and off" pages (English). -
go: the hot-path loop in one command.rust-anything go --agent claude -- python3 app.py
profiles the workload, picks the outermost exported function of a portable unit that takes
arguments (bridged with--batchwhereprofileadvises it;--functionpicks another),
bridges it alone intorust/<function>-rs, records generated cases plus the calls the workload
makes, writesTASK.md, and hands the port to the agent (claude,codex, or any command
reading the prompt on stdin, with up to--roundsturns that get the failing cases back). It
then builds, diffs and gates, and switches the unit on withenableonly when every case
matches and gate passes. Without--agentit stops at the task; run it again after porting and
it keeps every finished step. Also an MCP tool. -
enableanddisable: switch a TS/JS or Python unit on in place, for every caller, with one
marked block in its original files that rebinds the ported functions to the Rust module (no
import changes, no absolute paths);disableremoves exactly those lines. The unit's
RUST_ANYTHING_UNIT_<NAME>=originalorRUST_ANYTHING_MODE=oldkeeps the original for a run,
andrecord,diff,benchandfuzzset it for the original's side.enablerefuses
while recorded cases differ (--force). Every switch is listed in one place,
Switch a port on and off. MCP tools too. -
report:report/REPORT.mdandreport/card.svgfor a pull request or README, in the v3
card's light style: the unit, recorded cases matched (diff), speedup with the call included
(bench), fallback rate, on or off, and the machine with its core count. MCP tool too. -
One build cache: ports and bridges build into one cargo target folder (
CARGO_TARGET_DIR, else
rust-anything/targetin the user's cache folder), so dependencies compile once. A package
name belongs to one crate folder there, so a second crate with the same name builds in its own
target/and cannot replace the first one's library; libraries are copied to each crate's
target/release.cleanremoves the folder (--dry-run,--forcefor aCARGO_TARGET_DIR).
Front doors keep their owntarget/. -
profilereportsportable,paramsand thebatchspec per hot function, and its workload's
stdout goes to stderr, so the MCPprofiletool no longer writes the workload's output into
the protocol stream. -
Python:
__all__was ignored when an earlier top-level statement held no assignment (a
docstring or an import, as in most modules), soanalyze,bridge, library ports and
profiletook every name without a leading underscore: names left out of__all__were
bridged and underscore names listed in it were dropped.__all__is now read after such
statements, with or without a type, follows__all__ += [...]and a later__all__ = [...],
and reads prefixed strings (r'name'). An__all__built or changed any other way
(+ other.__all__,sorted(...),__all__.extend(...), inside anifortryblock) falls
back to the names without a leading underscore rather than a partial list. Functions and
classes a module's__all__leaves out are no longer bridged. -
When
buildof a Ruby bridge fails with rb-sys'sStable API is needed but could not find a candidateand the Ruby rb-sys used (RUBY, elseruby) is older thandoctor's 3.0, the
error now ends with that Ruby's version anddoctor's install command (macOS's system Ruby is
2.6), instead of only rb-sys's hint to enablestable-api-compiled-fallback.
v3.0.0
2026年11月21日
-
packagemakes a whole Node CLI installable: pointed at a front door (rust/app), it lays out
a main npm package whose command runs the front door binary from<name>-<platform>(macOS
arm64 and x64, Linux x64 and arm64 with glibc, Windows x64), with the original as a dependency
pinned to the exact recorded version for every run the port hands back. A Node launcher runs
the binary (or the original where no binary fits, or withRUST_ANYTHING_MODE=old); outside
Windows a postinstall script puts the binary in its place, so a covered run starts no Node.
--binnames the commands,--original <package>@<version>the original when it is not in
the repository'snode_modules. A generated workflow builds and packs every platform. -
Front doors find the original next to themselves when installed: inside
node_modules, the
generatedoriginal.rsresolvesnode_modules/...fromRUST_ANYTHING_ORIGINAL_BASE(set by
the launcher) or the nearest folder above the binary, before the repository it was built in.
The Prettier and ESLint front doors carry the change. -
The ESLint port on npm as
eslint-rs(ESLint 10.15.0; macOS and Linux binaries, Windows runs
ESLint itself), the Prettier port packaged the same way asprettier-rsbut not published, and
.github/workflows/ports-npm.yml, which builds both front doors on every platform, packs them
withpackage, and checks the Linux install against the originals.
Installed from their tarballs on macOS arm64:prettier-rsreplays 17,224/17,224 recorded runs
at 7.9% fallback, through the binary and through the launcher;eslint-rsreplays
10,492/10,585, the 93 others printing ESLint's own install path, as ESLint 10.15.0 run from the
same install does (docs/packaging.md). The Prettier front door'sCargo.locknow lists
ignore, which--lockedbuilds needed. -
Prettier demo: about 75 differences from Prettier 3.6.2 outside the recorded corpus, found by
differential fuzzing, mutation testing and a Doc-level comparison, are fixed or handed to
Prettier. 355 new cases and the checks are indemo/real-world/prettier-rs/equiv. The
recorded corpus now runs 15,861 of 17,224 cases fully in Rust (7.9% fallback, was 15,837 and
8.1%). -
package(CLI and MCP tool) lays out a gated port as packages end users install, and writes
files only: PyO3 ports become a maturin project (an abi3 wheel importable under the original's
module name), napi ports the napi-rs per-platform npm layout (a main package with
optionalDependencieson<name>-<platform>, a loader that falls back to the original JS where
no binary fits), wasm ports one npm package. PyO3 and napi ports also get a GitHub Actions
workflow building macOS (arm64, x86_64), Linux (x86_64, aarch64) and Windows. Installed from
their packages,demo/fuzzy-napianddemo/fuzzy-rspass 2000/2000 recorded cases and
demo/fixtures/python-textkit-rs1144/1144 (docs/packaging.md). -
fuzz: a live differential test. It generates fresh inputs from a new seed (the record
generator, skipping inputs already recorded), runs them through the original and the built
port, and reports the mismatches the recorded cases missed.--cases Nper function,--seed S
(random by default and printed, so a run replays),--time SECSfor rounds until the budget is
spent, and--keep(--keep=all) appends the mismatching (all) fresh cases tocases.jsonlso
the nextdiffandgatecheck them. Works whereverrecordanddiffdo on this machine:
TS/JS, Python, C, Go, Ruby, Java and Kotlin. Also an MCP tool. -
record --pin-clock(TS/JS with the napi bridge, Python): units that read the clock or random
numbers can be recorded. While pinned (pinned.json, until--no-pin-clock), record, diff,
fuzz and gate run withRUST_ANYTHING_NOW_MS,RUST_ANYTHING_SEEDandTZ=UTC;Date.now(),
new Date(),Date()andMath.random(time.time,datetime.now,date.todayand the
randommodule) return that instant and a mulberry32 sequence restarted at every case. The port
reads the same values fromsrc/port/pinned.rs(now_ms(),random(),getrandbits(),
randbelow()), written by the first--pin-clock. Recordings without the flag are unchanged. -
analyze: reads of the clock and random numbers (Date.now(),new Date(),Math.random,
performance.now();time.time,datetime.now,random.*,uuid4) are a new low-severity
risk, "Clock and random numbers", whose advice points torecord --pin-clock. -
C bridge: structs of scalar fields cross by value, as parameters and returns (ffmpeg's
AVRational av_mul_q(AVRational b, AVRational c)). The struct is read from the project's
headers (typedef struct ... Name;orstruct tag), is a#[repr(C)]struct at the crate root
(crate::AVRational), and is an object of its fields in cases and recorded results. Structs
with a pointer, array, bit-field or nested struct field stay in C. -
C bridge: a
char **/const char **out-parameter that the function points into a string
argument (av_strstart(str, pfx, &ptr),strtol'sendptr) is recorded as the offset into
the firstcharstring or buffer parameter, and isOption<&mut Option<usize>>in the port.
In cases, give its starting offset,truefor aNULLstart, ornullfor aNULLpointer.
A**the function advances as its own string (av_get_token(const char **buf, ...)) still
stays in C, as does anything returning memory it allocates. -
record(C): generated cases give struct parameters objects of their fields (zeros, ones,
minus ones, each field's minimum and maximum, each field zero with the others one, and small
random values) instead of values that were recorded asTypeErrors, andchar **
parameterstrue,nullor offset 0. -
diff(C): a case where the original returned or wrote a pointer outside its arguments (read
past a string, say) is undefined behavior like a crash, and any answer of the port passes it. -
Case study: the ffmpeg ports add
av_mul_q,av_div_q,av_add_q,av_sub_q,av_d2q,
av_nearer_q,av_q2intfloat,av_rescale_q,av_rescale_q_rnd,av_strstartand
av_stristart; 226,447/226,447 recorded calls, gate passes on all 10 crates. -
diff(C): a case the original recorded as an error (an argument ctypes could not convert)
passes when the port gives the same error, instead of always failing. -
Contributors:
mise.tomlpins the toolchains CI uses, andhk.pklruns the secrets check,
cargo fmtandcargo clippybefore each commit (suggested by u/touristtam on Reddit). -
setup --no-backup: changes settings files in place without saving a
<file>.rust-anything.bakcopy first. -
record/diff(TS/JS): plain data shaped like a marker ({"$date": ...}, Mongo extended JSON)
is kept as data instead of being read as a Date, undefined or bigint, and a marker key next to
other keys is ordinary data. Write such an object in--inputsas{"$object": {...}}(#121). -
record/diff(TS/JS): typed arrays other thanUint8Array(Float64Array,Int32Array,
Uint8ClampedArray, ...) are recorded with their kind, so a port returning the wrong one
fails (#122). -
app replay: lines compared in any order are paired by value within--float-tolerance, not
by sorted position (#123, #125 by @sameermankotia). -
analyze(C): a unit depends on what its own header includes, soa.cthat reachesb()
througha.hwaits forb.c(#126). -
README: right under the tagline, it now says the tool doesn't translate code (your agent or you
write the Rust) and what PHP and C# support today. From a new-user QA review of the README by
Mashhood Ali, an independent AI evaluation and QA specialist
who tests products and docs the way a new user would (LinkedIn) (#118). -
app record --freshworks for CLIs: every case starts from a snapshot of the given files or
folders (kept inapp-cases/files/; a path ending in/gives its contents, so a whole project
can be the working directory), written files are what differs from it, and files a case
removes are recorded in<case>.removedand compared on replay. An--inputscase can also
"remove"files of the snapshot before it runs.--freshalone no longer implies--http. -
Front doors built by rust-anything find the original when
rust/is a symlink to a folder
outside the repository (RUST_ANYTHING_REPOis set at build time). -
Case study: ESLint 10.15.0 behind a Rust front door, 90 rules (
eslint:recommendedand 26
more), 10,585/10,585 recorded CLI runs at 3.6% fallback, gate passes oneslint-stdin-rs
(demo/real-world/eslint-rs,docs/real-world.md#eslint). -
bridgeandanalyzeread CommonJS exports:module.exports = { a, b: c },
module.exports.a = aandexports.a = a, for functions declared in the file. ESLint (and
most Node code before ESM) exports this way, so its units showed no functions to bridge. -
The
timestampsnormalizer also matches JavaScript'sDate#toString()
(Sat Nov 21 2026 01:30:12 GMT+0300 (...)). ESLint's HTML report stamps its time that way:
the two recording runs differed only in the seconds, so only the seconds became a wildcard and a
replay ten minutes later failed. -
Case study: ffmpeg's libavutil (n7.1), 10 units, 135,773/135,773 recorded calls, gate passes
on each (demo/real-world/ffmpeg-rs,docs/real-world.md#ffmpeg). -
C bridge: pointer parameters cross it with the original signatures. A
constbyte pointer
followed by an integer is a buffer of that length (&[u8]in the port); a byte pointer the
function writes, paired with the next integer or one named like a size, is&mut [u8]and its
contents after the call are recorded; a mutable pointer to one scalar isOption<&mut T>and
its value after the call is recorded; a returned pointer into a parameter is the offset into
it (Option<usize>). In cases, buffers are hex text (or a size, for that many zero bytes) and
length parameters are left out. Typedefs of scalars and enums resolve through the project's
headers. Found porting ffmpeg's libavutil, whose APIs all take pointers. -
C bridge: a port can take a
const char *asOption<crate::CChars<'_>>instead of
Option<&[u8]>: the bytes are read as the port goes, without thestrlenthe slice needs
first. Change the parameter's type inport.rsand runrefresh;lib.rsdefinesCChars
(an iterator over the bytes, withpeekandto_bytes) only when a port uses it. On short
words the twostrlencalls cost more than ffmpeg's wholeav_strcasecmp; withCCharsthe
port went from 0.23x to 0.68x of C's speed,av_stristrfrom 0.44x to 1.4x. -
recordandbenchfor C: a folder holding a header named like a C standard one (ffmpeg's
libavutil/time.h) is passed with-iquote, so<time.h>stays the system's; flags in
CFLAGSare added (-DHAVE_AV_CONFIG_H,-I<tree>). -
build,diff,bench,shadow,gate,refreshandrecordtake the crate path as
given and make it absolute:rust-anything build .on a C crate failed, since the compiler and
cargo run in a scratch folder. -
analyzefor C: files under a CPU-architecture folder (x86/,aarch64/,arm/, ...) stay
in C;gotono longer marks a unit blocked as dynamic code;#include "libavutil/x.h"
resolves when the folder analyzed islibavutilitself, so itstests/*.ccount as tests; a
unit with no bridgeable export gets a note about the C bridge instead of the JS one. -
gatefor C: the size check counts the project functions the ported functions call, since the
port does their work too. -
C
charparameters arec_charin generated code (signed or unsigned as the platform's C
char), notc_schar. -
doctoron Windows: a missingcargogets the C++ Build Tools, then
winget install Rustlang.Rustup, instead of thesh.rustup.rsscript, which needs a Unix shell.
The Build Tools come first because winget runsrustup-init -y, which skips them with a warning.
The Build Tools fix also adds the C++ workload (and the ARM64 tools on Windows on ARM): without
--add, winget installs them with no compiler, linker or Windows SDK. Since winget adds nothing
to Build Tools already installed, the fix also says how to add the workload by hand. A fix of
several commands prints one per line. -
analyze --whole-applists a library once when the code imports it under one name and the
manifest declares it under another (yamlandPyYAML,androidx.roomand
androidx.room:room-runtime,active_supportandactivesupport): names the crate table
resolves to the same row are one dependency. The JSON keepsname(the manifest's spelling
when declared) and addsnames, every spelling;declaredis true if any of them is, and
used_bycounts each unit once. The Markdown plan shows the other spellings next to the name.
Names the table does not know stay separate. -
analyze --whole-appreads declared dependencies from each language plugin's own manifest
parser instead of a second copy, soanalyzeand--whole-appagree, and every manifest in
the workspace counts, not only the root's (a dependency on another package of the workspace is
not an external one). The plugin parsers gained what only the copy had: Gradle and Maven
comments are skipped, a Gradle declaration on the same line asdependencies {is read,
requirements files follow-rincludes and skip VCS, URL and path lines, Poetry dependencies
count, a gem inside agroupblock is a development dependency, andadd_dependencyis read
on any receiver. TS/JS countspeerDependenciesandoptionalDependenciesas declared too.