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

Open Data Structures

Open Data Structures

Pat Morin / AU Press / 2013-6 / USD 29.66

Offered as an introduction to the field of data structures and algorithms, Open Data Structures covers the implementation and analysis of data structures for sequences (lists), queues, priority queues......一起来看看 《Open Data Structures》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

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

HEX CMYK 互转工具