Skip to content

Releases: goplus/xgo

v1.7.1

14 Apr 12:00
7602c46

Choose a tag to compare

What's Changed

features:

features (xgo pack):

documents:

changes:

deps:

  • build(deps): bump github.com/goplus/mod from 0.20.1 to 0.20.2 by @dependabot[bot] in #2723

ci & tools

Full Changelog: v1.7.0...v1.7.1

v1.7.0

02 Apr 01:21
be09c49

Choose a tag to compare

What's Changed

features:

changes:

deps:

  • build(deps): bump github.com/goplus/mod from 0.20.0 to 0.20.1 by @dependabot[bot] in #2698

Full Changelog: v1.6.9...v1.7.0

v1.6.9

30 Mar 08:51
c1f6a68

Choose a tag to compare

What's Changed

changes:

deps:

  • build(deps): bump github.com/goplus/cobra from 1.9.13 to 1.9.15 by @dependabot[bot] in #2686

ci & tools:

  • build(deps): bump codecov/codecov-action from 5 to 6 by @dependabot[bot] in #2687

Full Changelog: v1.6.8...v1.6.9

v1.6.8

26 Mar 07:34
c62581b

Choose a tag to compare

What's Changed

spec:

  • docs: add classfile specification by @aofei in #2675
  • fix(classfile): sanitize reserved class type names by @aofei in #2683

features:

changes:

Full Changelog: v1.6.7...v1.6.8

v1.6.7

23 Mar 05:28
bbcae1f

Choose a tag to compare

What's Changed

features:

deps:

  • build(deps): bump github.com/goplus/mod 0.19.5 by @dependabot[bot] in #2658
  • build(deps): bump github.com/goplus/cobra from 1.9.12 to 1.9.13 by @xushiwei in #2671

ci & tools:

  • build(deps): bump goreleaser/goreleaser-action from 6 to 7 by @dependabot[bot] in #2659
  • build(deps): bump docker/login-action from 3 to 4 by @dependabot[bot] in #2662
  • build(deps): bump docker/setup-qemu-action from 3 to 4 by @dependabot[bot] in #2661
  • build(deps): bump docker/setup-buildx-action from 3 to 4 by @dependabot[bot] in #2664

Full Changelog: v1.6.6...v1.6.7

v1.6.6

23 Feb 14:22
21033f0

Choose a tag to compare

What's Changed

DQL (DOM Query Language) (#2611):

changes:

Full Changelog: v1.6.5...v1.6.6

v1.6.5

18 Feb 06:00
fb0f83f

Choose a tag to compare

What's Changed

DQL (DOM Query Language) (#2611):

encoding (Domain Text Literal):

changes:

deps:

  • build(deps): bump github.com/goplus/mod from 0.19.2 to 0.19.3 by @dependabot[bot] in #2644
  • build(deps): bump github.com/qiniu/x v1.16.2 by @dependabot[bot] in #2644

Full Changelog: v1.6.3...v1.6.5

v1.6.3

16 Feb 07:09
b68abc2

Choose a tag to compare

What's Changed

DQL (DOM Query Language) (#2611):

encoding (Domain Text Literal):

other features:

documents:

changes:

  • fix: prevent duplicate XGo_Init calls in embedded types by @go-wyvern in #2582
  • shouldCallXGoInit refactor by @xushiwei in #2583
  • testcase refactor: listcompr/mapcompr/selectcompr by @xushiwei in #2589
  • fix: pass source argument to cb.Val in compileStructLit by @go-wyvern in #2599
  • parser: parseFuncDeclOrCall - fix warning by @xushiwei in #2603
  • compileErrWrapExpr fix (support lhs); remove tryFileLine for XGo_Env by @xushiwei in #2618
  • remove cl/internal/typesalias by @visualfc in #2619
  • stream: move to x/stream; domaintext literal: xgo/tpl/encoding => xgo/encoding by @xushiwei in #2622

deps:

  • build(deps): bump golang.org/x/net from 0.49.0 to 0.50.0 by @dependabot[bot] in #2613
  • build(deps): bump github.com/goplus/mod v0.19.2 by @xushiwei #2633
  • build(deps): bump github.com/goplus/gogen v1.21.2 by @xushiwei #2631

Full Changelog: v1.6.2...v1.6.3

v1.6.2

29 Jan 12:38
9a88fde

Choose a tag to compare

What's Changed

features:

docs:

changes:

Full Changelog: v1.6.1...v1.6.2

v1.6.1

25 Jan 01:48
2d2c395

Choose a tag to compare

What's Changed

Unified Declaration Syntax via Tuples

This update introduces a paradigm shift in the language's syntax by leveraging Tuples to unify the definitions of functions, types, and variables. By treating everything—from parameters to standalone types—as a tuple, we have achieved a truly "orthopedic" language design where data structures and logic share a single DNA.

1. The Core Philosophy: "Everything is a Tuple"

The cornerstone of this update is the realization that a type, a named field, and a collection of fields are all just variations of a tuple. Specifically, the following are semantically identical:

  • T (a raw type)
  • (T) (a single-element tuple)
  • (name T) (a named single-element tuple)

In this version, $T \equiv (T) \equiv (name\ T)$. Whether you are defining a single integer or a complex set of parameters, you are working within the same tuple-based framework.

2. Functions as Tuple Transformations

Under this unified model, a function is no longer a special construct with its own unique grammar. Instead, a function is defined as a transformation from one tuple to another.

  • Mapping: $Tuple_{in} \to Tuple_{out}$
  • The Unit Tuple: If a function has no parameters or no return values, it simply interacts with the Empty Tuple ().

3. Unified Syntax in Action

By standardizing on tuples, the syntax for functions, types, and variables becomes perfectly symmetrical. Notice how the "shape" of the data remains constant across different keywords:

func run (timeout, maxRetries int, debug bool) (code int, err error)
type Config (timeout, maxRetries int, debug bool)
var cfg (timeout, maxRetries int, debug bool)
var result (code int, err error)

Release Notes

This is the most significant update since XGo was renamed.

XGo MiniSpec has removed StructType and CompositeLit. This means the T{...} syntax is no longer part of the recommended grammar set — this includes []T{...}, map[K]V{...}, NamedT{...}, and so on. These have been replaced by TupleType and TupleLit.

features:

feature specs:

demos:

type Point (x, y int)

pt := Point(2, 3)
echo pt.x, pt.y

pt = (100, 200)
echo pt

pt2 := Point(y = 5, x = 3)
echo pt2
type Config (timeout, maxRetries int, debug bool)

func run(task int, cfg Config?) {
	if cfg.timeout == 0 {
		cfg.timeout = 30
	}
	if cfg.maxRetries == 0 {
		cfg.maxRetries = 3
	}
    echo "timeout:", cfg.timeout, "maxRetries:", cfg.maxRetries, "debug:", cfg.debug
	echo "task:", task
}

run 100, timeout = 60, maxRetries = 5
run 200

deps:

  • chore(deps): bump github.com/goplus/gogen v1.20.6 by @xushiwei in #2564

Full Changelog: v1.6.0...v1.6.1