Go interpreter in pure Go for scripts, plugins and embedded shells
open sourceApache-2.0self-hostablefree
Yaegi is a Go interpreter written in pure Go using only the standard library. It powers executable Go scripts, plugins and embedded interpreters on top of the Go runtime through a small API (New, Eval, Use), and can be used as an interactive REPL. unsafe and syscall are not exported by default. Traefik Labs uses it for Traefik plugins.
Ways to install
Package managers
Problems it solves
- let users write plugins for my Go application without recompiling it
- Go plugin package only works on Linux with matching builds
- run Go code as a script without compiling
- embed a scripting language in a Go service that is actually Go
- interactive Go REPL for experimenting
- evaluate user-provided Go snippets at runtime
- load extensions dynamically into a compiled Go binary
- sandbox dynamic code by not exposing unsafe and syscall
Features
- pure Go, stdlib only
- Eval API
- REPL
- access to Go runtime with control
- unsafe/syscall off by default
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
| Has official SDKs | plan not known |
