{"repo":"traefik/yaegi","free":true,"listed":false,"github":"https://github.com/traefik/yaegi","clone":"git clone https://github.com/traefik/yaegi.git","description":"Yaegi is Another Elegant Go Interpreter","language":"Go","stars":8368,"topics":["golang","go","interpreter"],"license":"Apache-2.0","category":"cli-tools","readme_excerpt":"Yaegi is Another Elegant Go Interpreter. It powers executable Go scripts and plugins, in embedded interpreters or interactive shells, on top of the Go runtime. Features Complete support of [Go specification][specs] Written in pure Go, using only the standard library Simple interpreter API: New() , Eval() , Use() Works everywhere Go works All Go & runtime resources accessible from script (with control) Security: unsafe and syscall packages neither used nor exported by default Support the latest 2 major releases of Go (Go 1.21 and Go 1.22) Install Go package Command-line executable Note that you can use rlwrap (install with your favorite package manager), and alias the yaegi command in alias yaegi='rlwrap yaegi' in your /.bashrc , to have history and command line edition. CI Integration Usage As an embedded interpreter Create an interpreter with New() , run Go code with Eval() : Go Playground As a dynamic extension framework The following program is compiled ahead of time, except bar() which is interpreted, with the following steps: 1. use of i.Eval(src) to evaluate the script in the context of interpreter 2. use of v, err := i.Eval(\"foo.Bar\") to get the symbol from the interpreter context, as a reflect.Value 3. application of Interface() method and type assertion to convert v into bar , as if it was compiled Go Playground As a command-line interpreter The Yaegi command can run an interactive Read-Eval-Print-Loop: Note that in interactive mode, all stdlib package are pre-import","default_branch":null,"files":null,"tree":[],"storefront":"/r/traefik","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/traefik/yaegi/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}