Skip to content

Commit

Permalink
docs: enhance the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Aden-Q committed May 9, 2024
1 parent 9468476 commit e20bc47
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

Monkey is an interpreted language written in Go. *This project is still under development.*

## Demo
## Dependencies

### Functions
+ `direnv`
+ `just` (not necessary)
+ Go 1.21+
+ ginkgo (if you want to run local unit tests)
+ golangci-lint (if you want to do local lint)

Anonymous function and function binding:
## Usage

Open your shell, then REPL ready for you:

```bash
~ just run
__,__
.--. .-" "-. .--.
/ .. \/ .-. .-. \/ .. \
Expand All @@ -20,7 +27,17 @@ Anonymous function and function binding:
\ \ '~' / /
'._ '-=-' _.'
'-----'
Hello zecheng! This is the Monkey programming language!
Hello xxx! This is the Monkey programming language!
>>>
```

## Demo

### Functions

Anonymous function and function binding:

```bash
>>> fn(x, y) { return x * y; } (5, 6);
30
>>> let add = fn(x, y) { return x + y; };
Expand All @@ -33,30 +50,10 @@ Hello zecheng! This is the Monkey programming language!
Simple if condition with an else branch:

```bash
__,__
.--. .-" "-. .--.
/ .. \/ .-. .-. \/ .. \
| | '| / Y \ |' | |
| \ \ \ 0 | 0 / / / |
\ '- ,\.-"""""""-./, -' /
''-' /_ ^ ^ _\ '-''
| \._ _./ |
\ \ '~' / /
'._ '-=-' _.'
'-----'
Hello zecheng! This is the Monkey programming language!
>>> if (10 > 5) { 5; } else { 10; };
5
```
## Dependencies
+ `direnv`
+ `just` (not necessary)
+ Go 1.21+
+ ginkgo (if you want to run local unit tests)
+ golangci-lint (if you want to do local lint)
## Conventions and Features
+ Programs can run in REPL or as scripts
Expand Down

0 comments on commit e20bc47

Please sign in to comment.