Compilation and execution
Compilation
package main
import (
"fmt"
"log"
"github.com/gentee/gentee"
)
func main() {
g := gentee.New()
exec,_, err := g.Compile("run : Print(`Hello, world!`)", "")
if err != nil {
log.Fatal(err)
}
exec.Run(gentee.Settings{})
exec,_, err = g.CompileFile("/home/ak/scripts/myscript.g")
if err != nil {
log.Fatal(err)
}
exec.Run(gentee.Settings{})
var result interface{}
result, err = g.CompileAndRun("../torun.g")
fmt.Println(`Error:`, err, `Result:`, result)
}Bytecode Execution
Last updated
Was this helpful?