46

Purescript-native can now target Golang

 6 years ago
source link: https://www.tuicool.com/articles/YJne2yU
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

purescript-native now supports both Go and C++11 as intermediate languages.

The purescript-native “suite” comprises two utilites: pscpp and psgo . The two share transpiler code and a general design but function independently of one another. Foreign implementations are provided by either C++11 for pscpp or Go for psgo ; please see the standard library implementations purescript-native-cpp-ffi and purescript-native-go-ffi for examples. Even if you’re not fluent in C++ or Go, the code should look familiar if you’ve dealt with the javascript FFI (especially the Go versions).

The Go backend has feature parity with the C++11 one but hasn’t been exercised as much. Both pass all of the relevant standard purescript compiler tests .

In terms of transcompilation targets, C++11 has the advantage of platform ubiquity (including things like theArduino Uno) but Go is a simpler language, compiles quickly, has a built-in concurrent garbage collector, and has plenty of “batteries included” (such as reflection, Unicode strings and identifiers, and its own build system).


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK