SLIME for Golang?


(Petter) #1

Is there an Golang interpreter/incremental compiler with a REPL which is (or could be) integrated into Emacs like SLIME for Common Lisp?


(Jakob Borg) #2

I don’t know about slime, but motemen/gore and d4l3k/go-pry are the first two Google hits for “go repl”. Maybe those can work.


(Sebastien Binet) #3

gore and go-pry are note real REPL. (IIRC!)

they take advantage of the very quick compilation speed of Go to recompile the snippets you enter and re-run those parts.

real REPLs are:

there are also Jupyter backends for Go:

(they do have to use/implement a real REPL for Jupyter to work correctly)

e.g. a Jupyter backend with Neugram:

direct examples:

hth,
-s


(Petter) #4

Thanks I’ll check out gomacro.


(Christoph Berger) #5

I see what you mean, it looks like cheating if the REPL simply calls the standard compiler.
However, as long as the REPL looks and feels like a REPL, I would not care about whether the code is compiled or interpreted.


(Sebastien Binet) #6

it kind of makes all the difference in the world when you do:

$> sat, err := launchSatellite()

and then:

$> err = analyze(sat.Data)

you don’t want another satellite to be launched when you enter the second command in the REPL.
something that the REPLs-yet-not-quite try hard not to do, of course, but fail in some situations.


(Christoph Berger) #7

Valid point. On the other hand, not all one-liners launch a satellite.

^---- Sorry. The above line sat in the editor for 16 days, unnoticed by me.

Looks like there is a new REPL that is able to interpret Go source code line-by-line:

(Announcement on golang-nuts: https://groups.google.com/d/topic/golang-nuts/YTLZ1maIgFI/discussion)


(Sebastien Binet) #8

Yes, Jason’s interpreter is interesting in the sense that it’s, to my knowledge, the first non-toy JIT interpreter for Go.
The one thing that I don’t like very much is that it’s relying on installing a C-based third party library to work.
So no easy ‘go get’ experience, no AppEngine and no painless cross compilation :slight_smile:
I still prefer ‘my’ neugram interpreter :slight_smile:


(system) #9

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.