gsp

The gsp compiler.

  • 所有者: gsp-lang/gsp
  • 平台:
  • 许可证: Other
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Gsp

Gsp is a compiler built on top of Joseph Adams' Gisp.
Gsp provides a more complete language environment, including Golang bindings
and the Gsp Prelude.

Install

go get github.com/gsp-lang/gsp
cd <GOPATH>/src/github.com/gsp-lang/gsp
go build
echo 'export PATH=$PATH:"${pwd}"' >> ~/.profile
. ~/.bashrc # . ~/.zshrc

Build Prelude

cd <GOPATH>/src/github.com/gsp-lang/stdlib/prelude
gsp prelude.gsp > prelude.go

Example

; Copy into example.gsp
(ns main
    "/fmt"
    "/net/http")

(def hello (fn [w r]
    (fmt/fprintf w "hello")
    ()))

(def main (fn []
    (http/handle-func "/" hello)
    (http/listen-and-serve ":9090" nil)))

To compile & run

gspc example.gsp
./bin/main

Using the Prelude

(ns main
	"/fmt")

(def main (fn []
    (let 
        (fmt/println (/car (/cons 1 /null)))
        (fmt/println (/len (/cons 1 /null)))
        (fmt/println (/car (/map (fn [x] (+ x 20)) m)) (/car m))
        (fmt/println (/len m))
        (fmt/println (/car (/cons 17 m)))
        (fmt/println [1 2 3 4])
        (fmt/println (/car (/cdr (/cdr (/append m (/cdr m))))))
        ())))

More examples

Check out the Prelude. It is written in Gsp.

License

Originally licensed code can be found at https://github.com/jcla1/gisp.

MIT

主要指标

概览
名称与所有者gsp-lang/gsp
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证Other
所有者活动
创建于2015-09-27 14:28:38
推送于2015-09-30 18:41:40
最后一次提交2015-09-30 12:41:10
发布数0
用户参与
星数177
关注者数5
派生数4
提交数19
已启用问题?
问题数0
打开的问题数0
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?