about summary refs log tree commit diff stats
path: root/lisp/js/README.md
blob: 9060998c1b72485df17dc409c11c82f4cb0c620b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# a little lisp 

Most of this lifted from <https://github.com/maryrosecook/littlelisp>, <https://maryrosecook.com/blog/post/little-lisp-interpreter>.

To run interactively:

```bash
node repl.js
```

To run in the browser: 

```html
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>lisp</title>
	<script src="lisp.js" type="text/javascript"></script>
</head>
<body>
	<script>
		const ret = lisp.run(
			`(print 
				(+ 3 3))`
			);
	</script>
</body>
</html>
```

`lisp.run()` is a convenience, it wraps `lisp.interpret(lisp.parse())`. 

See also: 

- <https://github.com/hundredrabbits/Ronin>
- <https://github.com/lctrt/nanolisp/>