Cljs2go ClojureScript 的 Go 编译器 Cljs2go

xuanbao • 1016 次点击    
这是一个分享于 的项目,其中的信息可能已经有所发展或是发生改变。
Cljs2go 是 ClojureScript 转换为 Go 的编译器。 ClojureScript 转换到 Go,不是分支出来,而是直接覆盖到 ClojureScript 上。Go 是从 cljs.go.compiler 上发行出去,而 cljs.go.compiler 是 cljs.compiler 的一个补丁版本。在运行时,会提供简单的 JS 兼容以避免接触 cljs.core,这些 js 和 goog 包不打算对用户开放使用。 一旦编译器开始工作,该计划将提供第二个猴子补丁(monkey patch),这回是提供 Java 依赖,像 java.io.File 和其他 Clojure 副本,clojure.java.io。此补丁可以将编译器本身编译成 Go。这既不会改变运行时编译程序的特点,也不会引入 eval,它只是充分利用了 Go 来建造管道。 示例代码: <pre class="brush:cpp ;toolbar: true; auto-links: false;"># Clone and build the Go packages: $ go get github.com/hraberg/cljs2go # The repo itself lives under src by convention: $ cd $GOPATH/src/github.com/hraberg/cljs2go # go test, for Go tests checked into git, both generated and handwritten ones: $ go test -v ./... # To re-generate the tests from ClojureScript (this might dirty the repo): $ lein test # (This also generates and runs some tests under target/generated which aren&#39;t checked in.) # To re-generate the Go for ClojureScript itself: $ go generate</pre>
授权协议:
开发语言:
Google Go 查看源码»
操作系统:
跨平台
1016 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传