Re:(Yet Another) Lisp in Go
by funstuff007 on Sunday May 08, 2022 @08:19PM
(#31309255)
Given their similar concurrency stories, I've felt that the Go VM (is it GVM?) made a better match for Clojure. Of course, Clojure was released before Go so not a real possibility at the time.
[ Parent
| on HN ]
Re:(Yet Another) Lisp in Go
by jonahbenton on Sunday May 08, 2022 @08:55PM
(#31309409)
I thought so too, and worked on this for a while, but Clojure compiles at runtime, while Go does source generation then compiles at build time. I found what was essentially a Clojure-to-Go source transpiler to be surprisingly limited.
Re:(Yet Another) Lisp in Go
by funstuff007 on Wednesday May 11, 2022 @07:30PM
(#31347337)
How is that any different from Clojurescript, which because the Google Closure build step, does not allow for any run-time macros?
Go doesn't have a VM, it is always pre-compiled to native binaries specific to the target architecture/platform you want to run it on.
It also generally speaking doesn't have an intermediate representation that you could target directly, because it does a lot of optimization directly on the GO AST. Though you might be able to have a different language compile to its SSA directly, but it would not be easy at all.
The GO runtime also doesn't allow for any dynamic code loading, so you wouldn't be able to have a REPL.
Re:(Yet Another) Lisp in Go
by funstuff007 on Wednesday May 11, 2022 @07:32PM
(#31347358)
Yes, strictly speaking you are correct. I guess I consider any language that has built-in GC as effectively a VM (i.e. there's a lot of code being lugged around you don't control).