A radix tree (prefix tree) implementation for the Crystal programming language, optimized for URL routing and path matching.
Radix is a radix tree implementation for the Crystal programming language. It provides an efficient prefix tree data structure for storing and retrieving values associated with string keys, solving the problem of fast path matching and URL routing in web applications and other string-based lookup scenarios.
Crystal developers building web frameworks, routers, or applications requiring efficient path matching, URL routing, or prefix-based key-value storage.
Developers choose Radix for its type-safe payloads, performance optimizations for Crystal, and clean API inspired by established router implementations, making it a reliable foundation for routing and path-matching logic.
Radix Tree implementation for Crystal
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports generic payload types like Symbol or Int32 with compile-time checking, ensuring error-free associations as demonstrated in the usage examples.
Extracts named parameters and glob patterns during lookup, enabling flexible URL routing with placeholder support as shown in the documentation.
Leverages Crystal's performance characteristics and idioms, making tree operations fast and idiomatic for Crystal applications.
Adapted from established Go and Java router implementations, providing a reliable and tested foundation for routing logic.
Cannot handle two different named parameters at the same tree level, causing SharedKeyError and restricting certain routing patterns, as admitted in the caveats.
Requires explicit building and integration of the tree, which can be error-prone and time-consuming compared to declarative or convention-based routing solutions.
Tied exclusively to the Crystal ecosystem, which has a smaller community and fewer third-party resources than more popular languages like JavaScript or Python.