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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?