3 ms·
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?
by amelius 11y ago
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?
- sbinet 11y agostate. 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 https://github.com/sbinet/igo) nor the one built on top of LLVM (llgoi: http://llvm.org/viewvc/llvm-project/llgo/trunk/cmd/llgoi/ http://llvm.org/viewvc/llvm-project/llgo/trunk/cmd/llgoi/)