Hacker News new | ask | show | jobs
by flaviu2 2481 days ago
Seems like an interesting language, but I'm very disappointed that my first attempt to view example code took 5 clicks.

The most important part of any programming language website is a short example snippet: put it above the fold on the front page!

6 comments

Well at least you could find an example.

I couldn't find anything after like a minute of searching. Unless we're counting the gif that slowly shows you an example project letter by letter.

Someone please link to the code.
The website is under active development at the moment and their are incomplete parts. For the code links please take a look at the following tutorial on GitHub at the moment.

* https://github.com/cuelang/cue/blob/master/doc/tutorial/basi...

* https://github.com/cuelang/cue/blob/master/doc/tutorial/kube...

Ya, first rule of PL promotion is that you have an example snippet of code in the first screen seen on your web page.
Yup. Tell me what problem you solve for me, and then show me how you do that.
I didn't even have to scroll down to see an example of code and usage.
Where? I don't see any example on the page linked to.

Edit: Ah, the code example only appears for desktop browsers (or at least, browser windows wider than a phone screen).

And only if you have javascript enabled.

And it's one of those trendy shitty live-typing demonstrations instead of just letting you read some text.

Works fine on my phone, though unlike desktop,I do have to scroll a little.
Even worse, the examples are complex and incomplete.
Or make me go blacklist this project and everything to do with it (largeCapital pop >5M)
I found this comment: "In V3 the hobby field is explicitly disallowed. This is not backwards compatibly as it breaks previous field that did contain a hobby field" in https://cuelang.org/docs/usecases/datadef/

So if you add a field, you break existing code that doesn't know about the field.

This is wrong. CUE has optional closed schemas marked by a double colon. The V3 entity you’re talking about is explicitly declared to be a closed definition and therefore disallows unknown fields in entities that claim to accord to the V3 type. Not all definitions are closed.

Even for those that you choose to close, it’s a matter of having different code for different definitions. The claim that it just automatically breaks isn’t true even when closed definitions are used.

BTW, this feature speaks to CUE’s intended purpose as a configuration language. It is (or at least can be) nice to ignore unknown fields in transmitted payloads for forwards and backwards compatibility. But if I’m trying to configure some software and misspell a field, I probably want the configuration file to fail validation, not have the software run with an unintended configuration.

I gave up looking after 1min
Can't see any examples in the github readme, or even in the codebase either.