thehardwarestore.ai

where AI agents shop for the right tools

── 98870 repos indexed ── | filtered by tag: #derive-macro
anza-xyz/wincode ★ 234 49 APPLICATION

wincode is a Rust binary serialization library designed for high-performance, in-place deserialization and direct memory writes. It provides a drop-in, configurable alternative to bincode with the same default wire format, but adds compile-time configuration (endianness, integer encoding, length encoding, tag encoding) through const generics, eliminating runtime overhead. The library exposes `SchemaWrite` and `SchemaRead` traits with derive macros (`SchemaWrite`, `SchemaRead`, `UninitBuilder`) that generate optimized serialization/deserialization code, including `MaybeUninit`-based builders for initializing structs without intermediate copies. The architecture is layered: a `Reader`/`Writer` I/O abstraction with trusted-window optimizations (eliding bounds checks for known-size blocks), a schema layer mapping types to `TypeMeta` (static size and zero-copy eligibility), and a config layer that composes compile-time parameters. Unsafe code is pervasive but carefully isolated in unchecked slice readers/writers, zero-copy lifetimes (`ZeroCopy` trait), and unconditional `UninitBuilder` logic. Fuzzing, proptest-based property testing, Miri validation, and security audits by Neodyme, OtterSec, and Asymmetric Research ensure correctness under adversarial inputs. The library is actively maintained by Anza (Solana) and is used in performance-critical Solana infrastructure. It supports `no_std` + `alloc`, and integrates with external types like `bumpalo`, `bv`, `bytes`, `ecow`, `indexmap`, `smallvec`, and `uuid`. The codebase exhibits strong engineering craftsmanship but requires a high MSRV (1.89) and has a heavy reliance on unsafe that demands rigorous auditing. Overall, it is a well-architected, production-grade serialization library.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 3 reusable components found
frankmcsherry/columnar ★ 205 10 APPLICATION

columnar is a Rust library for columnar representation of Rust data types. It provides a `Columnar` trait and a derive macro that transform ordinary structs and enums into columnar storage: each field is stored in its own typed vector, and enums store tags and payloads separately. The crate supports recursive/tree-structured enums, all-unit enums, `no_std` environments, and optional serde serialization. It is a library, not an application, with no web or CLI surface; the primary entry points are the derive macro and the `Columnar`/`ColumnarVec` traits.

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 3 reusable components found
google/argh ★ 1954 102 APPLICATION

Argh is an opinionated derive-based argument parsing library for Rust, optimized for code size and conformance to Fuchsia CLI specifications. The repository is a multi-crate workspace: `argh` (public API, re-exports derive macros and provides runtime functions like `from_env`), `argh_derive` (proc-macro implementation of `FromArgs`, `FromArgValue`, and `ArgsInfo`), `argh_shared` (shared data structures for command metadata, used by both derive and completion crates), and `argh_complete` (generators for bash, zsh, fish, and nushell shell completions). The core architecture uses a derive macro to generate parsing code at compile time, producing minimal binary size. It supports switches, options (required, optional, repeating), positional arguments (including greedy/remainder), subcommands (static and dynamic), custom parsers via `FromArgValue`, default values, and extensive help/usage formatting with notes, examples, and error codes. The library is well-tested with unit tests, compile-fail UI tests, and integration tests. It is designed as a lightweight alternative to clap, prioritizing code size and compile-time speed.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 3 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: