Crates.io | rcalc |
lib.rs | rcalc |
version | 0.1.2 |
source | src |
created_at | 2017-12-21 21:24:24.534254 |
updated_at | 2017-12-26 22:18:42.61893 |
description | Glorified calculator with a lexer, parser, and interpreter written in Rust. |
homepage | https://github.com/ayazhafiz/rcalc |
repository | https://github.com/ayazhafiz/rcalc.git |
max_upload_size | |
id | 43890 |
size | 36,135 |
rcalc
is a glorified calculator written in Rust that incorporates the
fundamentals of building any programming language, including a
lexer, parser,
Abstract Syntax Tree, and
AST traverser.
git clone https://github.com/ayazhafiz/rcalc.git && cd rcalc
make # places rcalc in /usr/bin/local
rcalc # launches interactive shell
$ rcalc> ...
Currently, rcalc
supports
Todo
CLI
Access to input historyCLI
Hiding of control charactersLOGIC
Integer divisionLOGIC
Modulo operatorLOGIC
Factorial operatorLOGIC
Trigonometric functionsOTHER
More to come!rcalc
is both a binary and a library. This makes
it trivial to use the rcalc
library in any other application.
The library is hosted under one namespace, with separate modules for independent components of the calculator "interpreter".
The binary is entirely dependent on the library.
I was interested in learning (1) Rust and (2) how to create a programming language. I started off with Ruslan Spivak's tutorial on the latter matter, eventually deciding to work a bit more on his calculator application in the pursuit of making something fairly formidable and original in Rust. This repository is the result of that effort. Hopefully, the quality of Rust code in this application will reflect my progressive improvement in the language.