七叶
七叶
### The following program `sample.gop` triggers an unexpected result ```coffee // add a sample var a uint128 = 1e60 println a ``` ### Expected result ```console build static check main.gop:1:17:...
igop repl add pythonic built-in functions .` rtype eval ...` - type ` rtype(x interface{}) Type` can be compared two Type ``` //rtypeMap = make(map[Type]reflect.Type) type Type string func (Type)...
implement ``` runtime.Caller runtime.FuncForPC runtime.Callers (*runtime.Frames).Next (*runtime.Func).FileLine runtime.Stack * runtime.Stack(buf,false) runtime/debug.Stack runtime/debug.PrintStack (reflect.Value).Pointer ```
$GOROOT/test/unsafebuiltins.go ``` // sliced memory overflows address space last := (*byte)(unsafe.Pointer(^uintptr(0))) _ = unsafe.Slice(last, 1) mustPanic(func() { _ = unsafe.Slice(last, 2) }) ```
- qexp use golang.org/x/tools/go/loader is very slow - support qexp pkg/... - igop export pkg
$GOROOT/test/chan/select5 bug: golang.org/x/tools/go/ssa build order fp, fc ``` package main var c = make(chan int, 1) var nilch chan int var n = 1 var x int var i interface{}...
https://github.com/goplus/igop/blob/main/cmd/igoptest/main.go `igop run -exp-gc demo.go` ``` func init() { if runtime.GOARCH == "386" { gorootTestSkips["printbig.go"] = "load failed" gorootTestSkips["peano.go"] = "stack overflow" } gorootTestSkips["closure.go"] = "runtime.ReadMemStats" gorootTestSkips["divmod.go"] = "slow, 1m18s"...
``` package main import ( "fmt" ) func main() { type P struct{ i int } var m = map[int]int{} var p *P defer func() { recover() check(1, len(m)) check(3,...
**syntax** go:linkname pkg.type.method go:linkname pkg.(*type).method **todo type convert** ??? ``` $linknames["pkg.(*type).method"] = function(s) { return s.method(...[...arguments].slice(1))}; ``` ``` $kindStruct : $clone $pointerOfStructConversion $kindSlice : $convertSliceType other: TODO ``` **demo** ```...