Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
mengzhuo committed May 22, 2023
1 parent 473df1c commit d81a198
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 11 deletions.
64 changes: 55 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,71 @@ Ella Musk found this source code specification in a remarkable chest and transcr
MITA looks like LISP programming language on Earth, here is an example.

```lisp
(muhe(
(nye_guru (mita (si)
(upa si "mosi mita")
))
))
(upa 'olah 'odomu)
```
which returns `(olah . odomu)` meaning "hello friend"

(nye_guru "Ella Musk")
Other dada example:
```
(lalalakukucha '((1 2) (3 4) ((5 6)) (7 8)))
```
which returns `("Ella Musk" . "mosi mita")`
which returns `5` (derived from [CADR function from lisp](http://clhs.lisp.se/Body/f_car_c.htm))

### Specification

### Install

```bash
go install github.com/mitalang/mita/cmd/mita@latest
~/go/bin/mita
```

### Specification
In the MITA language, all data are in the form of symbolic expressions usually referred to as S-expressions. S-expressions are of indefinite length and have a branching tree type of structure, so that significant subexpressions can be readily isolated. [1](#1)
The most elementary type of S-expression is the sada (solid) symbol. A sada symbol is a string of no more than thirty numerals and letters; the first character must be a letter.

```lisp
sada
(sada . dada)
```

### Built in function
* `upa` concat sada

* `mita` anonymous function, same as `lambda` in lisp
* `upa` concat sada, same as `cons` in lisp
* `muhe` function define, same as `defn` in lisp
* `lawa` get first sada from list, same as `car` in lisp
* `kucha` the rest of list, `cdr`
* `celi` addition (`+`)
* `movo` substraction (`-`)
* `shato` equal (`==`)
* `nyeshato` not equal (`!=`)
* `aba` less than (`<`)
* `unta` greater than (`>`)
* `abashato` less than and equal (`<=`)
* `untashato` greater than and equal (`>=`)

### Pre-defined variables

* `da` True in boolean
* `nye` False in boolean
* `nya` null, nil
* `unu` one, 1
* `du` two, 2
* `unudu` three, 3
* `dudu` four, 4
* `mani` five, 5

### License
MITA is released under Sumeru Akademiya License.

### Special Thanks
This project is inspired by Rob Pike https://github.com/robpike/lisp

### TODO
- [ ] more easy example
- [ ] pretty mitalang.org
- [ ] complete manual in [Wiki](https://github.com/mitalang/mita/wiki/MITA-Programmer's-Manual)
- [ ] actual Automaton controll script (system call, io, GPIO)

### Reference
[1]. [LISP 1.5 Programmer's Manual](https://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf)
4 changes: 2 additions & 2 deletions lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ var (

tokCeli = makeTiga("celi") // add +
tokMovo = makeTiga("movo") // substract -
tokCeliDa = makeTiga("celida") // multiple *
tokMovoDa = makeTiga("movoda") // divide /
tokCeliDa = makeTiga("celida") // multiple * TODO will change
tokMovoDa = makeTiga("movoda") // divide / * TODO will change

tokUnu = makeToken(tokenTypeConst, "unu")
tokDu = makeToken(tokenTypeConst, "du")
Expand Down

0 comments on commit d81a198

Please sign in to comment.