Someone Made Prettier 19× Faster Using Rust #rustlang #prettier #programming
A project called rust-anything demonstrates a Rust port of Prettier that is reported to be 19x faster while preserving byte-identical output. Its real value is a workflow for AI-assisted ports: record behavior from the original implementation, replay cases against the Rust rewrite, and block acceptance until outputs match. The emoji/UTF-16 example shows how it catches semantic bugs that ordinary unit tests miss.
- The headline speedup matters less than equivalence: byte-for-byte output comparison gives a concrete correctness target for ports.
- Behavioral replay catches cross-language semantic differences, such as JavaScript counting emoji as two UTF-16 code units while the Rust port counted one.
- rust-anything gates AI-generated Rust against recorded behavior from the original implementation instead of trusting translation or normal unit tests alone.