Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/goplus/gossa

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/goplus/gossa

  • v0.27.1
  • Source
  • Go
  • Socket score

Version published
Created
Source

iGo+ The Go/Go+ Interpreter

Go1.18 Go1.19 Go1.20 Go1.21 Go1.22 Go Reference

Go Version

  • Go1.18 ~ Go1.22
  • macOS Linux Windows WebAssembly GopherJS and more.

ABI

support ABI0 and ABIInternal

  • ABI0 stack-based ABI

  • ABIInternal register-based Go calling convention proposal

    • Go1.17: amd64
    • Go1.18: amd64 arm64 ppc64/ppc64le
    • Go1.19: amd64 arm64 ppc64/ppc64le riscv64
    • Go1.20: amd64 arm64 ppc64/ppc64le riscv64
    • Go1.21: amd64 arm64 ppc64/ppc64le riscv64
    • Go1.22: amd64 arm64 ppc64/ppc64le riscv64

Generics

runtime.GC

igop.Mode ExperimentalSupportGC

experimental support runtime.GC and runtime.SetFinalizer

install igop command line

Go version < 1.17:

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

Go version >= 1.17:

go install github.com/goplus/igop/cmd/igop@latest

igop command

igop             # igop repl mode
igop run         # run a Go/Go+ package
igop build       # compile a Go/Go+ package
igop test        # test a package
igop verson      # print version
igop export      # export Go package to igop builtin package

igop run mode

Usage: igop run [build flags] [package] [arguments...]
  -exp-gc
    	experimental support runtime.GC
  -mod value
    	module download mode to use: readonly, vendor, or mod.
  -ssa
    	print SSA instruction code
  -ssa-trace
    	trace SSA interpreter code
  -tags value
    	a comma-separated list of build tags to consider satisfied during the build
  -v	print the names of packages as they are compiled.
  -x	print the commands.

igop repl mode

igop                       # run repl mode, support Go/Go+
igop repl                  # run repl mode, support Go/Go+
igop repl -go              # run repl mode, disable Go+ syntax

igop test unsupport features

  • test -fuzz
  • test -cover

igop demo

go js playground (gopherjs)
go repl playground (gopherjs/wasm)
ispx

https://github.com/goplus/ispx

run simple Go source demo
package main

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

var source = `
package main
import "fmt"
type T struct {}
func (t T) String() string {
	return "Hello, World"
}
func main() {
	fmt.Println(&T{})
}
`

func main() {
	_, err := igop.RunFile("main.go", source, nil, 0)
	if err != nil {
		panic(err)
	}
}
run simple Go+ source demo
package main

import (
	"github.com/goplus/igop"
	_ "github.com/goplus/igop/gopbuild"
)

var gopSrc string = `
fields := [
	"engineering",
	"STEM education", 
	"and data science",
]

println "The Go+ language for", fields.join(", ")
`

func main() {
	_, err := igop.RunFile("main.gop", gopSrc, nil, 0)
	if err != nil {
		panic(err)
	}
}
igop more demo

https://github.com/visualfc/igop_demo

FAQs

Package last updated on 28 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc