76 points · by eatonphil · 11y ago · 20 comments
Or, to the contrary, if one just wants to avoid the JVM, would it just be better to write Clojurescript?
That being said, having one binary to distribute and install is a very strong argument for Go VM languages.
This[1] allows you to write something resembling Scheme R5RS but with some Go extras like channels/co-routines, but no access to Go's stdlib.
I do not know why Go-routines would not work, though I have not tried yet.
Another difference from the lisp you brought up (and the one I'm more familiar with, glisp[1]) is that Gsp is compiled as opposed to interpreted. This would ostensibly have speed features.
I am interested to test how this fares compared to these other Go Lisps and Clojure.
Is it simply the difference of wrapping things up so that they... work?:
diff <(gsp hello.gsp) <(gisp hello.gsp)
4,7c4,5
< "github.com/gsp-lang/stdlib/fmt"
< "github.com/gsp-lang/gsp/core"
< "github.com/gsp-lang/stdlib/prelude"
< "github.com/gsp-lang/stdlib/net/http"
---
> "/fmt"
> "/net/http"
18,19d15
<
< var _ = prelude.Len
As far as I can tell, gisp doesn't produce go code that can be compiled.
But what good is the go code gisp produces? Can/should it be saved to
file and imported into another go program?cat hello.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 ":8080" nil)))
gisp hello.gsp package main
import (
"/fmt"
"/net/http"
)
func hello(w, r core.Any) core.Any {
fmt.Fprintf(w, "hello")
return nil
}
func main() {
http.HandleFunc("/", hello)
http.ListenAndServe(":8080", nil)
}
(Which go won't compile due to errors with imports, missing core.Any
etc).I realize hn isn't the best place to discuss issues, but if anyone have played with gisp, and could shed some light (eg: maybe gisp is go 1.4 only?) that'd be great.
Incidentlially gsp/gspc seems to work as intended. Maybe I'm misunderstanding the purpose of gisp?
If you continue to have issues and want to get it working correctly, feel free to email me.