Re:Proposal for a Go Interpreter
by amelius on Monday September 07, 2015 @05:35AM
(#10180717)
Go is one of the fastest compilers around. I think compile-speed was one of the design-goals. Hence, what additional benefit would an interpreter have?
[ Parent
| on HN ]
state.
as I said elsewhere in this HN thread, many of the first REPLs that appeared when Go was first released used this rather effective scheme of recompiling on the fly a single main.go file after each new input the user entered and re-running the whole thing.
nothing's wrong with that except that you accumulate side-effects:
gorepl> f := func() { launchMissiles(); fmt.Printf(">>> missiles launched\n") }
gorepl> f()
>>> missiles launched
gorepl> var a = 2
>>> missiles launched
gorepl> fmt.Printf("oops!\n")
>>> missiles launched
oops!
that's not the kind of REPL I want, and that's not what "my" REPL does (https://github.com/sbinet/igo) nor the one built on top of LLVM (llgoi: http://llvm.org/viewvc/llvm-project/llgo/trunk/cmd/llgoi/)