A crappy calculator written in Rust
Just enter an expression, and it will be evaluated
Note
This project is created purely for learning purposes. It's a simple implementation to understand basic concepts of parsing, lexing, and interpreting expressions, and Rust. Don't expect production-grade features or performance!
You can start using the calculator by cloning the repository and running the following commands:
git clone git@github.com:arikchakma/crappy.git
cd crappy
cargo build --release
./target/release/crappy
# Start the REPL
--------------------
Crappy Calculator!
--------------------
Enter an expression to evaluate:
Type '/bye' to quit.
>> 2 + 2
4
>> 10 * 5
50
>> /bye
Bye!
- Basic Arithmetic Operations (
+
,-
,*
,/
,^
) - Integer number support
- Simple expression evaluation
- Interactive command-line interface
- MIT licensed
- Add floating-point number support
- Implement multi-line expression support
- Add environment variables support
- Improve error messages and user feedback
Feel free to submit pull requests, create issues, or spread the word.
- Writing an Interpreter in Go by Thorsten Ball
- JavaScript Parser in Rust by Oxc
- Simple but Powerful Pratt Parsing by Matklad
MIT © Arik Chakma