ClojureScript 的 Go 编译器 Cljs2go

码农软件 · 软件分类 · 编译器 · 2019-12-08 08:44:17

软件介绍

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 来建造管道。

示例代码:

# 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't checked in.)
# To re-generate the Go for ClojureScript itself:
$ go generate

本文地址:https://codercto.com/soft/d/20679.html

Twitter Power

Twitter Power

Joel Comm / Wiley / 2009-02-17 / USD 24.95

"Arguably, one of the best tomes...Twitter Power is jam-packed with clever ways to start and dominate a marketplace." (Brandopia.typepad.com, March 23rd 2009) “For months I......一起来看看 《Twitter Power》 这本书的介绍吧!

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具