evalexpr
A powerful arithmetic and boolean expression evaluator
13.1.0
9.5M downloads/mo
#3186 most downloaded on crates.io
ISibboI/evalexpr
What this package is like to depend on
Last release 9 months ago
26 Nov 2025
Ships unpredictably
gaps range from 2 weeks to 10 months
Nearly every release is documented
notes for 46 of 48 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
64 releases · first in 2019
3 releases in the last 12 months
see the full history below
Release timeline
64 releases · Mar 2019 to Nov 2025Releases
latest 60 of 64-
13.1.026 Nov 2025Release notes
Open source →Added
- Parse integers prefixed with
0bas binary and0oas octal (#194)
Contributors
My warmhearted thanks goes to:
- Parse integers prefixed with
-
13.0.029 Oct 2025Release notes
Open source →Added
- Function remove_value to HashMapContext (#189)
Contributors
My warmhearted thanks goes to:
-
12.0.324 Oct 2025Release notes
Open source →Fixed
- Add serde support to DefaultNumericTypes (#185)
Contributors
My warmhearted thanks goes to:
-
12.0.227 Dec 2024Release notes
Open source →Fixed
- Link to
ronformat in documentation (#177) - Use the correct
Valueconstruction functions in documentation (#178) - Add hint about new licensing also to notes for contributors.
- Fixed copy-paste error with the
Commentssection in documentation.
Contributors
My warmhearted thanks goes to:
- Link to
-
12.0.125 Oct 2024Release notes
Open source →Fixed
- Fixed the
math_consts_context!macro that was broken by in 12.0.0 (#173)
Contributors
My warmhearted thanks goes to:
- Fixed the
-
12.0.017 Oct 2024Release notes
Open source →Changed
evalexpris now licensed under the GNU Affero General Public License Version 3- Made the int and float types generic.
-
11.3.113 Oct 2024Release notes
Open source →Fixed
str::fromdoes not add double quotes around strings anymore, except if those are inside a tuple (#169)
Contributors
My warmhearted thanks goes to:
-
11.3.009 Dec 2023Release notes
Open source →Added
- Builtin function
str::substring(#158)
Changed
- The error type
WrongFunctionArgumentAmountnow expects a range of argument amounts instead of a single one (#159)
Fixed
- Minor error in README.
- Regex functions do not silently ignore superfluous arguments anymore.
Contributors
My warmhearted thanks goes to:
- Builtin function
-
11.2.017 Nov 2023Release notes
Open source →Added
- Functions
clear,clear_variablesandclear_functionstoHashMapContext(#156)
Contributors
My warmhearted thanks goes to:
- Functions
-
11.1.019 Aug 2023Release notes
Open source → -
11.0.126 Jul 2023Release notes
Open source →Notes
This should have been a minor release instead of a patch.
Added
- Methods to mutably iterate over operators (
Node::iter_operators_mut) and all types of identifiers (Node::iter_identifiers_mut,Node::iter_*_identifiers_mut) (#136)
Contributors
My warmhearted thanks goes to:
- Methods to mutably iterate over operators (
-
11.0.001 Jun 2023Release notes
Open source →Notes
- Due to the introduction of GATs, the MSRV changes to
1.65.0in this update.
Added
- Builtin function
math::abs(#130) - A CLI for evaluating expressions. Install via
cargo install evalexpr. (#133) - The ability to parse integers from hex literals (#131)
Changed
- The
IterVariablesContextfrom using a lifetime parameter to GATs (#135)
Contributors
My warmhearted thanks goes to:
- Due to the introduction of GATs, the MSRV changes to
-
10.0.021 May 2023Release notes
Open source →Added
- Builtin functions can now be disabled (#129)
Contributors
My warmhearted thanks goes to:
-
9.1.016 May 2023Release notes
Open source →Added
- Builtin functions
containsandcontains_any(#127)
Contributors
My warmhearted thanks goes to:
- Builtin functions
-
9.0.013 Apr 2023Release notes
Open source →Fixed
- Taking numbers to negative powers gave unexpected results (#120)
- Update MSRV to 1.56.1 (2021 edition release) to allow builds with the latest versions of all dependencies.
Contributors
My warmhearted thanks goes to:
-
8.2.013 Apr 2023Release notes
Open source →Added
EvalExprErrornow derivesClone(#116)
Changed
- Occurrences of
f64andi64have been replaced with the type aliasesFloatTypeandIntTypewhere applicable (#113)
Contributors
My warmhearted thanks goes to:
-
8.1.022 Jul 2022Release notes
Open source →Added
- Get all variables or variable/value pairs in a context via a new trait
IterateVariablesContext(#108) - Functions
iter_(read/write)_variable_identifiers, which iterate over allReadVariableIdentifiers or allWriteVariableIdentifiers in an operator tree (#110)
Contributors
My warmhearted thanks goes to:
- Get all variables or variable/value pairs in a context via a new trait
-
8.0.006 Jul 2022Release notes
Open source →Added
- Builtin functions to check for nan, infinity and subnormality in floats (#101)
- Builtin random function (#102)
- Implement
TryFrom<Value>for all types a value can hold (#105) - Split VariableIdentifier node into read and write variants (#106)
Contributors
My warmhearted thanks goes to:
-
7.2.016 Mar 2022Release notes
Open source →Added
- The builtin function
if, which mimics the if-else construct existing in many programming languages.
Contributors
My warmhearted thanks goes to:
- The builtin function
-
7.1.114 Mar 2022Release notes
Open source →Fixed
- Set regex minimum version to
1.5.5, as the previous versions contains a security vulnerability. See https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw?pli=1. This vulnerability does not affect this crate as of now, but if we ever allow passing parameters to the regex engine, it might.
- Set regex minimum version to
-
7.1.013 Mar 2022Release notes
Open source →Added
- Bit shift functions
shlandshr, same as Rust's shift functions oni64.
Contributors
My warmhearted thanks goes to
- Bit shift functions
-
7.0.120 Feb 2022Release notes
Open source →Changed
- Updated the optional dependencies, and fixed them to a minimum tested version. For simplicity, I fixed them to the newest version, but since I export none of them, this is luckily not breaking.
- Updated the dev-dependencies.
-
7.0.013 Jan 2022Release notes
Open source →Changed
- Made the
EvalexprErrorenumnon_exhaustive.
Fixed
- Expressions that have dangling parenthese expressions such as
4(5)now produce an error.
Contributors
My warmhearted thanks goes to
- Made the
-
6.6.013 Oct 2021Release notes
Open source →Added
- Bitwise operators as builtin functions
bitand,bitor,bitxor,bitnot(#88) - Public immutable and mutable accessor functions to the operator and children of a Node.
Contributors
My warmhearted thanks goes to
- Bitwise operators as builtin functions
-
6.5.016 Aug 2021Release notes
Open source →Added
- Make
Function::newable to accept closures (thanks to Jakub Dąbek)
Contributors
My warmhearted thanks goes to
- Make
-
6.4.021 Jul 2021Release notes
Open source →Notes
- Minimum supported Rust version (MSRV) increased to
1.46.0 - Increased test coverage by adding more test and ignoring untestable files
Added
- Allow scientific notation in float literals
Changed
- Made some functions
const. This increased the MSRV
Fixed
eval_numbermethods returnedEvalexprError::ExpectedFloatbefore, now they correctly returnEvalexprError::ExpectedNumber
Contributors
My warmhearted thanks goes to
- Minimum supported Rust version (MSRV) increased to
-
6.3.006 Jul 2021Release notes
Open source → -
6.2.024 Jun 2021Release notes
Open source →Notes
- Increased test coverage
Added
- Implemented
CloneforHashMapContext
Contributors
My warmhearted thanks goes to
-
6.1.122 Jun 2021 -
6.1.002 Jun 2021Release notes
Open source →Added
- Macro
math_consts_contextadding all of Rust'sf64constants - All common math functions implemented by Rust's
f64are now builtin - Continuous integration and test coverage report
Contributors
My warmhearted thanks goes to
- Macro
-
6.0.028 May 2021Release notes
Open source →Added
#![forbid(unsafe_code)]- Made
FunctionderiveClone - Ensure that
FunctionimplementsSendandSync
Removed
Cargo.lock
Changed
- Decomposed
ContextintoContext,ContextWithMutableVariablesandContextWithMutableFunctions - Replaced the
get_functionmethod ofContextwith acall_functionmethod
Contributors
My warmhearted thanks goes to
-
5.1.028 May 2021Release notes
Open source → -
5.0.513 Sep 2019Release notes
Open source →Fixed
- is-it-maintained badges had wrong repository definitions
- maintenance status was given wrongly
- move maintenance status to top
-
5.0.5-alpha.413 Sep 2019 pre-releaseNothing published for this version
-
5.0.5-alpha.313 Sep 2019 pre-releaseNothing published for this version
-
5.0.5-alpha.213 Sep 2019 pre-releaseNothing published for this version
-
5.0.5-alpha.113 Sep 2019 pre-releaseNothing published for this version
-
5.0.413 Sep 2019 -
5.0.330 Aug 2019Release notes
Open source → -
5.0.230 Aug 2019Release notes
Open source →Changed
- Removed target.bench.dev-dependencies completely, as they can be just listed under the normal dev-dependencies
-
5.0.130 Aug 2019Release notes
Open source →Fixed
- Bench dependencies are now dev-dependencies so they are not listed on crates.io as normal dependencies anymore
-
5.0.030 Aug 2019Release notes
Open source →Notes
Finally, 'Sanity' has been released, including a huge bunch of new features. Notably, and providing a reason for the name of this release, function call and tuple semantics have improved a lot. Functions now always take exactly one argument, but this can then be a tuple. It is now possible to construct tuples of tuples, such that mode complex values can be constructed. As of now there is no way to deconstruct them though.
A lot has been done on string processing, special thanks for that goes to bittrance. Specifically, under the feature flag
regex_supporttwo regex functions for strings are hiding now. Also, the operators+and comparison operators have been fitted to support strings.Thanks to lovasoa, we now have a nice macro for context creation.
Thanks to Atul9, the crate is now Rust 2018 compliant.
Thanks to mestachs' request, we now have functions to iterate over identifiers within an expression.
Internally, the structure of the operator tree changed from being
&dyn-based to beingenum-based. Also, we have benchmarks now to observe performance changes in future releases.Added
- Iterator over all identifiers within an expression, including duplicates
- Iterators over only variable or only function identifiers within an expression, including duplicates
- Overload the
+operator to concatenate strings - Overload
<,<=,>and>=for strings using lexical ordering (Note:==and!=compare strings as expected) - Add
len,str::regex_matches,str::regex_replace,str::to_lowercase,str::to_uppercase,str::trimfunctions for strings - Add a macro for more convenient definition of contexts including the direct definition of static contexts
- Add API for value decomposition
- Allow using context operations in
evalcalls without context - Operator assignment operators for each binary operation (
+=,-=, ...) - The
Operatorenum is now public for better error types - Benchmarks for observing performance of future releases
Removed
- Function arguments are not decomposed anymore. The function implementation will receive exactly one argument now. This allows the function to be called on a tuple properly.
Changed
- Operators are an enum now instead of trait objects
- Update to Rust 2018
- Updated dependencies
Fixed
- Allow variable assignments in eval calls without context.
A
HashMapContextis created automatically now. - The error string for
ExpectedNumberwas wrong - Operators panicked when adding a number to a string
- Some documentation was not updated for the 4.x releases
Contributors
My warmhearted thanks goes to
-
5.0.0-rc.230 Aug 2019 pre-releaseNothing published for this version
-
5.0.0-rc.129 Aug 2019 pre-releaseNothing published for this version
-
5.0.0-beta.129 Aug 2019 pre-releaseNothing published for this version
-
5.0.0-alpha.124 Apr 2019 pre-releaseNothing published for this version
-
4.1.031 Mar 2019 -
4.0.030 Mar 2019 -
3.1.028 Mar 2019Release notes
Open source →Added
- Add serde support to
HashMapContext - Make
HashMapContextderiveDefaultandDebug
Changed
- Changed name of serde feature flag to
serde_support
- Add serde support to
-
3.1.0-rc.228 Mar 2019 pre-releaseNothing published for this version
-
3.1.0-rc.128 Mar 2019 pre-releaseNothing published for this version
-
3.0.028 Mar 2019Release notes
Open source →Notes
The 3.0.0 update transforms the expression evaluator
evalexprto a tiny scripting language. It allows assignments and chaining of expressions. Some changes in this update are breaking, hence the major release.Added
- Methods
Node::eval_<type>_with_context_mutand crate leveleval_<type>_with_context_mut - Empty type and corresponding shortcut methods. The empty type is emitted by empty expressions or empty subexpressions
(). - The assignment operator
= - The expression chaining operator
;
Removed
- Generic arguments from
Contexttraits are now static to allow using trait objects ofContext EvalexprError::EmptyExpressionis not required anymore since empty expressions now evaluate to the empty type
Changed
- Merge
ContextMuttrait intoContexttrait
- Methods
-
3.0.0-rc.228 Mar 2019 pre-releaseNothing published for this version
-
3.0.0-rc.128 Mar 2019 pre-releaseNothing published for this version
-
2.0.028 Mar 2019Release notes
Open source →Notes
The 2.0.0 update is the first step to transform evalexpr to a tiny scripting language with support of at least variable assignment. The main change for now is that
Configurationis calledContext, which seems to be a more proper naming for a set of variables that can not only be read, but also manipulated via expressions. This update includes further renamings and some inconsistencies in the API were fixed. For more details, see the following subsections.Added
- Add the
ContextMuttrait, that is a manipulable configuration/context - Add
ContextNotManipulableerror variant for theEmptyContext - Make the
TupleTypealias public - Add the
ValueTypeenum that represents the type of a value for easier comparisons and matchings - Add
EvalexprResult<T>type that uses theEvalexprErrortype (renamed fromError) - Add
Node::eval_numberandNode::eval_number_with_contextto evaluate to int or float and silently converting to float - Add
eval_numberandeval_number_with_contextcrate methods to evaluate to int or float and silently converting to float
Changed
- Get rid of some unwraps to improve safety
- Rename
ErrortoEvalexprError - Rename
ConfigurationtoContext - Rename
HashMapConfigurationtoHashMapContextandEmptyConfigurationtoEmptyContext - Rename
Value::as_floattoValue::as_numberand add newValue::as_floatthat fails if value is an integer
- Add the
-
2.0.0-rc.127 Mar 2019 pre-releaseNothing published for this version
-
1.2.023 Mar 2019Release notes
Open source →Added
- Add
serdefeature - Implement
serde::de::DeserializeforNode - Document
serdeusage - Add custom error type with a
Stringmessage
Changed
- Highlighting in documentation
- Add
-
1.2.0-rc.123 Mar 2019 pre-releaseNothing published for this version
-
1.1.020 Mar 2019Release notes
Open source →Added
- Internal aliases
IntTypeandFloatTypeused by theValueenum are now public - Type alias
TupleTypeused to represent tuples was added - Error types like
Error::ExpectedIntfor expecting each value type were added - Shortcut functions like
eval_intoreval_int_with_configurationto evaluate directly into a value type were added - Documentation for the shortcut functions was added
- Functions to decompose
Values were added and documented
Removed
- Integration tests were removed from shipped crate
Fixed
- Wording of some documentation items was changed to improve readability
- Internal aliases
-
1.1.0-rc.120 Mar 2019 pre-releaseNothing published for this version