Screenshot of the calculator GUI and REPL with some expressions.
Back to Projects

Expressive Calculator REPL and GUI

July 2024 - August 2024

Tags

    RustTauriConsoleDesktop

About

A calculator built in Rust that evaluates math expressions by parsing them into abstract syntax trees. It supports binary operators such as addition, multiplication, exponentiation, and modulus, following the order of operations. It supports constants such as `pi` and `e`. It also supports several mathematical functions such as `sqrt`, `sin`, `exp`, `log`, etc. To provide an interface for the library, a command-line REPL and a GUI were created. The REPL allows users to enter expressions and see the result. The GUI was built with Tauri and provides a more user-friendly interface. Both store previous expression results in variables like `$ans`, `$0`, and `$1` for easy access.

External Links

Images

Screenshot of the calculator GUI and REPL with some expressions.Screenshot of the REPL running in Windows with some expressions.