Crates.io | squiid-engine |
lib.rs | squiid-engine |
version | |
source | src |
created_at | 2025-03-11 19:14:07.725631+00 |
updated_at | 2025-03-12 04:06:19.702534+00 |
description | Squiid Engine is an RPN mathematical engine written in Rust |
homepage | |
repository | https://gitlab.com/ImaginaryInfinity/squiid-calculator/squiid-parser |
max_upload_size | |
id | 1588353 |
Cargo.toml error: | TOML parse error at line 21, column 1 | 21 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Squiid Engine is the core computational engine for Squiid Calculator, designed for efficient and precise mathematical computations using Reverse Polish Notation (RPN). It is implemented in Rust to ensure high performance and safety.
This library serves as the backend for Squiid Calculator, handling all mathematical operations, stack management, and evaluation logic. While Squiid Engine natively operates on RPN expressions, it can be paired with squiid-parser for converting algebraic expressions into RPN.
unwrap()
/expect()
cargo add squiid-engine
use squiid_engine::{execute_multiple_rpn, get_stack};
fn main() {
// Execute an RPN expression: 3 + (5 * 7)
let result = execute_multiple_rpn(vec!["3", "5", "7", "multiply", "add"]);
assert!(result.get_error().is_none());
let stack = get_stack();
assert_eq!(stack[0].value.unwrap(), "38");
}
Squiid Engine is licensed under GPLv3.
To compile the shared object file for use in bindings, just run install Rust and run cargo build --release --lib --features=ffi
. The shared object file should be found in target/release/libsquiid_engine.so
.