-
Notifications
You must be signed in to change notification settings - Fork 283
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
pkg/**: stdlib and builtin expansion #348
Comments
Original reply by @mikelnrd in cuelang/cue#348 (comment)
I came here to request this. I've had some recent success implementing some existing kubernetes tooling using cue. The existing tooling involves hashing, and I am unable to choose the hash function as it needs to match the existing go implementation for compatibility reasons. I've done this twice recently (currently in love with cue, thanks a lot for the hard work!): In the first case the hash function used was sha256 which is already in the cue stdlib, so I was able to complete the implementation in cue successfully. But in the second case the hash function is https://golang.org/pkg/hash/fnv/ which sadly isn't in cue's stdlib. It'd be great if you'd accept a pull request to add it (?), but more generally I'd love to able to define my own functions like this (understanding, a bit like with Bazel, that they need to be hermetic & deterministic). Thought I'd post this here as an end-user experience report in case it's helpful. .................................................. PS: Here's the kubernetes tooling I'm working with by the way: hash/fnv is used in kubernetes-sigs/cli-utils (which is used by google's new kpt tool): and here's my cue code (albeit using the wrong hash function):
|
Original reply by @verdverm in cuelang/cue#348 (comment) Same comment about user defined builtins: cuelang/cue#423 (comment) |
Original reply by @apstndb in cuelang/cue#348 (comment) I have also noticed that to generate JWT in CUE is hard because there are no |
Original reply by @verdverm in cuelang/cue#348 (comment) CUE is hermetic and I'm not sure secure crypto generation aligns with that goal |
Original reply by @apstndb in cuelang/cue#348 (comment) Yeah, generally |
Original reply by @verdverm in cuelang/cue#348 (comment)
|
Original reply by @verdverm in cuelang/cue#348 (comment) Of note, I just noticed tou are working in the non-hermetic area of the |
@apstndb @verdverm in the context of this discussion I note the recent adding to
|
Originally opened by @verdverm in cuelang/cue#348
Generally, we would like to see the standard library expanded.
At this point I am starting a conversation about the topic. We can change this header as things become better understood.
Thoughts:
Another thought is...
iirc, the way builtins are happened, this might not be overly difficult. There is the issue (still to be created) that fields named the same as builtin funcs are sorted before other fields in a struct.
Functions and Packages:
From Go, for
pkg/tool
From Go, for pure cue
pkg
expansionExternal, for pure cue
pkg
expansionMoonshot:
cue.Value
rather than the exported / data forms.I can see writing a cue tool which has a schema with it, and then processing local cue packages with the tool. So there may be a need to load and process other cue files from within the tool portion of a cue "program"
The text was updated successfully, but these errors were encountered: