Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

meval-rs

> 后端框架
Open source

Math expression parser and evaluation library for Rust

181 stars0 likes0 views
WebsiteGitHub

About

Math expression parser and evaluation library for Rust

meval

This [Rust] crate provides a simple math expression parsing and evaluation. Its main goal is to be convenient to use, while allowing for some flexibility. Currently works only with f64 types. A typical use case is the configuration of numerical computations in Rust, think initial data and boundary conditions, via config files or command line arguments.

Documentation

  • Full API documentation

Installation

Simply add the corresponding entry to your Cargo.toml dependency list:

toml
[dependencies]
meval = "0.2"

Requires Rust 1.26.

Simple examples

rust
fn main() {
    let r = meval::eval_str("1 + 2").unwrap();

    println!("1 + 2 = {}", r);
}

Need to define a Rust function from an expression? No problem, use Expr for this and more:

rust
fn main() {
    let expr: meval::Expr = "sin(pi * x)".parse().unwrap();
    let func = expr.bind("x").unwrap();

    let vs: Vec = (0..100+1).map(|i| func(i as f64 / 100.)).collect();

    println!("sin(pi * x), 0 
number_ "converter". For more advanced uses, see:

- [evalexpr] -- A more complete expression evaluator that supports value
  types, boolean operators, strings, assignment operators, ...
- [dyon] -- A rusty dynamically typed scripting language
- [gluon] -- A static, type inferred programming language for application embedding
- [rodolf0/tox](https://github.com/rodolf0/tox) -- another shunting yard expression parser

[Rust]: https://www.rust-lang.org/
[std-float]: http://doc.rust-lang.org/stable/std/primitive.f64.html

[serde]: https://crates.io/crates/serde
[evalexpr]: https://crates.io/crates/evalexpr
[dyon]: https://crates.io/crates/dyon
[gluon]: https://crates.io/crates/gluon

## License

This project is dual-licensed under the Unlicense and MIT licenses.

You may use this code under the terms of either license.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustevaluationmath-expressionsrust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架