damonchen / gossa

A Golang SSA Interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gossa - Golang SSA interpreter

Go1.14 Go1.15 Go1.16 Go1.17 Go1.18

ABI

support ABI0 and ABIInternal

unsupport features

  • Go1.18 type parameters
  • Go1.18 fuzzing

gossa command line

go get -u github.com/goplus/gossa/cmd/gossa

Commands

gossa run         # interpret package
gossa test        # test package

gossa package

run go source

package main

import (
	"github.com/goplus/gossa"
	_ "github.com/goplus/gossa/pkg/fmt"
)

var source = `
package main

import "fmt"

func main() {
	fmt.Println("hello")
}
`

func main() {
	_, err := gossa.RunFile("main.go", source, nil, 0)
	if err != nil {
		panic(err)
	}
}

run gop source

package main

import (
	"github.com/goplus/gossa"
	_ "github.com/goplus/gossa/gopbuild"
	_ "github.com/goplus/gossa/pkg/fmt"
)

var source = `
println "Hello, Go+"
`

func main() {
	_, err := gossa.RunFile("main.gop", source, nil, 0)
	if err != nil {
		panic(err)
	}
}

About

A Golang SSA Interpreter

License:Apache License 2.0


Languages

Language:Go 100.0%