-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling to Go? #43
Comments
As would I. Unfortunately I quickly realized that was impractical. Lisp is too weakly typed, in contrast to Go's strong typing. However there is a partial solution for critical parts, if you "hand compile", so to speak. Write the speed sensitive components with state in Go structs, and then wire them together with zygo scripts. zygo lets you call native Go methods on those structs. So when invoked, your compiled components run at native Go speed. https://github.com/glycerine/zygomys/blob/master/tests/event.zy shows this (as does the main Snoopy and friends example https://github.com/glycerine/zygomys/blob/master/zygo/demo_go_structs.go). Search for the central If you really need a full fledged lisp with JIT compiler, in a separate project, I made chez scheme bindings that let you invoke chez scheme from Go. Chez is way more built out that zygo, but the integration with Go is very light. At its best Chez is maybe 3x slower than compiled Go, in my quick and dirty benchmarks. That may well be good enough for some things. |
I'll leave this open as a question. |
How does ferret-lang.org manage to compile to C++? |
How did Stalin? Bigloo? Gambit? Only with alot of work. |
I saw a comment in a ticket from a few years ago here:
In particular, you say "This supports the eventual aim of enabling trivial compile-down to actual Go code" ... was progress ever made on that?
I would love to be able to write Lisp, have it compiled to Go, with all the speed benefits ;-)
The text was updated successfully, but these errors were encountered: