Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattn/golisp
Lisp Interpreter
https://github.com/mattn/golisp
golang lisp lisp-interpreter
Last synced: 4 days ago
JSON representation
Lisp Interpreter
- Host: GitHub
- URL: https://github.com/mattn/golisp
- Owner: mattn
- License: mit
- Created: 2020-03-27T09:56:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-06T13:11:51.000Z (almost 2 years ago)
- Last Synced: 2024-10-23T06:07:20.506Z (13 days ago)
- Topics: golang, lisp, lisp-interpreter
- Language: Go
- Homepage:
- Size: 251 KB
- Stars: 132
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome - mattn/golisp - interpreter pushed_at:2022-11 star:0.1k fork:0.0k Lisp Interpreter (Go)
- go-awesome - golisp - `Lisp` interpreter (Open source library / Interpreter)
README
# golisp
![CI](https://github.com/mattn/golisp/workflows/CI/badge.svg)
Lisp Interpreter
## Usage
```shell
$ golisp < foo.lisp
```## Installation
```shell
$ go get github.com/mattn/golisp/cmd/golisp
```## Features
### Call Go functions.
Print random ints.
```lisp
(setq time (go:import 'time))
(setq rand (go:import 'math/rand))
(.Seed rand (.UnixNano (.Now time)))
(print (.Int rand))
```### Use goroutine/channel
```lisp
(setq time (go:import time))
(let ((ch (go:make-chan string 1)))
(go
(.Sleep time 1e9)
(go:chan-send ch "3")
(.Sleep time 1e9)
(go:chan-send ch "2")
(.Sleep time 1e9)
(go:chan-send ch "1")
(.Sleep time 1e9)
(go:chan-send ch "Fire!")
)
(print (car (go:chan-recv ch)))
(print (car (go:chan-recv ch)))
(print (car (go:chan-recv ch)))
(print (car (go:chan-recv ch)))
)
```## TODO
* macro
## License
MIT
## Author
Yasuhiro Matsumoto (a.k.a. mattn)