Is there an Golang interpreter/incremental compiler with a REPL which is (or could be) integrated into Emacs like SLIME for Common Lisp?
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.
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:
- github.com/cosmos72/gomacro (LGPL)
- neugram.io (BSD)
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:
- https://mybinder.org/v2/gh/go-hep/binder/master?filepath=examples%2F01-display-data.ipynb
- https://mybinder.org/v2/gh/go-hep/binder/master?filepath=examples%2F02-gonum-stat.ipynb
- https://mybinder.org/v2/gh/go-hep/binder/master?filepath=examples%2F03-go-hep-hplot.ipynb
- https://mybinder.org/v2/gh/go-hep/binder/master?filepath=examples%2F04-go-hep-rootio.ipynb
- https://mybinder.org/v2/gh/go-hep/binder/master?filepath=examples%2F05-astrogo-fitsio.ipynb
hth,
-s
Thanks Iāll check out gomacro.
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.
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.
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)
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
I still prefer āmyā neugram interpreter
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.