Skip to content

@mpvl mpvl released this Sep 13, 2019

A few bug fixes

There were a few small bug fixes that, even though old, were serious enough to warrant a new release.

This also finalizes the implementation of allowing full expressions for embeddings.

Changelog

e53305e cue/parser: allow full expressions for embeddings
0ac550c cue: eliminate generation of block quotes
7c9b88c cue: fix bug in type inference
fdd9b71 cue: fixes number groundness inference

Assets 7

@mpvl mpvl released this Sep 12, 2019 · 4 commits to master since this release

Language touch ups

New-style Comprehensions

This release is characterized by the redesign of field comprehensions, now struct comprehensions. The old format is still supported, but cue fmt will rewrite it to the new format.

The new format looks like:

for k, v in a {
   "\(k)": v
}

instead of

"\(k)": v for k, v in a

This may seem like a gratuitous change, but it has many advantages:

  • generated structs are syntactically and semantically like embeddings
  • large comprehensions are clearer
  • a single iteration can add multiple fields
  • makes scoping clearer

Removal of block quotes

Because a comprehension may start with if, we can use if false { ... } to disable a large block. This, and various other considerations have led to the decision to remove block quotes from the language.

Block quotes are still supported, but they are no longer generated and cue fmt will translate them.

Quoted identifiers

CUE now allows identifiers to be quoted with back ticks:

`foo-bar`: 2

baz: `foo-bar`

This allows fields with odd names to still be referenced using identifiers. More importantly, the allowed space of identifiers should ideally be limited. For instance, it is a good idea to require them to be in Unicode normal form NFC. Allowing arbitrary strings as identifiers seemed like a bad idea. CUE will soon disallow this. For now, cue fmt rewrites strings used labels is they are referenced by some nodes.

Quotes also have another benefit. A disadvantage of the new style comprehensions is that it is harder and less clear to allow the keywords of comprehensions as field names. Consider for instance:

for x in src: 2

CUE will now only allow one such keyword as a field name, but requires quoting otherwise. A future cue fmt may rewrite this as:

`for` x `in` src: 2

Backwards incompatible changes

The language changes introduced do not break anything, as the old formats are still supported. However, at some point they won't be. So be sure to run cue fmt at some point.

  • The ast.LabelName has been changed to have proper semantics in light of the upcoming changes. The signature has been change to reflect the changes properly and to assure code is properly investigated in light of these changes.
  • Comprehensions now iterate only over non-optional regular fields, as would perhaps be expected.
  • Top-level emit values are printed in eval output
  • Top-level struct embeddings are merged in the API

Changelog

b50aecd cmd/cue: make fmt rewrite deprecated cue
21fa535 cue/ast/astutil: export Resolve functionality
0dcf17b cue/ast/astutil: implement Apply
e4523e2 cue/ast/astutil: pick name based on import path
530467a cue/ast/astutil: support adding imports
24d14c5 cue/ast/astutil: use unlikely name for import
40c76b7 cue/ast: add API for setting a position
f0bcfb9 cue/ast: add API to modify comments
92408e3 cue/ast: add back LabelName
749a667 cue/ast: convenience constructors for common types
fe5f886 cue/ast: first step to new comprehension format.
57d6751 cue/format: expressions.input
9af9a90 cue/format: output new comprehension format
982b194 cue/format: tweaks to support embeddings
71eafc4 cue/parser: parse new comprehension syntax
3c38bfc cue: add test for package name override
4245fb4 cue: for structs, iterate only on non-optional regular fields
835ed58 cue: implement quoted identifiers
da00c8b cue: implementation of new comprehensions
7fc421b cue: remove block comments and slices from the language
1fa0552 cue: tighten API of comprehensions
b36d81a cue: various cleanup
1f5a903 doc/ref: allow embeding to be Expression
d44b092 doc/tutorial/basics: some minor fixes
48f82f1 doc/tutorial/basics: update w.r.t. spec.
15aeace pkg/list: add Haskell-style Take and Drop
1ffb95f pkg/list: adding slice function

Assets 7

@mpvl mpvl released this Sep 10, 2019 · 31 commits to master since this release

Bug fixes and builtins

The central theme of this release is bug fixes, most notably in the cue command line utility.
It also adds and improves on some of the builtins in the pkg directory.

Backwards incompatible changes

The crypto hash builtins now return a value of type bytes, instead of a list of bytes.

Changelog

cb84024 cmd/cue/cmd: fix --dryrun flag description of import command
fe695b1 cmd/cue: give access to cue Command in run functions
9818761 cmd/cue: update get to use definitions
507d6cc cmd/cue: use concrete mode for vet on data files
f3df637 cmd/cue: use stderr and non-zero exit for errors
330999b cue/pkg/crypto: make return types bytes, instead of list
1c4d597 cue/scanner: don't allow repeated _ in numbers
18637db cue: closedness only applies to regular fields
5e8c391 cue: exempt aliases and embeddings from recursive closing
34988fa cue: fix 0/0
4017875 doc/ref: spec changes to comprehensions and identifiers
da39f0f doc/tutorial/basic: Unified TOC, next/prev, titles
980e018 doc/tutorials/kubernetes: update comments
8b4cab6 doc: fixed small errors
d2563c1 go.mod: update xerrors to a985d3407aa7
41e30c6 pkg/list: adding aggregation for decimal lists
9d5bc94 pkg/strings: Remove fmt.Println
b36c351 pkg/strings: fix MinRunes
061bde1 spec: corrections, clarifications, comments

Assets 7

@mpvl mpvl released this Aug 29, 2019 · 50 commits to master since this release

Changelog

f40ecd9 cue: flx bug for len on non-concrete values
7f9d026 doc: updating slack invitation link
8f3347f go.mod: update proto package

Assets 7

@mpvl mpvl released this Aug 26, 2019 · 53 commits to master since this release

Changelog

6817c99 cue/parser: bug fix: allow embeddings on one line
d99e32e cue: define BottomKind as 0
b7e44a9 cue: fix builtin type signature
8089092 cue: fix premature fixing of some incomplete values

Assets 7

@mpvl mpvl released this Aug 25, 2019 · 57 commits to master since this release

Changelog

3056594 : add Homebrew install instructions to README.md
aa35a9f cmd/cue: allow help to work without cue files
28a9191 cmd/cue: allow vet to check CUE against JSON and YAML
90bca2f cmd/cue: don't break help if not commands are defined
29a11be cmd/cue: fix linter warnings
3908dac cue/ast: make package clause a declaration
ed08085 cue/ast: split off Ellipsis from ListLit
9471633 cue/format: fix linter warnings
6a9badd cue/load: add Dependencies, rename Root and improve test
96ef9aa cue/load: implement package name qualifiers
d208ff1 cue: add another example
80b7904 cue: allow bottom for optional fields
cc5aaa6 cue: changes ahead of unchecked unification
f1b87bf cue: disallow string and bytes indexing and slicing
e47dda7 cue: don't print definitions in concrete mode
7c1b39e cue: fix Windows breakage
6351fc2 cue: fix Windows build breakage
828a643 cue: fix crash related to package name
2e7c882 cue: fix error formatting issues
bc432d5 cue: fix issues related to '_'
6659da2 cue: fix linter warnings and divide by zero error
400f621 cue: implement closed structs for subsumption
5134dee cue: implement embedding and close structs
cd81fa9 cue: implement parsing and formatting of definitions
bfbcd50 cue: support multierror return from Unify
94b3193 cue: unknown reference are incomplete
6c35af6 doc/ref: change meaning of numbers and lists, remove %
62658a8 doc/ref: define defintions, closed structs and embedding
7414fae doc/ref: propose restrictions on package paths
fbab65d doc/ref: remove dot import
4108f80 doc/ref: simplify string model
ed718e2 doc/tutorials/basic: update hidden.md
2e9193f doc/tutorials/basic: update numbers.md
483afc5 doc/tutorials/basic: update regexp.md
6dc6d63 doc: adding user-defined package import example
2b56efa encoding/openapi: add support for deprecated field from protobuf
ceb003d encoding/openapi: allow empty string from ReferenceFunc
35abfa7 encoding/openapi: define strict order on fields
9fad62f encoding/openapi: implement structural schema
97a56d7 encoding/openapi: remove deprecation notice of old api
743365e encoding/protobuf: add more proto to JSON conversions
c1d1f1a encoding/protobuf: ensure predeclared identifiers are not masked
5f47167 encoding/protobuf: make map field as not required by default
84ffa3c encoding/protobuf: make oneOf fields required
13c9718 encoding/protobuf: provide default import path and short name
b1d4439 encoding/protobuf: remove extra space in comment
41cce52 pkg/encoding: add {yaml.json}.Validate
ff51e07 pkg/strings: add ByteAt, ByteSlice, and Runes

Assets 7

@mpvl mpvl released this Aug 7, 2019 · 105 commits to master since this release

Changelog

74c19ff .goreleaser.yml: set commit_author info for homebrew config
2463e2d cue/ast: rename EmitDecl
b7d24b8 cue/errors: always add error
3bc7dd3 cue/load: Unix-related fixes related to 5a3cce0
55b58eb cue/load: fix comment
9811321 cue/load: fix module loading bug
dd9bff0 cue/parser: added fuzzing code and fix one issue
f03161d cue/parser: attach attributes to correct field
9467491 cue/scanner: added fuzzing code
9c96be3 cue: add Raw option
56f120c cue: add Struct type
5ba7174 cue: add Value.Equals method
ed81a47 cue: allow getting Runtime from Instance
b6baed4 cue: cleanup before implementing close structs
c3b171d cue: fix attribute parsing bugs
0be096f cue: fix bug when using multiple custom validators
1372f3e cue: fix import shortname mapping
29236f2 cue: fix possible drop of doc comment in unification
60ae081 cue: fix top shortcut
9501233 cue: handle builtins used as values
e2e2e63 cue: ignore fields of Go types unmappable to CUE
9934915 cue: implement marshaling and restoring instances
5a3cce0 cue: implement recursive marshalling
332ea47 cue: improve coverage of Go value conversion
f06f781 cue: improve error messages
42cfa68 cue: improve naming of Runtime methods
4fe2fb5 cue: include package name in debug output for builtins
48d8732 cue: maintain type cache per index (runtime)
d8f4450 cue: observe JSON mappings for google.protobuf.Struct
99e7b6d cue: preserve path info in unification errors
0265ac2 cue: remove unify function
222d96c cue: tighten type
eac8f9a cue: treat cycle errors as normal incomplete errors
c8e131d cue: treat disjunctions as normal non-concrete values
259bdfe cue: unexport NewInstance from api
dc30df1 cue: update builtins
d6ec5cf cue: use more realistic arguments for TestDecode
5608a83 cuego: use Runtime to simplify code
c3d0b48 doc/tutorial/kubernetes: fix typo
66ec959 doc/tutorial/kubernetes: fix typos
15bb998 doc/tutorial/kubernetes: support for gnu sed
26d8901 doc/tutorial/kubernetes: update to minimize diff
980b30c doc: adding cue community contact information
240a995 encoding/gocode: add Go code generator
73e3f6b encoding/openapi: bug fixes in expandReference
6cea136 encoding/openapi: introduce support validator methods
6bf3697 encoding/openapi: support time types
afd1cc5 encoding/protobuf: fix linter issues
64cb20a encoding/protobuf: implement time type conversions
4e5b69a encoding/yaml: expose internal yaml functionality
1233594 internal/third_party/yaml: decode bool and null to BasicLit
4697b78 internal/third_party/yaml: improve yaml positining
1ceb046 pkg/list: add list builtins for OpenAPI features
b05c768 pkg/math: added MultipleOf
1588fe0 pkg/net: added package
730165c pkg/strconv: remove CanBackquote
ce195d2 pkg/strings: add MinRunes and MaxRunes
3086ea6 pkg/struct: add Min/MaxFields builtins
8090639 pkg/time: define time types and builtins
ca05b5f pkg/time: use UTC time zone for Unix and Parse
55039f3 pkg: adding base64 encoding for strings

Assets 7

@mpvl mpvl released this Jul 9, 2019 · 166 commits to master since this release

Changelog

561b39a cmd/cue: improve error messages for unknown commands
05fbfe4 cue/errors: make List implement Error
a68a786 cue/errors: remove List from public API
7b7ccdd encoding/openapi: add FieldFilter option
4de93e1 encoding/openapi: add Info and DescriptorFunc features
865f159 encoding/openapi: change naming in line with standard
0a97533 encoding/openapi: correct typo
c89f5a6 encoding/openapi: make OrderedMap type opaque
f94a548 encoding/protobuf: make names consistent with new convention
c891137 encoding: adopt naming convention for conversions

Assets 7

@mpvl mpvl released this Jul 1, 2019 · 176 commits to master since this release

Changelog

d87f9d4 cmd/cue: allow incomplete in vet
61c220f all: add .gitignore
633834d all: add homebrew config to goreleaser
f23a596 all: and go.sum
128976f all: update sync dependency
4fcba03 cmd/cue: fix deduplication of message in vet
ad3fde1 cue/build: get rid of ParseOptions
70108ad cue/errors: convert more errors to cue/errors.Error
2d9b769 cue/format: allow invalid identifiers as labels
4954491 cue/format: simplify Node API
eadbea7 cue/load: allow file overlays
2c18c7c cue/load: allow storing module in cue.mod
065bfd4 cue: change Reference to return Instance as well
1dbda0e cue: fix gen.go and rerun go generate
99d1872 cue: limit validation depth
1700232 cue: use v2 of abitrary precision decimal package
ef90d5c encoding/openapi: add option to close over imported types
a0d2a40 encoding/openapi: simplify based on user-defined format
93e9597 encoding/protobuf: add Builder API
ffe4ced encoding/protobuf: don't make oneOf required by default
f9bd63e encoding/protobuf: don't map google.protobuf types
eae20e0 encoding/protobuf: don't mark a single enum value as default
13a9d4d encoding/protobuf: remove test binary

Assets 7

@mpvl mpvl released this Jun 26, 2019 · 199 commits to master since this release

Changelog

59018e6 all: add initial goreleaser config
e4ce243 cue/parser: factor out source reading into internal package
5e3a5d4 cue/scanner: improve escape modifier handling
95fcc28 cue: Elem should return unevaluated value
b545d8e cue: add String method for Op
6767a01 cue: precompile regular expressions
fdd176c encoding/openapi: few tweaks in the output
ebf960e encoding/openapi: record path in error
a5286e4 encoding/protobuf: moved from internal dir
368b433 encoding: add package documentation
9fe5fed internal/proto: move location of cue/cue.proto
3074aeb internal/protobuf: add Parse example
fbcb339 internal/protobuf: record position information

Assets 7
You can’t perform that action at this time.