The library provides a simple interpreter, which can be used for some grammars
recognized by [arithmetic-parser
] (e.g., real-valued and complex-valued arithmetic).
The interpreter provides support for native functions,
which allows to overcome some syntax limitations (e.g., the lack of control flow
can be solved with native if
/ loop
functions).
In general, the interpreter is quite opinionated on how to interpret language features. The primary goal is to be intuitive for simple grammars (such as the aforementioned real-valued arithmetic), even if this comes at the cost of rendering the interpreter unusable for other grammars. Universality is explicitly not the design goal.
The interpreter is quite slow – 1–2 orders of magnitude slower than native floating-point arithmetic.
Please see the crate docs for the examples of usage.
Licensed under the Apache-2.0 license.