News for hackers. Stuff that matters.
Re:Jsonnet – The Data Templating Language by jordemort on Monday March 27, 2023 @11:11AM (#35327728)
There's also CUE: https://cuelang.org/
Re:Jsonnet – The Data Templating Language by IshKebab on Monday March 27, 2023 @12:19PM (#35328582)
Cue is a little different I think. It doesn't attempt to make writing configs less tedious through the use of functions.

It is more about schemas and reliably merging documents as far as I can tell. But weirdly given its focus on schemas I couldn't find any way for a document to link to a schema in-band!

Re:Jsonnet – The Data Templating Language by joshuamorton on Monday March 27, 2023 @12:49PM (#35329005)
It makes writing configs less tedious using templates.

Not really sure what you mean by "documents" though.

Re:Jsonnet – The Data Templating Language by verdverm on Monday March 27, 2023 @01:38PM (#35329720)
Some config formats like Yaml or Jsonl support multiple "documents" per file
Re:Jsonnet – The Data Templating Language by IshKebab on Monday March 27, 2023 @05:56PM (#35333278)
I mean multiple files.
Re:Jsonnet – The Data Templating Language by evancordell on Monday March 27, 2023 @01:25PM (#35329529)
> But weirdly given its focus on schemas I couldn't find any way for a document to link to a schema in-band!

In cue there's no real distinction between "schemas" and "documents". If you say:

   value: string
   value: "abc"
then cue "unifies" the definitions for `value`, sees that "abc" is a string, and therefore `value` is valid.
Re:Jsonnet – The Data Templating Language by IshKebab on Monday March 27, 2023 @06:00PM (#35333344)
Yes I know, but there's no in-band way to say "this file conforms to the schema in this other file" like you can with XML or JSON schemas.

For Cue you would probably just want to #include a file... but as far as I know you can't do that.

That makes it far less useful for IDEs, linters and so on.

I don't think there's any reason they couldn't add that feature. Just a bit odd that they haven't already.

Re:Jsonnet – The Data Templating Language by vhodges on Monday March 27, 2023 @01:04PM (#35329214)
Re:Jsonnet – The Data Templating Language by mdaniel on Monday March 27, 2023 @04:01PM (#35331629)
relevant: https://github.com/tweag/nickel#comparison-with-other-config...

FWIW, "YAML Typing = None" is for sure wrong, that's what the `!!map` annotations (https://yaml.org/spec/1.1/#tag/syntax) are for, and a very common RCE vector for dynamic languages since they can cause execution when the parser instantiates the types