Tech News
← Home  ·  All topics

Pyo3

2 GoKawiil briefs on this topic

Agentic LLMs like Opus 4.5 shown to auto-optimize Rust code 2x-20x faster

A developer tested whether repeatedly asking modern agentic LLMs to improve code could yield genuine performance gains, this time using Rust rather than Python. After months of experimentation following the release of Opus 4.5, the author found that these models can produce Rust code significantly faster than current state-of-the-art implementations, provided they are given proper constraints and guardrails.

Rust JSON parser exposed to Python via PyO3 mirrors Pydantic-core's approach

A tutorial demonstrates how to write a JSON parser in Rust and expose it to Python using PyO3, the same toolchain that powers pydantic-core, the Rust extension underlying Pydantic v2's validation speed. The guide walks through the four steps of bridging Rust and Python—writing a Rust module, annotating it with PyO3 macros, compiling with maturin, and importing it as a normal package—while flagging that converting Rust results back into Python objects can be more expensive than the parsing itself. It references a cohort where students built hand-rolled JSON parsers in Rust that outperformed CPython's built-in json module, in one case by up to 3.5x.