Any good Go REPL implementation / tool?
Posted on In QAGo lang is fast to compile and can be used as a script by go run prog.go
. However, a REPL is more convenient for testing/trying some small pieces of code. Any good Go REPL implementation / tool?
Try gore https://github.com/motemen/gore
Get gore
$ go get -u github.com/motemen/gore
An example
$ gore
gore version 0.2.6 :help for help
gore> :import fmt
gore> fmt.Println("hello world!")
hello world!
13
nil
gore>
The most complete Go REPL I read about is llgoi – see https://groups.google.com/forum/#!msg/golang-nuts/tBzpDtzNXq8/nUZDKx7J3fIJ
It’s a full compiler based on LLVM that creates compiled code **in RAM** and then executes it.
For a more traditional approach, my gomacro http://github.com/cosmos72/gomacro is a faily complete Go REPL written in pure Go, although it still does not cover full 100% of all Go language features
please try https://gorepl.com/ for golang repl and other repls.