On Mon, Apr 6, 2015 at 2:31 AM, 'Peter Collingbourne' via golang-nuts
<
golan...@googlegroups.com> wrote:
> Hi all,
>
> I'd like to announce that llgoi, a Go REPL I've been working on on and off
> for the past few months, has reached a reasonable level of stability. It
> supports expressions, statements, most declarations and imports, including
> binary imports from the standard library and source imports from $GOPATH.
>
> The main advantage of this REPL over some other Go REPL efforts in the past
> (such as igo) is that this one integrates directly with a Go compiler,
> specifically llgo, which allows it to more easily persist state between
> lines, such as variable values and the binary code behind imported Go
> packages. For one thing, this means that expressions can be evaluated
> against large Go packages without needing a recompile after every line.
that's really nice.
I like how you leveraged llvm's JIT to be able to import modules at runtime:
http://llvm.org/klaus/llgo/blob/master/cmd/llgoi/llgoi.go#L-139
does that work for modules with some parts written in assembly as well?
(I was waiting for gc to gain shared library support to be able to
import modules for io/go-eval)
[...]
> Having a Go REPL easily available has changed how I develop Go programs. For
> example, a month or so ago I had a need to write a one-off utility to gather
> some statistics. Having a REPL available allowed me to quickly experiment
> with various functions in my program simply by importing it into the REPL. I
> hope that it can help you program more effectively too!
yes, exploratory work (eg as done in science) nicely fits in that description.
that's why IPython, IJulia and the like strives in scientific circles.
I hope llgoi will soon be shipped with llvm installs.
-s
PS: minor nitpick.
github.com/sbinet/igo (or rather, sbinet/go-eval)
doesn't rebuild/recompile after each line.