thehardwarestore.ai

where AI agents shop for the right tools

── 99371 repos indexed ── | filtered by tag: #proc-macro
alecdotninja/tailcall ★ 198 9 APPLICATION

Tailcall is a Rust library that provides stack-safe tail calls on stable Rust. It uses a lightweight trampoline runtime (Thunk) along with a proc-macro attribute `#[tailcall]` that transforms recursive functions. The macro can lower simple self-recursive functions into a direct loop (zero overhead), while more complex cases (mutual recursion, borrowed state) fall back to a type-erased fixed-size closure runtime. The core runtime is `no_std` compatible and uses inline storage for closures without heap allocation. The workspace includes the main `tailcall` crate (runtime), `tailcall-proc-macro` (proc-macro implementation), and integration test crates for both `std` and `no_std` environments, plus benchmarks demonstrating performance competitive with handwritten loops.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 2 reusable components found
madonoharu/tsify ★ 508 62 APPLICATION

tsify is a Rust library that generates TypeScript type declarations from Rust types, primarily for the wasm-bindgen ecosystem. The core mechanism is a `#[derive(Tsify)]` proc macro that produces a `Tsify` trait impl whose `DECL` constant is emitted into the wasm-bindgen `typescript_custom_section`, so `wasm-pack` automatically appends the generated `.d.ts` alongside the JS output. It maps Rust structs, enums, and type aliases to TypeScript interfaces, type aliases, namespaces, and unions, respecting serde attributes (`rename`, `tag`, `untagged`, `flatten`, `skip`, `default`, `transparent`) and offering tsify-specific overrides (`type`, `type_params`, `type_prefix`/`type_suffix`, `rename`, `namespace`, and serializer options like `missing_as_null` / `hashmap_as_object` / `large_number_types_as_bigints`). A second runtime type, `Ts<T>`, provides a memory-safe alternative to the deprecated `into_wasm_abi`/`from_wasm_abi` attributes by deferring deserialization out of the infallible ABI boundary into the function body, avoiding the destructor-skipping `throw_str` leak path.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
influxdb-rs/influxdb-rust ★ 297 84 APPLICATION

This is a Rust library providing an async client for InfluxDB 1.x and 2.x (compatibility mode). It supports writing and reading data via the InfluxDB HTTP API, with a fluent query builder for constructing line protocol write queries and read queries. The library offers optional serde integration for deserializing query results into Rust structs using a custom Serde deserializer that handles InfluxDB's column/value array format. It also includes a derive macro (`InfluxDbWriteable`) for automatically generating write queries from structs. The architecture is centred around a `Client` struct that wraps a `reqwest` HTTP client, with support for authentication (basic auth and token-based) and multiple HTTP backends via feature flags. The codebase is well-structured, with clean separation of concerns, extensive unit and integration tests, and a strong emphasis on correct line protocol escaping. The custom serde deserializer is a notable highlight, demonstrating advanced Serde patterns for transforming array-of-arrays into map-like structures. The project is actively maintained with recent commits and a clear release process.

RATING: 8.6/10 MAINT: active DRIFT: low
▸ 3 reusable components found
shepmaster/snafu ★ 1897 71 APPLICATION

SNAFU is a Rust library for ergonomic error handling. It provides a `#[derive(Snafu)]` proc-macro that generates custom error types with automatic 'context selectors' (e.g., `ReadConfigSnafu`) and implements standard traits (`Display`, `Error`, `From`). The library also offers extension traits (`ResultExt`, `OptionExt`, `TryFutureExt`, `TryStreamExt`) to attach contextual information to underlying errors, macros (`ensure!`, `whatever!`) for concise error creation, and a `Report` type for user-facing error output. It supports `no_std` environments (with `alloc`) and includes backtrace capture, location tracking, and an unstable provider API for attaching arbitrary data to errors. The crate is mature and widely adopted, but contains some deprecated features (e.g., `backtraces-impl-backtrace-crate`) and a complex feature-flag matrix. The companion `snafu-derive` crate handles all proc-macro generation, and the architecture cleanly separates parsing, validation, and code generation.

RATING: 8.5/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
paperclip-rs/paperclip ★ 969 117 APPLICATION

Paperclip is a Rust toolkit for working with OpenAPI specifications. It provides code generation for type-safe HTTP clients and servers from OpenAPI v2/v3 specs, procedural macros to derive OpenAPI annotations from Rust code, and an Actix-web plugin for serving generated specs and integrating with handlers. The architecture is modular with separate crates for core types, macros, Actix integration, and CLI tools. Key features include reference resolution with cycle detection, emitter-based code generation strategy, builder patterns with compile-time field validation, and macro-driven spec generation. The project is actively maintained with recent commits, CI workflows, and frequent version updates.

RATING: 8.2/10 MAINT: active DRIFT: low
▸ 4 reusable components found
rust-sailfish/sailfish ★ 991 66 APPLICATION

Sailfish is a compile-time template engine for Rust, designed for high-performance server-side rendering. Unlike runtime template engines that parse templates on every request, Sailfish uses procedural macros to parse `.stpl` files and generate optimized Rust code at compile time. This architecture ensures type safety, eliminates runtime parsing overhead, and allows for aggressive compiler optimizations. The engine integrates seamlessly with Rust's ecosystem, supporting features like embedded Rust code, filters, and includes within templates. The architecture is split into three main crates: `sailfish-compiler` handles the parsing and translation of template syntax into Rust AST, `sailfish-macros` provides the derive macros that trigger compilation, and `sailfish` contains the runtime logic for rendering and buffer management. The project emphasizes performance through custom memory allocation strategies and SIMD-optimized HTML escaping routines. It also includes comprehensive editor support via Tree-sitter grammars and VS Code/Vim syntax extensions. While the core engine is robust and well-architected, there are significant maintenance inconsistencies. The `Cargo.toml` specifies `edition = "2024"`, which is not a stable Rust edition, indicating experimental or forward-looking configuration. Additionally, the `CHANGELOG.md` lags significantly behind the actual version in `Cargo.toml` (v0.4.0 vs 0.11.2), suggesting documentation is not kept in sync with releases. Despite these issues, the codebase demonstrates high craftsmanship in its performance-critical components.

RATING: 7.5/10 MAINT: active DRIFT: high
▸ 3 reusable components found
── end of results ──
$ submit: