Add README.md, small additions

This commit is contained in:
Apache 2024-06-21 21:16:57 -05:00
parent a39914bc35
commit 07a6d69dbe
Signed by: apache
GPG key ID: 6B10F3EAF14F4C77
6 changed files with 106 additions and 12 deletions

View file

@ -2,5 +2,6 @@
name = "holy_lisp"
version = "0.1.0"
edition = "2021"
authors = ["Apache <apache.software.foundation@gmail.com>"]
[dependencies]

30
README.md Normal file
View file

@ -0,0 +1,30 @@
# Holy Lisp
<img src="./assets/holy_lisp.svg" alt="Holy Lisp Logo" width="100">
An opinionated lisp implementation developed in the most intuitive way I could come up with.
## Features
### Lists with a function as the **first element** are evaluated when needed
```lisp
(print (add 1 2)) ; => 3
(print (1 2 3)) ; => (1 2 3)
```
### Quoted lists are **not evaluated**
```lisp
(print '(add 1 2)) ; => '(<function add> 1 2)
```
### Elements within quoted lists can be unquoted
```lisp
(print
'(add
1 ,(sub 3 1)
)
) ; => '(<function add> 1 2)
```

65
assets/holy_lisp.svg Normal file
View file

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="200"
height="200"
viewBox="0 0 52.916667 52.916666"
version="1.1"
id="svg1"
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
sodipodi:docname="holy_lisp.svg"
inkscape:export-filename="holy_lisp.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:showpageshadow="false"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:deskcolor="#505050"
inkscape:document-units="px"
showborder="true"
labelstyle="default"
inkscape:clip-to-page="true"
inkscape:zoom="4"
inkscape:cx="64.125"
inkscape:cy="107.375"
inkscape:window-width="1920"
inkscape:window-height="991"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
id="path8"
style="fill:#d6af46;fill-opacity:1;stroke:none;stroke-width:0.358584"
d="m 12.05775,8.6112417 c 9.124696,-7.366724 22.333413,-6.6775948 30.641981,1.5986563 8.970994,8.971014 8.970995,23.515912 10e-7,32.486924 C 42.3473,43.022229 41.984755,43.336506 41.612644,43.63921 37.100709,47.109584 30.580116,46.817638 26.45627,42.697189 22.021071,38.261127 21.954802,30.987154 26.302434,26.486613 l -0.0095,-0.0095 c 0.03357,-0.02876 0.06694,-0.05775 0.100122,-0.08697 4.485724,-4.485533 4.485726,-11.758292 -1e-6,-16.243827 C 22.498755,6.2518505 16.505866,5.743428 12.057747,8.611236 Z" />
<path
id="circle8"
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.179292"
d="m 10.212808,10.209898 c 0.58621,-0.5652085 1.202059,-1.0988492 1.844942,-1.5986563 4.448126,-2.867813 10.440999,-2.3593947 14.335303,1.5350763 4.485737,4.485544 4.485735,11.758283 1e-6,16.243826 -0.02517,0.0297 -0.08263,0.08801 -0.09064,0.09644 -4.347641,4.500551 -4.281371,11.774506 0.153838,16.210577 4.134425,4.131031 10.678664,4.415448 15.191818,0.916809 -9.078149,8.038955 -22.841226,7.637399 -31.435258,-0.91715 -8.9710021,-8.971022 -8.9710017,-23.515903 2e-6,-32.486925 z"
sodipodi:nodetypes="ccccccccc" />
<path
id="rect1"
style="fill:#000000;fill-opacity:1;stroke-width:0.293789"
d="m 37.722987,13.487549 v 5.191414 h -5.262211 v 1.695504 h 5.262211 v 11.861291 h 1.669665 V 20.374467 h 5.29115 v -1.695504 h -5.29115 v -5.191414 z" />
<path
id="path2"
style="fill:#d6af46;fill-opacity:1;stroke-width:0.293789"
d="m 15.22441,39.233976 v -5.191414 h 5.262211 V 32.347058 H 15.22441 v -11.86129 h -1.669665 v 11.86129 H 8.2635962 v 1.695504 h 5.2911498 v 5.191414 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

8
src/lib.rs Normal file
View file

@ -0,0 +1,8 @@
mod tokenizer;
pub use tokenizer::*;
mod parser;
pub use parser::*;
mod executor;
pub use executor::*;

View file

@ -1,11 +1 @@
; This is a comment
(print
(add
(div
4.5
(sub 0.5 0.2)
)
(mul 21 0.05)
)
)
(print '(add 1 2))