Skip to content

goplus 1.3.9 #219867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2025
Merged

goplus 1.3.9 #219867

merged 2 commits into from
Apr 13, 2025

Conversation

BrewTestBot
Copy link
Member

Created by brew bump


Created with brew bump-formula-pr.

release notes
## What's Changed

documents:

libraries:

features:

changes:

deps:

ci & tools:

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 familiar a = append(a, v1, v2, ..., vN) for Go programmers now becomes the more intuitive a <- v1, v2, ..., vN. Connecting two lists is similar: previously a = append(a, b...), now a <- b....

  • Introduced for .. in to replace the previous for .. <-, making it more consistent with mainstream languages. The old for .. <- will still be supported, but after formatting the code with gop fmt, it will automatically convert <- to in.

  • Introduced numeric literals with units, such as 1s for 1 second. This allows us to use wait 0.5s instead of the previously verbose wait 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, in wait 1m, because the parameter is a time type, 1m means 1 minute. In step 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), and tinygo (a Go compiler specifically for embedded environments). Currently, Go+ defaults to using go, but will default to llgo in the future. To initialize a module using llgo, simply execute the command gop 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 for reflect.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 variable x := "get_table_name" to camel case "GetTableName" only requires x.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 and bison. However, it's not a standalone tool but a domain text literal embedded in the Go+ language.

Full Changelog: goplus/gop@v1.3.8...v1.3.9

@github-actions github-actions bot added go Go use is a significant feature of the PR or issue bump-formula-pr PR was created using `brew bump-formula-pr` labels Apr 13, 2025
Copy link
Contributor

🤖 An automated task has requested bottles to be published to this PR.

Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Apr 13, 2025
@BrewTestBot BrewTestBot enabled auto-merge April 13, 2025 03:10
@BrewTestBot BrewTestBot added this pull request to the merge queue Apr 13, 2025
Merged via the queue into master with commit 738ae40 Apr 13, 2025
14 checks passed
@BrewTestBot BrewTestBot deleted the bump-goplus-1.3.9 branch April 13, 2025 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-formula-pr PR was created using `brew bump-formula-pr` CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. go Go use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants