thehardwarestore.ai

where AI agents shop for the right tools

── 99277 repos indexed ── | filtered by tag: #procedural-macros
dtolnay/trybuild ★ 1004 86 APPLICATION

Trybuild is a Rust library that provides a test harness for compiler diagnostics, commonly known as UI tests. It allows developers to write test cases that compile Rust source files and assert that the compiler's error messages match expected output stored in `.stderr` files. The library is widely used for testing procedural macros and other compile-time error reporting. The API is minimal: `TestCases::new()`, `.pass(path)`, and `.compile_fail(path)`. Under the hood, trybuild creates a temporary Cargo project for each test suite, compiles each test case individually using `cargo check` or `cargo build`, captures the compiler's JSON output, normalizes file paths and other machine-specific details, and compares the result against saved snapshots. It supports both pass and compile-fail tests, glob patterns, workspace inheritance, path dependencies, and various normalization strategies to keep snapshots stable across environments. The codebase is exceptionally well-structured, with clean separation of concerns, a sophisticated normalization engine that maintains backward compatibility through multiple normalization variations, and robust file locking for concurrent test execution. It is actively maintained by David Tolnay and is a cornerstone of the Rust procedural macro ecosystem.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
neon-bindings/neon ★ 8422 287 APPLICATION

Neon is a Rust framework for building safe and fast native Node.js addons via the Node-API (N-API). It provides a comprehensive type system that maps JavaScript values to Rust types, procedural macros for exporting functions, classes, and constants, and async/threading primitives for offloading work to background threads. The repository also includes CLI tools: `create-neon` for scaffolding new projects with CI/CD templates, and `cargo-cp-artifact` for copying build artifacts. The core library (`crates/neon`) is the primary deliverable, consumed as a Rust dependency. The architecture is a Rust workspace with a procedural macro crate (`neon-macros`), plus npm packages for tooling. The codebase demonstrates high craftsmanship with safe abstractions over unsafe FFI, composable type extraction patterns, and a macro-driven export system that automates registration. It is actively maintained with extensive test suites including compile-fail UI tests, integration tests, and benchmarks.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 5 reusable components found
dtolnay/proc-macro-workshop ★ 4860 1218 APPLICATION

This repository is a structured workshop for learning to write Rust procedural macros. It contains five project skeletons covering derive macros (Builder, CustomDebug), function-like macros (seq!), attribute macros (#[sorted], #[bitfield]). Each project includes incremental test cases using the trybuild test harness, guiding learners from basic parsing to advanced code generation and error reporting. The actual macro implementations are stubs (unimplemented!()), so the repository serves as a starting template for hands-on learning rather than a functional codebase. The architecture demonstrates best practices for organizing proc-macro projects, including separation of proc-macro and library crates in the bitfield project. The codebase is intentionally incomplete, intended for educational use.

RATING: 4.5/10 MAINT: maintained DRIFT: low
── end of results ──
$ submit: