Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/droptheplot/yal
Yet another Lisp transpiler to Go source code
https://github.com/droptheplot/yal
go golang lisp lisp-compiler lisp-variant
Last synced: 12 days ago
JSON representation
Yet another Lisp transpiler to Go source code
- Host: GitHub
- URL: https://github.com/droptheplot/yal
- Owner: droptheplot
- License: mit
- Created: 2017-09-10T13:38:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-15T23:49:08.000Z (about 6 years ago)
- Last Synced: 2023-02-27T15:38:04.758Z (almost 2 years ago)
- Topics: go, golang, lisp, lisp-compiler, lisp-variant
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yal
Yet another Lisp [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler) to Go source code.
[![GoDoc](https://godoc.org/github.com/droptheplot/yal?status.svg)](https://godoc.org/github.com/droptheplot/yal)
[![Go Report Card](https://goreportcard.com/badge/github.com/droptheplot/yal)](https://goreportcard.com/report/github.com/droptheplot/yal)## Usage
```shell
git clone https://github.com/droptheplot/yal
cd yal
go build
./yal -path hello.yal
```## Example
**input.yal**
```go
(package "main")(import "fmt")
(func main () ()
(fmt.Println (mul 2 3)))(func mul ((a int) (b int)) (int)
(* a b))
```**output.go**
```go
package mainimport "fmt"
func main() {
fmt.Println(mul(2, 3))
}func mul(a int, b int) int {
return a * b
}
```## Disclaimer
This is a fun project and is not meant to be used anywhere.
## Features
- Declarations (`func`, `var`, `package`, `import`)
- Arithmetics (`+`, `-`, `*`, `/`, `%`)
- Comparisons (`<`, `>`, `<=`, `>=`, `==`, `!=`)
- Boolean operators (`&&`, `||`)
- Slice operations (`map`)
- Control flow statements (`if`, `switch`, `return`)