Skip to content

Thin wrapper on top of evalexpr (rust crate) for command line calculation.

License

Notifications You must be signed in to change notification settings

mcsamdev/fascia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fascia

Version: 0.1.1

fascia is a thin command-line REPL wrapper around the Rust crate evalexpr. It provides a simple interactive interface for evaluating expressions, defining variables, and creating functions.

The goal is to expose evalexpr functionality through a clean CLI without unnecessary abstractions.


Features

  • Interactive expression evaluation
  • Variable definitions (var / let)
  • User-defined functions
  • Built-in math, trigonometric, and logarithmic functions
  • Minimal overhead (delegates evaluation to evalexpr)
  • MIT licensed

Installation

Via Cargo

cargo install fascia

Via Git/Source

git clone <https://github.com/mcsamdev/fascia>
cd fascia
cargo install --path . --locked --force

Usage

To start the repl simply run fascia in the terminal.

Commands

Calculator Commands: ─────────────────────────────────────────────────────────────

  • <expression> Evaluate an expression directly
  • var <name> = <expr> Define a variable
  • let <name> = <expr> Define a variable (alias)
  • func <name>(<args>) -> <expr> Define a function
  • list Show all variables and functions
  • help Show this help message
  • quit / exit Exit the calculator

Built-in Functions

  • Math: abs, floor, round, ceil, pow(x, y), min(a, b), max(a, b)
  • Trig: sin, cos, tan, asin, acos, atan, sinh, cosh, tanh
  • Logs: sqrt, exp, ln, log2, log10
  • Constants: pi, e

Examples

sqrt(16)
sin(pi / 2)
pow(2, 8)

var x = 10
x * 3

func double(n) -> n * 2
double(5)

func sqr(x) -> sqrt(x)

Cli Flags

--help or -h or help Show help information --version or -v or version Show version information bench Time expression evaluation in microseconds

About

Thin wrapper on top of evalexpr (rust crate) for command line calculation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages