Releases: goplus/xgo
v1.5.0
What's Changed
rename Go+ => XGo:
- rename Go+ => XGo by @xushiwei in #2365
- mv *.gop => *.xgo by @xushiwei in #2366
- import gop/ => xgo/ by @xushiwei in #2367
- goplus.org => xgo.dev by @xushiwei in #2368
- module github.com/goplus/gop => github.com/goplus/xgo by @xushiwei in #2369
- x/gopenv => x/xgoenv; x/gopprojs => x/xgoprojs by @xushiwei in #2370
- gop/x/xgoprojs by @xushiwei in #2373
- gop => xgo; gop_autogen => xgo_autogen by @xushiwei in #2378
- cmd/make: Go+ => XGo by @xushiwei in #2379
- README: goplus/gop => xgo; cmd/make: gop => xgo; demo: xgo fmt by @xushiwei in #2381
- cmd: gop/ => xgo/ & xgo fmt by @xushiwei in #2382
- TestXGoInstaller by @xushiwei in #2383
- demo/fullspec/mixgo-complex, demo/mixgo: xgo_autogen.go by @xushiwei in #2384
- xgo/env by @xushiwei in #2386
- GOPROOT => XGOROOT by @xushiwei in #2387
- docs: replace
pkgs.goplus.org
withpkgs.xgo.dev
by @aofei in #2388 - doc: igop => ixgo by @visualfc in #2389
changes:
- fix(compile): ensure valid Rparen and NoParenEnd in CallExpr by @go-wyvern in #2363
- MainVersion: 1.5 by @xushiwei in #2371
- cmd/make.go: go.work for typesalias by @visualfc in #2377
- fix misspell98 by @xushiwei in #2374
ci & tools:
- goreleaser gop => xgo by @cpunion in #2375
- Archive all files in release build by @cpunion in #2376
- ci: rm ./all.bash by @xushiwei in #2385
- chore(goreleaser): add gop binary and alias for xgo by @aofei in #2390
deps:
- chore(deps): bump github.com/goplus/mod from 0.17.0 to 0.17.1 by @dependabot in #2391
- gogen v1.19.0 by @xushiwei in #2394
Full Changelog: v1.4.6...v1.5.0
v1.5.0-pre.3
What's Changed
rename Go+ to XGo:
- README: goplus/gop => xgo; cmd/make: gop => xgo; demo: xgo fmt by @xushiwei in #2381
- cmd: gop/ => xgo/ & xgo fmt by @xushiwei in #2382
- TestXGoInstaller by @xushiwei in #2383
- demo/fullspec/mixgo-complex, demo/mixgo: xgo_autogen.go by @xushiwei in #2384
- xgo/env by @xushiwei in #2386
- GOPROOT => XGOROOT by @xushiwei in #2387
- docs: replace
pkgs.goplus.org
withpkgs.xgo.dev
by @aofei in #2388 - doc: igop => ixgo by @visualfc in #2389
ci & tools:
- ci: rm ./all.bash by @xushiwei in #2385
- chore(goreleaser): add gop binary and alias for xgo by @aofei in #2390
deps:
- chore(deps): bump github.com/goplus/mod from 0.17.0 to 0.17.1 by @dependabot in #2391
- gogen v1.19.0 by @xushiwei in #2394
Full Changelog: v1.5.0-pre.2...v1.5.0-pre.3
v1.5.0-pre.2
v1.5.0-pre.1
What's Changed
incompatible changes:
- rename Go+ => XGo by @xushiwei in #2365
- mv *.gop => *.xgo by @xushiwei in #2366
- import gop/ => xgo/ by @xushiwei in #2367
- goplus.org => xgo.dev by @xushiwei in #2368
- module github.com/goplus/gop => github.com/goplus/xgo by @xushiwei in #2369
- x/gopenv => x/xgoenv; x/gopprojs => x/xgoprojs by @xushiwei in #2370
changes:
- fix(compile): ensure valid Rparen and NoParenEnd in CallExpr by @go-wyvern in #2363
- MainVersion: 1.5 by @xushiwei in #2371
Full Changelog: v1.4.6...v1.5.0-pre.1
v1.4.6
What's Changed
cmd/xgo:
- xgo: gogen.GeneratedHeader by @xushiwei in #2343
- xgo: main cmd by @xushiwei in #2344
- change project class suffix to _app.gox for xgo by @tsingbx in #2346
- add usage for xgo by @tsingbx in #2347
changes:
- feat(parser) enhance parser to determine block statement positions and add tests for shadow entry handling by @go-wyvern in #2349
- ast/parser: implicit ident by @xushiwei in #2354
- feat(classfile): add node method to pkgCtx for shadow main postion by @go-wyvern in #2353
- ast/parser: remove SkipObjectResolution by @xushiwei in #2357
- ast.Package/File: remove Scope by @xushiwei in #2358
- cl: support aliastypeparams by @visualfc in #2355
- cl: typeAlias by @xushiwei in #2359
doc:
ci & tools:
deps:
- fix(go.mod): update gogen dependency to v1.18.1 by @go-wyvern in #2356
- build(deps): bump github.com/goplus/cobra from 1.9.11 to 1.9.12 by @dependabot in #2350
- build(deps): bump github.com/qiniu/x from 1.14.0 to 1.14.6 by @dependabot in #2352
Full Changelog: v1.4.5...v1.4.6
v1.4.5
What's Changed
cmd/xgo:
- cmd: xgo by @xushiwei in #2312 #2313 #2339
- cmd: xgo by @tsingbx in #2314 #2315 #2318 #2319 #2320 #2321 #2322 #2324 #2325 #2326 #2328 #2333 #2335 #2336 #2338
class files and frameworks:
- embed work classes for project class; init project instance in work class by @xushiwei in #2301
- class framework: gmxProject.embed fix by @xushiwei in #2304
- class framework: spName support Class.Prefix by @xushiwei in #2337
- doc: class framework by @xushiwei in #2311
domain text literals:
- ast, parser: DomainTextLitEx by @xushiwei in #2302
- parser: domainTextLitEx; cl: compileDomainTextLit with args by @xushiwei in #2303
features:
- compileCallArgs: auto ConvertToClosure by @xushiwei in #2305
- builtin: fatal, errorln by @xushiwei in #2323
- mv gop builtin packages => qiniu/x by @xushiwei in #2334
changes:
- cl: support TyTypeAsParams by @visualfc in #2308
- cl: genMainFunc force remove comments by @visualfc in #2317
ci & tools:
deps:
- build(deps): bump github.com/qiniu/x from 1.13.19 to 1.14.0 by @dependabot in #2332
- build(deps): bump github.com/goplus/mod from 0.16.0 to 0.16.1 by @dependabot in #2331
- build(deps): bump github.com/goplus/cobra 1.9.9 by @dependabot in #2330
- build(deps): bump github.com/goplus/gogen 1.18.0 by @dependabot in #2329
Full Changelog: v1.4.0...v1.4.5
v1.4.0
What's Changed
llgo version (support v0.11.x):
changes:
ci & tools:
deps:
- build(deps): bump github.com/goplus/gogen from 1.17.1 to 1.17.2 by @dependabot in #2295
- build(deps): bump github.com/qiniu/x from 1.13.17 to 1.13.19 by @dependabot in #2297
- build(deps): bump github.com/goplus/mod from 0.15.1 to 0.16.0 by @dependabot in #2298
Full Changelog: v1.3.9...v1.4.0
v1.3.9
What's Changed
documents:
libraries:
features:
changes:
- classfile: fix name conflict of multi projects by @xushiwei in #2258
- classfile: getGameClass fix by @xushiwei in #2269
- classfile: prepare multiple work classes by @xushiwei in #2276
- classfile: remove outdated stuff by @xushiwei in #2277
- classfile: multiple work classes by @xushiwei in #2278
- classfile: spriteFeatures fix by @xushiwei in #2279
- classfile preloadGopFile: ensure game type is loaded by @xushiwei in #2280
- classfile gmxProjMain: nil if no work by @xushiwei in #2281
- cl: fix generic func alias for pkg by @visualfc in #2263
- tool: importer check pkgpath by @visualfc in #2251
- tool: PkgHash skip check by @visualfc in #2259
- rm dep of golang.org/x/tools by @xushiwei in #2285
- mv Diff => qiniu/x/test.Diff by @xushiwei in #2274
- cltest: SpxFromDir by @xushiwei in #2275
deps:
- build(deps): bump github.com/fsnotify/fsnotify from 1.8.0 to 1.9.0 by @dependabot in #2252
- build(deps): bump github.com/goplus/mod 0.15.1 by @dependabot in #2283
- build(deps): bump github.com/qiniu/x from 1.13.13 to 1.13.16 by @dependabot in #2271
- github.com/qiniu/x v1.13.13 by @xushiwei in #2268
ci & tools:
- make: support Go1.24 by @visualfc in #2249
- make: go.work for go1.24 by @visualfc in #2250
- go1.24 by @xushiwei in #2286
Important Updates in v1.3 (vs. v1.2)
Documentation:
-
Improved Go+ Mini Spec documentation. Go+ Mini Spec is a carefully designed language specification that represents the essence of Go+: providing a minimal but Turing-complete syntax set, while also representing the best practices of Go+ programming.
-
Auto-generated documentation for Go+ builtin functions. Go+'s builtin functions are far more extensive than Go's, which simplifies the expression of common tasks. Additionally, Go+'s basic types also have methods. For example, the
string
type has built-in common string operations. Among them,"123".int
converts a string to an integer type;"get_table_name".split("_")
splits a string into a list["get", "table", "name"]
.
Language Features:
-
Goodbye to
append
, new syntax for adding elements to a list: the<-
operator. The familiara = append(a, v1, v2, ..., vN)
for Go programmers now becomes the more intuitivea <- v1, v2, ..., vN
. Connecting two lists is similar: previouslya = append(a, b...)
, nowa <- b...
. -
Introduced
for .. in
to replace the previousfor .. <-
, making it more consistent with mainstream languages. The oldfor .. <-
will still be supported, but after formatting the code with gop fmt, it will automatically convert<-
toin
. -
Introduced numeric literals with units, such as
1s
for 1 second. This allows us to usewait 0.5s
instead of the previously verbosewait 0.5*time.Second
, making the semantics more intuitive. It's worth noting that the meaning of numeric constants with units varies depending on the type of data. For example, inwait 1m
, because the parameter is a time type,1m
means 1 minute. Instep 1m
, where the parameter type is distance,1m
means 1 meter. -
Support for users to choose their own Go compiler, which can be specified in go.mod. Go+ currently supports the following Go compilers:
go
(Go's official compiler),llgo
(maintained by the Go+ team), andtinygo
(a Go compiler specifically for embedded environments). Currently, Go+ defaults to usinggo
, but will default tollgo
in the future. To initialize a module usingllgo
, simply execute the commandgop mod init -llgo mymodule
. -
Support for importing C/C++ and Python libraries. Go+'s support for importing C/C++ and Python libraries is achieved through LLGo. Currently, the support for C/C++ libraries is quite mature, and we will provide automated tools to cover mainstream C/C++ libraries, eliminating the need for users to manually migrate C/C++ libraries to the Go world as with cgo. Go+'s support for Python libraries is still experimental and will be a focus in future versions of Go+.
-
Wasm support. Go+'s support for Wasm is achieved through LLGo. Wasm generated by LLGo will be smaller in size than Wasm compiled by the official Go compiler, and it still supports generating Wasm files when using cgo (the official Go compiler doesn't support Wasm when using cgo).
-
Built-in clone support for classfiles, making object cloning operations more efficient. Possible application scenarios: creating Handler instances for each new connection in a web framework. Before clone support, we typically needed to implement object cloning through the reflect mechanism, which not only made the code obscure but also introduced significant performance overhead.
-
Support for Domain Text Literals.
Built-in Functions:
-
Added the built-in function
type
as a replacement forreflect.TypeOf
, used to view the type of an object. -
Added the Capitalize method to string and []string types, used to capitalize the first letter of a string. For example:
"hello".capitalize
will result in the string"Hello"
, and["hello", "world", "!"].capitalize
will result in["Hello", "World", "!"]
. Converting a C-style variablex := "get_table_name"
to camel case"GetTableName"
only requiresx.split("_").capitalize.join("")
.
Standard Libraries:
- gop/tpl: a grammar-based language similar to EBNF (Extended Backus-Naur Form) that seamlessly integrates with Go+. It provides a more readable and maintainable approach to text processing while offering capabilities beyond what regular expressions can achieve. TPL is similar to
yacc
andbison
. However, it's not a standalone tool but a domain text literal embedded in the Go+ language.
Full Changelog: v1.3.8...v1.3.9
v1.3.8
What's Changed
documents:
- Go+ MiniSpec: by @xushiwei in #2211 #2214 #2221 #2222 #2226 #2227 #2228 #2233 #2234 #2235 #2237 #2239 #2240 #2241 #2242 #2243 #2245
- Go+ FullSpec: by @xushiwei in #2238 #2244 #2247
features:
- support gotypesalias by @visualfc in #2208
- gop/tpl: by @xushiwei in #2211 #2212 #2213 #2215 #2216 #2217 #2218 #2219 #2223 #2224 #2225 #2229 #2230 #2231 #2232 #2246
Full Changelog: v1.3.7...v1.3.8
v1.3.7
What's Changed
features:
- parser: ParseExprEx by @xushiwei in #2190
- gop/tpl: by @xushiwei #2184 #2185 #2186 #2187 #2188 #2189 #2191 #2192 #2193 #2195 #2196 #2199 #2200 #2201 #2202 #2203 #2205 #2206 #2207
changes:
- classfile: refactor Classfname, Classclone; ast: ClassFieldsDecl by @xushiwei in #2180
- demo: remove outdated stuff by @xushiwei in #2204
ci & tools:
deps:
- build(deps): bump github.com/goplus/gogen 1.16.9 by @dependabot in #2209
- build(deps): bump github.com/goplus/llgo 0.10.1 by @dependabot in #2194
Full Changelog: v1.3.6...v1.3.7