2.7 KiB
List of open-source packages I used
thiserror
License: Apache 2.0 or MIT
Helps derive Error for aggregate errors, although I eventually stopped trying to do so as it was simpler to just treat error types as bags of data about the failure.
chumsky
License: MIT
A fantastic parser combinator that allowed me to specify things like the nuanced conditions under which a float token can be promoted to an uint token in a declarative way. In hindsight passes after tokenization could have been written by hand, tokenized Orchid is not that hard to parse into an AST and it would have probably made some tasks such as allowing . (dot) as a token considerably easier.
hashbrown
License: Apache 2.0 or MIT
Google's swisstable. Almost perfectly identical to HashMap in std, with a couple additional APIs. I use it for the raw entry API which the generic processing step cache requires to avoid unnecessary clones of potentially very large trees.
mappable-rc
License: Apache 2.0 or MIT
A refcounting pointer which can be updated to dereference to some part of the value it holds similarly to C++'s shared_ptr. Using this crate was ultimately a mistake on my part, in early stages of development (early stages of my Rust journey) I wanted to store arbitrary subsections of an expression during macro execution without dealing with lifetimes. Removing all uses of this crate and instead just dealing with lifetimes is on the roadmap.
ordered-float
License: MIT
A wrapper around floating point numbers that removes NaN from the set of possible values, promoting < and > to total orderings and == to an equivalence relation. Orchid does not have NaN because it's a silent error. All operations that would produce NaN either abort or indicate the failure in their return type.
itertools
License: Apache 2.0 or MIT
A utility crate, I use it everywhere.
smallvec
License: Apache 2.0 or MIT
small vector optimization - allocates space for a statically known number of elements on the stack to save heap allocations. This is a gamble since the stack space is wasted if the data does spill to the heap, but it can improve performance massively in hot paths.
dyn-clone
License: Apache 2.0 or MIT
All expressions in Orchid are clonable, and to allow for optimizations, Atoms have control over their own cloning logic, so this object-safe version of Clone is used.