Automating C to Rust Porting with LLMs: A Surprisingly Effective Strategy

2025-06-18

This post details the author's experience automating the porting of C code to Rust using large language models (LLMs). After experimenting with several approaches, a strategy based on topological ordering and fuzz testing proved highly effective. Symbols in the C code were topologically sorted, then the LLM generated Rust versions of each symbol along with fuzz tests. Output comparison verified correctness. This successfully ported the Zopfli compression library from C to Rust with identical results. While not fully automated, this dramatically reduced cost and effort, offering a new approach to large codebase maintenance and upgrades.

Read more
(rjp.io)

The Illusion of a Universal Problem-Solving Method

2025-06-12

This article reflects on problem-solving approaches, using Sudoku solvers as a case study. It contrasts the test-driven development (TDD) approach of Ron Jeffries, which involved significant effort, with Peter Norvig's concise and efficient solution. The author argues against a universal problem-solving method, emphasizing the importance of choosing the right tools and continuously learning new ones. Drawing parallels to the Entscheidungsproblem, the article highlights the role of insight and experience, and shares the author's personal problem-solving techniques.

Read more
(rjp.io)

The Exploration vs. Exploitation Dilemma for Programmers

2025-06-01

The author recounts an experience using Claude Code to port C code to Rust, where they became so engrossed in fixing a specific problem that they lost sight of their original goal. This led to a reflection on the common programmer's dilemma: balancing exploration (trying new approaches) with exploitation (solving the immediate problem). The author shares their strategy for managing this: a ritual of reflection at various time scales, such as a minute each hour to note progress, a weekly review of direction, and an annual career reflection. This approach helps prevent getting stuck in a rut and makes sure time and energy are well spent.

Read more
(rjp.io)
Development