Releases: goplus/xgo
v1.1.5
new features:
- support Error wrapping (#1347)
- support typeparam caller (#1352)
- support .gopx and classfile embed type (#1377)
- gopfmt: support classfile (#1378)
- fix test typeparams for go1.20 (#1359)
changes:
- parser: fix command style
! (Not)
expr (#1361) - fix empty struct argument call for gop style (#1368)
- cl: loadVars check recover (#1372)
- docs: update homebrew install note (#1351)
- mod: github.com/goplus/gox v1.11.35
- mod: github.com/goplus/c2go v0.7.13
- mod: github.com/goplus/libc v0.3.13
v1.1.3
new features:
- cmd/gop: gop build/run/install/test pass build flags (#1300)
- cl: os.File: support Gop_Enum (#1320)
- cl: blines
changes:
- cmd/gop: gop run/build/install/test -v => -debug
- cl: command style invalid operation mismatched types (fix #1312)
- parser: cmd style check tuple to list (#1315)
- parser: return isTuple if allowTuple
- parser: parseBinaryExpr check tuple
- mod: gox v1.11.21
- mod: c2go v0.7.10
- mod: libc v0.3.12
v1.1.2
documentations:
- Go+ doesn't support DSL (Domain Specific Language), but it's Specific Domain Friendly (see DSL vs. SDF)
changes:
- ast: ForPhrase add IfPos
- parser: parseErrWrapExpr: ErrWrapExpr as PrimaryExpr
- cl: TestErrWrapCall/TestErrWrapCommand
- cl: TestVargCommand
- cl: TestSelectComprehensionRetTwoValue
- cl: fix for range-expression doesn't support if condition (#1243)
- cl: unary op pass src (#1278)
- cl: remove gox.PkgImporter; loadImport fix pkgName
- cl: loadImport check error recover
- cl: preloadFile restore cur file
- cl: support Gop_proj, Gop_work
- cl: compileSelectorExpr fix: clIdentCanAutoCall
- gop: use github.com/qiniu/x/errors
- gop: gop.GenDepMods: support gop.mod - register
- gop: fix gop.Import
- gop: fix #1301
- build: fix: separate build and install processes when building Go+ tools
- build: fix multi platform release
- mod: mod 0.9.12
- mod: gox v1.11.12
- mod: c2go 0.7.8
- mod: libc 0.3.10
v1.1.0
Go+ v1.1.0 vs. Go+ v1.0.39
First, it introduces the github.com/goplus/mod module. This module provides support for Go/Go+ module related capabilities. It can be thought of as enhancements to golang.org/x/mod which include:
- github.com/goplus/mod: Provides the ability to find go.mod/gop.mod files.
- github.com/goplus/mod/modfile: Provides read and write support for the gop.mod file.
- github.com/goplus/mod/{modload, gopmod}: Provides the Go+ Module class (recommended to use the gopmod package, which is greatly enhanced on the basis of modload).
- github.com/goplus/mod/modcache: Provides support for module cache directories.
- github.com/goplus/mod/modfetch: Provides module download function.
Second, it has improved gop mod
(module management) related commands, especially the gop mod tidy
command needs to be considered in many cases.
Third, it enhances the completeness of gop
command functions such as gop build/install/run/test
, which are mainly reflected in:
- Support for remote packages. For example, in Go+ v1.0 you could only
gop run
local directories or files, nowgop run
is supported to run a remote package. - Consistency of
gop build/install/run/test
. Previously, the codes ofgop run
andgop build/install
were written separately, lacking a unified support framework, and their behaviors would be different. Now they are unified into the same implementation framework. - The gop cache bug has been eliminated. In Go+ v1.0, due to the poor implementation performance of the import package, the gop cache module cache was introduced, which led to some bugs in module update detection, and an infinite loop of importing some complex packages.
Fourth, it adds some syntax features that v1.0 does not have. This mainly includes:
- Overloading of
++
,--
operators is supported. - Expression
type()
is supported to represent the zero value of typetype
. For example,string()
is equivalent to""
,int32()
is equivalent toint32(0)
, and so on. - Supports
uint128
,int128
types. - Supports the
any
type, which is equivalent to the empty interface.
Fifth, it adds support for comment instructions in structure and function headers. E.g:
//go:notinheap
type S struct{ x int }
//go:noinline
//go:uintptrescapes
func test(s string, p, q uintptr, rest ...uintptr) int {
...
}
Of course, the comment instruction still needs to be further improved. For example, conditional compilation instructions, etc., are currently not implemented.
Sixth, fix many bugs. It includes Go+ bugs (issue #888, #1056, #1228, #1243, etc.) and new test cases have been added in go1.8 version, which may not all pass in Go+ v1.0 version (issues #1195, #1196, #1197, #1198, etc.).
Seventh, it supports Go/Go+ hybrid projects. For details, please refer to the gop/testdata/mixgo example. The following is an introduction to this in the project's README file:
Eighth, support for calling C from Go+. This includes:
- The
gop c
command (equivalent to the stand-alonec2go
command) can be used to convert a C project to a Go project. import "C"
andimport "C/xxx"
are used to import a C project converted by c2go. whereimport "C"
is short forimport "C/github.com/goplus/libc"
.- The
C"xxx"
syntax represents C-style string constants.
Here is an example to show how Go+ interacts with C.
import "C"
C.printf C"Hello, c2go!\n"
C.fprintf C.stderr, C"Hi, %7.1f\n", 3.14
In this example we call two C standard functions printf
and fprintf
, passing a C variable stderr
and two C strings in the form of C"xxx"
(a Go+ syntax to represent C-style strings).
Run gop run .
to see the output of this example:
Hello, c2go!
Hi, 3.1
Of course, the current Go+ support for C is only a preview version, not to the extent that it is actually available in engineering. As far as libc is concerned, the current migration progress is only about 5%, and it is just the beginning.
In the upcoming Go+ v1.2 version planning, complete support for C is listed as a top priority. Of course, support for cgo and Go templates is also under planning, which is a crucial capability enhancement for Go/Go+ hybrid projects.
v1.1.0-rc3
new features:
- cl: lambda: support in return statement (#1228)
- cl: config: add NoSkipConstant for disable optimization of skip constants
- cl: check SliceLit type (#1120)
- cl: loadVars check CompositeLit type (#1120)
- gop: add Tidy
- gop: NewImporter: support import Go+ packages
changes:
- gop: NewImporter: save fset
- gop: NewImporter: support gopmod.PkgtModule
- cmd/gop: gop mod tidy: cleanup before save
- mod:mod 0.9.10
- mod: c2go 0.7.6
- mod: libc 0.3.8
v1.1.0-rc2
new features:
- cmd/gop: refactor gop mod tidy
- gop: gop.NewImporter
- ast: gop/ast/mod
changes:
- cmd/gop: gop c2go => gop c
- cmd/gop: gop go/build/install/run/test: use fmt.Fprintf instead of panic
- cl: improve prompt of struct member not found
- mod: mod v0.9.7; c2go v0.7.2; libc v0.3.6
incompatible changes:
v1.1.0-rc1
new features:
- cmd/gop: gop c2go (support c2go, macOS/linux only)
- cl: import "C" (support libc, macOS only)
- cl: import "C/xxx"
- parser/scanner/printer: support CSTRING literal
- example: use C.printf, C.fprintf and C.stderr
incompatible changes:
- gengo: return recursively or not
changes:
- cmd/gop: rm base.RunGoCmd (use gop/x/gocmd please)
- parser: newTwoFileFS => parsertest.NewTwoFilesFS
- gengo: skip dir with prefix _
- mod: libc v0.3.5
- mod: c2go v0.7.1
- mod: gox v1.11.7
v1.1.0-beta5
new features:
- cmd/gop: refactor: gop go
- cmd/gop: refactor: gop install
- cmd/gop: refactor: gop build
- cmd/gop: refactor: gop run
- cmd/gop: refactor: gop test
- cl: mix go/go+ code
- cl: add conf.GopRoot to enable gopImporter
- cl: cl.NewPackage allow conf.Importer = nil
- ast: gop/ast/fromgo
- parser: ParseGoAsGoPlus flag
- mod: add github.com/goplus/gop
- mod: add gop/x/gocmd
- mod: add gop/x/gopenv
- mod: add gop/x/types (experimental)
incompatible changes:
- gop/env: remove GOPMOD, GOMODCACHE, GOPATH
- mod: remove gop/x/gengo, gop/x/gopmod, gop/x/gopproj
- mod: move github.com/goplus/gop/x/mod => github.com/goplus/mod
changes:
v1.1.0-beta3
new features:
- cl: support overload operator ++/--
- cl: support type() to get zero value
- cl: typecast support twoValue
- cl: config add NoAutoGenMain for auto generate main func if no entry
- builtin: add type alias any = interface{}
- builtin: uint128, int128
- ast: togo.ASTFile
- cmd: add cmd/gopdecl
incompatible changes:
changes:
- parser: fix parserCallOrConversion cmd single line
- cl: toStructType check name redeclared
- cl: bug fixed // import builtin
- cl: cb.Comments => cb.BackupComments
- x/gopproj: fix gop run workdir
- x/gopproj: handleEvent OnErr no dump error
- x/gopproj: genDefaultGopMod bugfix
- mod: gox v1.10.8
v1.1.0-beta2
changes:
gop run pkgPath
hotfix: lookupFromCache: errors.Unwrap- releaseNewVersion tool