Skip to content

emicklei/gi

Repository files navigation

gi logo

Go GoDoc codecov examples

a Go interpreter that can be used in plugins and debuggers.

status

This is work in progress. See examples for runnable examples using the gi cli. See status for the supported Go language features.

install

go install github.com/emicklei/gi/cmd/gi@latest

Use CLI

gi run .

For development, the following environment variables control the execution and output:

  • GI_TRACE=1 : produce tracing of the virtual machine that executes the statements and expressions.
  • GI_CALL=out.dot : produce a Graphviz DOT file showing the call graph.
  • GI_AST=out.ast : produce the mirror AST text file.

Use as package

run a program

package main

import "github.com/emicklei/gi"

func main() {
	pkg, _ := gi.ParseSource(`package main

import "fmt"

func Hello(name string) int {
	fmt.Println("Hello,", name)
	return 42
}
`)
	answer, err := gi.Call(pkg, "Hello", "3i/Atlas")
}

Credits

The build pipeline uses all programs of Go By Example to check whether they are executable with gi.

© 2025. https://ernestmicklei.com . MIT License

Releases

No releases published

Contributors 3

  •  
  •  
  •