Skip to content

Commit

Permalink
update to v0.2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Furkan <[email protected]>
  • Loading branch information
Dentrax committed Sep 12, 2020
1 parent 36faeba commit d854799
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[package]
name = "Monkey"
version = "0.1.0"
name = "monkey"
version = "0.2.0"
authors = ["Furkan <[email protected]>"]
edition = "2018"
keywords = ["interpreter"]
license = "MIT"

[dependencies]
byteorder = "1.3.4"

[[bin]]
name = "benchmark"
path = "src/benchmark.rs"
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

[![Build](https://travis-ci.org/Dentrax/Monkey.svg?branch=master)](https://travis-ci.org/Dentrax/Monkey)

**Yet another Monkey interpreter implementation in Rust, based on Thorsten Ball's [Writing An Interpreter In Go](https://interpreterbook.com/) book.**
**Yet another Monkey interpreter & compiler implementation in Rust, based on Thorsten Ball's [Writing An Interpreter In Go](https://interpreterbook.com/) and [Writing A Compiler In Go](https://compilerbook.com/) books.**

## Features
* AST
* Tokenizer
* Parser
* Lexer
* Evaluator
* Compiler
* SymbolTable
* VirtualMachine
* Builtin Functions
* Functions & Closures
* Read–Eval–Print Loop

## Usage
Expand All @@ -20,18 +24,18 @@

### 2. Test

```rust
cargo test --all
```sh
$ cargo test --all
```

### 3. Run

```rust
cargo run
```sh
$ cargo run --bin monkey
```

```bash
Monkey Interpreter v0.1.0
Monkey Compiler v0.2.0
>>> "Hello, " + "World!"
Hello, World!
>>>
Expand Down Expand Up @@ -130,9 +134,19 @@ let getAge = fn(person) { person["name"]; };
return getAge(people[0]) + getAge(people[1]);
```

## Benchmark

```sh
$ cargo run --release --bin benchmark -- --vm
$ cargo run --release --bin benchmark -- --eval
```

## TODO
- [ ] Impl Compiler
- [ ] Impl VM
- [X] Impl Compiler
- [X] Impl VM
- [ ] Add Pipeline with Stages: `fmt`, `check`, `clippy`, `test`, `build`
- [ ] Optimize overall performance
- [ ] Fix `clippy` warnings

## License

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use monkey::repl;

fn main() {
//Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
println!("{name} Interpreter v{version}",
println!("{name} Compiler v{version}",
name = env!("CARGO_PKG_NAME"),
version = env!("CARGO_PKG_VERSION"),
);
Expand Down

0 comments on commit d854799

Please sign in to comment.