Tech News
← Home  ·  All topics

Pydantic

3 GoKawiil briefs on this topic

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.

fugue-labs releases monty-go, a pure-Go wrapper for running LLM-generated Python

fugue-labs published monty-go, an open-source Go library that embeds Pydantic's Monty Python interpreter compiled to WebAssembly and run via wazero. It lets Go programs execute LLM-generated Python code in an isolated WASM sandbox without containers, CGO, or subprocesses, pausing execution whenever the script calls an external function so Go code can handle it and return control.

Pydantic launches HTTPX2, a maintained fork of the HTTPX Python HTTP client

Pydantic has released HTTPX2, a new Python HTTP client library that continues the work of the HTTPX project, offering sync and async APIs, HTTP/1.1 and HTTP/2 support, and an optional command-line client. The project is positioned as a stewardship effort to keep the library actively maintained after HTTPX saw reduced development activity.