cherry-lisp/README.md

80 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2021-01-28 01:16:30 +00:00
# Cherry Lisp
2021-01-30 22:16:48 +00:00
```text
2021-01-28 01:16:30 +00:00
/\
2021-01-30 22:14:19 +00:00
| \ A tiny, curried and lazy Lisp.
2021-01-28 01:16:30 +00:00
@ @
2021-01-30 22:14:19 +00:00
```
## Curried? Lazy?
Currying consists in convert **one function** that takes **multiple arguments** into **multiple functions** that each take a **single argument**.
*WIP*
Lazyness is when an expression is only evaluated **when is necessary**.
## Features
- Interpreted
- Dynamic typed
- Functional (impure)
- Curried
- Lazy evaluation
- It's a Lisp
2021-01-28 01:16:30 +00:00
2021-01-30 22:14:19 +00:00
## Inspiration
This language is being created for fun.
It takes inspiration of some features of *Haskell* (like currification and lazy evaluation) and the syntax of *Lisp*.
## A small taste
``` lisp
cherry> (set! x 10)
nil
cherry> x
10
cherry> (const 3 6)
3
cherry> (set! always-seven (const 7))
nil
cherry> (always-seven 1)
7
cherry> (always-seven 8)
7
2021-01-28 01:16:30 +00:00
```
2021-01-30 22:14:19 +00:00
## Download and build instructions
Install the *stack* build tool. On *Debian* based systems, run (as root):
2021-01-30 22:16:48 +00:00
```text
2021-01-28 23:24:05 +00:00
# apt install haskell-stack
2021-01-30 22:14:19 +00:00
```
Clone the repo:
2021-01-30 22:16:48 +00:00
```text
2021-01-28 23:24:05 +00:00
$ git clone https://git.fai.su/Suguivy/cherry-lisp
2021-01-30 22:14:19 +00:00
```
Compile it:
2021-01-30 22:16:48 +00:00
```text
2021-01-28 23:24:05 +00:00
$ cd cherry-lisp
2021-01-30 22:14:19 +00:00
$ stack upgrade
2021-01-28 23:24:05 +00:00
$ stack build
2021-01-30 22:14:19 +00:00
```
Install and execute it:
2021-01-30 22:16:48 +00:00
```text
2021-01-28 23:24:05 +00:00
$ stack install
$ cherry
```
2021-01-30 22:14:19 +00:00
*Work in progress...*