github erkamyaman/rust-anything v3.1.0

53 minutes ago
  • go runs bench after gate and switches a unit on only when it is not slower as its callers
    call it; otherwise it stops at slower with 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, and go had switched it on. go also runs
    refresh before building a crate with batches, so a <Name>Index the agent writes is used.
    Both found by running go --agent claude on a TS fixture (tests/fixtures/go-search-ts).

  • wasm builds write pkg/package.json with "type": "commonjs": inside a "type": "module"
    project Node loaded wasm-bindgen's CommonJS output as an ES module and diff failed.

  • profile batches 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 --batch where profile advises it; --function picks another),
    bridges it alone into rust/<function>-rs, records generated cases plus the calls the workload
    makes, writes TASK.md, and hands the port to the agent (claude, codex, or any command
    reading the prompt on stdin, with up to --rounds turns that get the failing cases back). It
    then builds, diffs and gates, and switches the unit on with enable only when every case
    matches and gate passes. Without --agent it stops at the task; run it again after porting and
    it keeps every finished step. Also an MCP tool.

  • enable and disable: 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); disable removes exactly those lines. The unit's
    RUST_ANYTHING_UNIT_<NAME>=original or RUST_ANYTHING_MODE=old keeps the original for a run,
    and record, diff, bench and fuzz set it for the original's side. enable refuses
    while recorded cases differ (--force). Every switch is listed in one place,
    Switch a port on and off. MCP tools too.

  • report: report/REPORT.md and report/card.svg for 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/target in 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. clean removes the folder (--dry-run, --force for a CARGO_TARGET_DIR).
    Front doors keep their own target/.

  • profile reports portable, params and the batch spec per hot function, and its workload's
    stdout goes to stderr, so the MCP profile tool 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), so analyze, bridge, library ports and
    profile took 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 an if or try block) 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 build of a Ruby bridge fails with rb-sys's Stable API is needed but could not find a candidate and the Ruby rb-sys used (RUBY, else ruby) is older than doctor's 3.0, the
    error now ends with that Ruby's version and doctor's install command (macOS's system Ruby is
    2.6), instead of only rb-sys's hint to enable stable-api-compiled-fallback.

Don't miss a new rust-anything release

NewReleases is sending notifications on new releases.