v0.3.0-beta.5
This release has some important bug fixes. It also is a bit stricter in considering some errors that were previously evaluation-time errors to be compile time errors.
There is also a slight change in default handling, which should not affect most configurations.
New compile-time errors
The expression >10 <20 is syntactically valid CUE, but can never meaningfully evaluate to something. It parses as >(10 < 20) and thus evaluates to >true, which is undefined. The error messages associated with this were often confusing to the user. Also, leaving this to be detected during runtime would sometimes hide the error away.
Consistent with the “fail early” mantra, these cases are now detected and reported by the compiler.
Backwards compatibility
Defaults
Previously, for
#def: {
*{} | {a: int} | {b: int}
*{} | {c: int} | {d: int}
}
x: #def & {a: int}would officially resolve to
x: {a: int} | {a: int, c: int} | {a: int, d: int}Thanks to a hack in the current v0.3 implementation, the first disjunct was made the default and all resolved fine. We have now slightly changed the definition of defaults to handle this case. Basically, now if during a unification all terms of a disjunction that are marked as default are eliminated, the remaining terms will behave as if they originated from an unmarked disjunction. In practice this means defaults behave as users typically expect them to behave. This may also cover cases that were not previously handed
Note that v0.2 solved things differently: if in the result of a disjunction one term subsumes another, then the latter could be dropped. So in v0.2, the answer would be x: {a: int}, even in the absence of defaults. The problem with this approach is that it could lead to confusing answers and that the default could not always be accurately determined. A goal of v0.3 was to have a simpler story for disambiguation and let simplifications be merely a matter of optimization.
There is still a slight discrepancy in the current implementation and the spec that may cause unexpected results. We expect this to be sufficiently rare and we intend to address this in a rework of disjunction computation, aimed at further performance optimizations.
All changes
19 changesby area
doc3
doc/ref/spec.mdadd missing binary_digitsdoc/tutorialaddress cuelang/cuelang.org#126docfix install instructions in main README and contributing
internal11
internal/core/adtcomment out leak testinternal/core/adtcontrol fixes for if clausesinternal/core/adtfix trim buginternal/core/adtsome optimizations for pattern constraintsinternal/core/adtstrip "notDefault" status for disjunctions with unused defaultsinternal/core/compilemake>10 <20a compile errorinternal/core/convertfix conversion from floatinternal/core/evalhandle embedded top correctlyinternal/core/exportfix quoting of definitionsinternal/cuetestconsolidate testscript/cuetxtar helpersinternal/cuetestmove Kubernetes related helper to where they are used
tools3
tools/trimadd tracertools/trimdon't trim shared nodestools/trimfix defaults bug
Other2
cimove to non-Docker version of goreleaserciskip known flakey test on go1.15 windows
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_aef41df71c1507795d090f809afb4cdcbef6365e0bcbe4f7779d0d54afaec39c |
| Linux, Arm64 | cue_140f130f677037fc5daef5c23d2c74e207be963bb775bfedaf4ab5e2ad02862d |
| Linux, x86-64 | cue_f1ccf4fae2079ecb825e7bf9694f053088a3651c92c1399fdaa0a8d8104f47d5 |
| Windows, x86-64 | cue_5063c681e5b097c30d5b482975cbf4ef9e73251738bf2690049c616ee596d798 |
SHA-256 checksums for all of these: checksums.txt