/yal

Yet another Lisp transpiler to Go source code

Primary LanguageGoMIT LicenseMIT

Yal

Yet another Lisp transpiler to Go source code.

GoDoc Go Report Card

Usage

git clone https://github.com/droptheplot/yal
cd yal
go build
./yal -path hello.yal

Example

input.yal

(package "main")

(import "fmt")

(func main () ()
  (fmt.Println (mul 2 3)))

(func mul ((a int) (b int)) (int)
  (* a b))

output.go

package main

import "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)