News for hackers. Stuff that matters.
Re:Cue, an open-source data validation language by rjrodger on Tuesday June 15, 2021 @03:27AM (#27512327)
Started working on a JS version a few weeks ago [1]. Even with 20% of the features it’s already so useful we’re building systems with it. And not just config - model all the things!

Overrides and inheritance are a world of pain. Unification and commutative operations restore sanity to the actual work of coding with a domain representation language because WYSIWYG. And you get type safety for your domain model.

The project is still at the “Read the Source, Luke” stage so caveat emptor until we get a respectable release out.

* https://github.com/rjrodger/aontu

Re:Cue, an open-source data validation language by sdboyer on Tuesday June 15, 2021 @06:58AM (#27513509)
Very excited to see someone doing this! Right now, Grafana is [planned to] relying on an anemic CUE->Typescript translator for getting its schema to the frontend - https://github.com/sdboyer/cuetsy. (Somebody also pointed me to Project Cambria recently, which could be an interesting compilation target for what we have https://www.inkandswitch.com/cambria.html)

Being able to work with CUE natively in TS, though, would be a huge gamechanger for what we can do with CUE in Grafana

Re:Cue, an open-source data validation language by rjrodger on Wednesday June 16, 2021 @06:18AM (#27526838)
Our implementation is in TS. However that's just an API. Do you have some ideas on how you'd like the TS type system to work with the Cue type system. It's an open question for us.
Re:Cue, an open-source data validation language by wdb on Tuesday June 15, 2021 @06:56AM (#27513485)
Nice, I was looking for a Javascript version. I will check it out. Regarding "Read the Source, Luke" you are in good company with Apple and its Swift ABI :)
Re:Cue, an open-source data validation language by rjrodger on Wednesday June 16, 2021 @06:17AM (#27526827)
And we kinda leverage the docs on cuelang.org since the syntax and semantics are mostly the same!
Re:Cue, an open-source data validation language by d0100 on Tuesday June 15, 2021 @08:01AM (#27514033)
Does this make it possible to add syntax highlight and validation in an editor like monaco?
Re:Cue, an open-source data validation language by rjrodger on Wednesday June 16, 2021 @06:15AM (#27526821)
Yeah - we're just cheating and using YAML syntax modes for the moment which mostly works. The plan is to support LSP for much better DX of course.