v0.14.0-alpha.1
This release introduces a new error builtin, two language changes, and many fixes and optimizations for the new closedness algorithm.
Changes which may break some users are marked below with: ⚠️
Evaluator
error builtin
A new error builtin is added to the language, which allows users to create custom error values with a specified message.
Don’t simplify validators into concrete values
A new CUE_EXPERIMENT=keepvalidators experiment is introduced, already on by default, which prevents validators from being simplified into concrete values.
X == Y and == X
Firstly, there were several bug fixes related to ==. Most notably, [int] == [int] incorrectly resolved to true. It now correctly resolves to an error.
All other changes are enabled using the @experiment(structcmp) file-level attribute.
Enabling thix experiment allows all CUE values to be compared for equality. This includes comparing structs.
The same experiment also allows a unary == to enforce that a value is a specific concrete value.
Documentation and examples will be available for the v0.14.0 release.
Other changes
⚠️ The file embedding experiment can no longer be disabled via CUE_EXPERIMENT=embed=0, having been introduced in CUE v0.10.0.
File embedding is now enabled when using the cue/cuecontext or cue/load APIs; earlier versions could not expose it via the Go API due to an import cycle.
⚠️ The topological field sorting experiment can no longer be disabled via CUE_EXPERIMENT=toposort=0, having been introduced in CUE v0.11.0.
⚠️ CUE_EXPERIMENT=cmdreferencepkg, introduced in v0.13.0 to require referencing tool packages to declare cue cmd tasks, is now on by default.
The new closedness algorithm has been adjusted to fix a number of “field not allowed” bugs, particularly in the form of regressions compared to the old evaluator.
A particularly slow part of the new closedness algorithm has been optimized, resulting in improvements of up to 10x in wall times for some projects.
cmd/cue
⚠️ cue def --strict jsonschema:, deprecated in favor of cue def jsonschema+strict: in v0.11.0, is no longer supported.
Go API
cue/load now provides module information via the new Instance.ModuleFile field.
⚠️ In order to support the above change, the mod/modfile.File.Format method has been moved to the function mod/modfile.Format: an API-breaking change but necessary to avoid a cyclic package dependency.
cue/parser gains a new Config API, which allows other packages like cue/load to properly apply the right parser options such as the CUE language version.
⚠️ In order to support the above change, the cue/parser.Config.ParseFile and cue/build.ParseFile signatures have now changed (incompatibly) to add a parser.Config argument, enabling the CUE language version to be passed through.
Fix an issue where cue.Value.Decode did not work with *math/big.Float types.
All changes
114 changes since v0.13.0by area
all6
allsimplify three iterator uses with range-over-funcallswap math/rand for math/rand/v2 where it affects behaviorallremove a bit of dead codeallswap math/rand for math/rand/v2 where it doesn't affect behaviorallrely on iterators being available since Go 1.23allensure we init cuedebug and cueexperiment before every use
cmd20
cmd/cue/cmdfix versiontest testcmd/cueremove CUE_SYNTAX_OVERRIDE supportcmd/cueadd test cases for issue 3968cmd/cueadd testscript forexp gengotypesoutput filenamescmd/cueproperly document the keepvalidators experimentcmd/cuefix error on cue mod rename with a bad modulecmd/cueadd test case for modrename with a bad modulecmd/cueallow "access denied" testscript to pass on Winecmd/cuetweak two more testscripts to be portablecmd/cueadd false, echo, and cat testscript commandscmd/cuedrop debug lines from testscriptscmd/cueremove dev.txtar testscriptcmd/cuedeprecate --strict flag in favor of the jsonschema filetype tagcmd/cueturn all "cmd" testscripts away from legacy id/kind fieldscmd/cueconsistently use the same top-level command contextcmd/cueadd more CUE_DEBUG=http testscmd/cueremove stale testscript txtar files for CUE_EXPERIMENT=modules=0cmd/cueconsistently use tab indentation in help textscmd/cuedrop evalv3=0 testscriptscmd/cueimplement mirror --dry-run
cue14
cue/loadpass language version down to parsercue/loaduse error registry in SkipImports modecue/parserenable cueexperiment.File throughoutcue/loadactually populate build.Instance.ModuleFile correctlycue/parseradd Config typecue/loadinclude module file in build.Instancecue/parserprohibit definition identifiers for package namescue/astimprove ImportPath.Canonicalcue/astadd more tests for ImportPath.Canonicalcuefix decoding into big.Floatcueadd tests for issue 3927cueuse multiple sizes in BenchmarkLargeValueMarshalJSONcue/cuecontextalways enable embeddingcue/loadmake NoFilesError use position arguments for paths
internal66
internal/core/adtremove cycle checkinternal/core/adtadd tests for 3978internal/core/adtrevert 1217228internal/core/compileadd version check for builtinsinternal/core/adtadd builtin for user-defined errorsinternal/core/adtrename CallContext.Exprinternal/ciupdate Go and goreleaser versionsinternal/core/adtsupport unary == and != for all typesinternal/core/adtcomparison of values of different typesinternal/core/adtconsider required fields for final values in Equalinternal/core/adtsupport comparsion of structsinternal/core/adtfix error gobbling of internal nodesinternal/core/adtadd tests for Issue 3977internal/cueexperimentsupport for per-file experimentsinternal/core/adtsimplify recursive getReqSets callsinternal/core/adtdo not repeat replaceIDs callsinternal/core/adthandle incomplete values in comparatorsinternal/core/adtuse replaceIDs incrementally in checkTyposinternal/core/adtrewrite replaceIDs to scale betterinternal/core/adtEqual should take defaults when appropriateinternal/core/adtlimit closedness check in Equalinternal/core/adtmerge validate package with adtinternal/core/adtadd tests for incomplete lists comparisoninternal/core/adtuse pointers for snapshot and result in nodeContextinternal/core/adtadd tests for Issue 3929internal/core/adthandle yields in Resolveinternal/core/adtadd tests for Issue 3972internal/core/adtmake small iota enums consistently uint8internal/core/adtallow lookup across disjunction boundaryinternal/core/adtapply vertex rewriting to blocked tasksinternal/core/adtadd tests for 3967internal/pkgonly use %s with stringifiable builtin errorsinternal/core/exportavoid panic on non-regular identifiers for packagesinternal/core/adtalso create embed scope for disjunctionsinternal/core/adtadd tests for 3964internal/core/adtfix default logicinternal/core/adtadd tests for 3958internal/corestart removing pre-toposort field ordering codeinternal/core/adtdon't check removed scopesinternal/core/adttrack scope of closed()internal/core/adtdo not remove embed groupsinternal/core/adtadjustments to closedness algointernal/core/adtchange ellipsis to fix hidden buginternal/core/adtupdate tests for 3833 and 3839 before fixinternal/core/adtadd tests for Issue 3920internal/core/adtalso typo check disjunctsinternal/core/adtadd tests for Issue 3957internal/core/adtremove most validator simplificationsinternal/core/adtcopy bounds.txtarinternal/golangorgxremove files build-tagged for old Go versionsinternal/golangorgx/tools/analysisinternalremoveinternal/golangorgx/tools/typesinternalremoveinternal/golangorgx/gopls/cache/methodsetsremoveinternal/golangorgx/tools/tokeninternalremoveinternal/cueexperimentenable cmdreferencepkg by defaultinternal/cueexperimenttoposort is always on nowinternal/cueexperimentkeep record of how experiments advancedinternal/cueexperimentfile embedding is always on nowinternal/core/adtpartially revert CL 1214950internal/core/adtadd tests for 3946internal/cueversionavoid dependency on golang.org/x/modinternal/core/adtdo not always filter disjunctsinternal/core/adtadd tests for 3947internal/cueexperimenttweak the docs for all experiment flagsinternal/cueversionbump languageVersion for v0.14internal/mod/modfiledatafactor out of mod/modfile
Other8
doc/ref/spec.mdsupport struct and list for equalitydoc/ref/spec.mddocument error builtin- update golang.org/x/... dependencies
cuecontextrevert support for CUE_EXPERIMENTcueexperimentexport Config type and use itREADMEminor updates- update all other dependencies
- update golang.org/x/...
Downloads
Every file this release published on GitHub, with its SHA-256. Most people install CUE as Installing CUE describes, which also shows how to check a download.
Archives
| Platform | File and SHA-256 |
|---|---|
| macOS, Intel | cue_1d72a3d992d9ede9984db10338cfdfe480079437c47b4cb99f77fdc7cd7367fe |
| macOS, Apple silicon | cue_4ff0e86ac45c1484247b8308d8e2a5adf8e527b1713d35ecbb50f6868f02821d |
| Linux, x86-64 | cue_9959bba0b5926da20cb282ade77a8124273ff8a3ccd577a33381d8340b589145 |
| Linux, Arm64 | cue_2caee4472438eed9e59a42cff73cb87f39945008c2a12b5b7addf0d32e5069aa |
| Windows, x86-64 | cue_86a8ae2876ddd9b8a5401b92f30514e6d0ce235a61a4a5377d3b29096661812d |
| Windows, Arm64 | cue_f384ee01ff8bdf6f3fc798daa9294df5f84a3c1f079ec8ed0e65a263f445fa5d |
SHA-256 checksums for all of these: checksums.txt