Skip to content

v1.3.0: port your code to Rust

Choose a tag to compare

@morganlinton morganlinton released this 26 Oct 00:32
· 8 commits to main since this release

BeautifulRust now ports existing code to Rust, and the repo is ready for contributors.

New: the rust-port skill

Ask your agent to port a module ("port parser.c to Rust", "rewrite this Python service in Rust") and it:

  • reads the original and its tests, and ports the tests first, so the port is proven against the original's own behavior
  • designs a Rust API instead of transliterating: NULL and None become Option, error codes and exceptions become an error enum, out-parameters become return values, flag ints and magic strings become typed values, and dict insertion order becomes an ordered collection instead of a HashMap that would silently reorder output
  • keeps the port proportionate: it uses Rust's standard library rather than reimplementing the source language's string and number handling, and documents exotic differences instead of coding around them
  • verifies with cargo test and clippy, and writes a PORTING.md mapping the old API and tests to the new ones, with every deliberate difference listed

It covers C, C++, Python, Go, JavaScript, and TypeScript.

How it tested

Ported a C config parser and a Python task scheduler, each with its original test suite, with and without the skill:

With skill Without
Checks passed 22 of 22 19 of 22
Python port size vs. original 3.1x 5.8x
Reimplemented Python's string and number semantics No Yes

Without the skill, the model already ports correctly: every port built, passed its tests, and was clippy-clean, and both C ports matched the original byte for byte on 20 tricky inputs. The skill's contribution is restraint. Without it, the Python port hand-copied splitlines, strip, int(), and repr() and grew a dozen extra public methods. One run per configuration.

New: contributor guidelines

CONTRIBUTING.md centers on one rule: every rule needs a published source. There are issue templates for proposing a rule and for reporting a review false positive, which become new eval cases.

Full details are in the changelog. Update a Claude Code install with claude plugin update beautiful-rust; for other agents, re-run your install command.