News for hackers. Stuff that matters.
Re:Stripe open-sources Skycfg, a configuration builder for K... by simplify on Monday December 03, 2018 @03:55PM (#18592876)
It doesn't have functions, but I've also released a type-checked configuration language recently[0]. The main difference is it's designed to be easy to edit, even by non-technical users.

[0] https://github.com/gilbert/zaml

Re:Stripe open-sources Skycfg, a configuration builder for K... by jmillikin on Monday December 03, 2018 @04:09PM (#18593035)
Note that Skycfg isn't a language itself; we're using Google's Starlark (a deterministic Python dialect) for syntax and evaluation. This means that we get IDE support and tooling for ~free, such as Python syntax highlighting and Starlark formatting with Buildifier.
Re:Stripe open-sources Skycfg, a configuration builder for K... by simplify on Monday December 03, 2018 @04:28PM (#18593258)
A deterministic Python dialect is indeed very cool. I've dabbled in writing a deterministic language myself.

Syntax highlighting and formatting is nice, but I think error reporting is more important for the end user.

Zaml auto-validates configuration structure, removing the need to write most boilerplate on the programmer's side.

Can you help me understand Skycfg's type safety and validation? When I see `return [pb.StringValue(value = 123)]`, does this imply the schema is written inline, alongside the values?

Re:Stripe open-sources Skycfg, a configuration builder for K... by jmillikin on Monday December 03, 2018 @04:46PM (#18593414)
The schema is defined as a Protocol Buffer (https://developers.google.com/protocol-buffers/) package. This lets us construct values protobuf-based APIs without having to manually copy over the schema.

For example, if you had this schema:

  package my.example.schema;
  message Person {
    string name = 1;
    int32 id = 2;
    string email = 3;
  }
Then you could build a value using Skycfg like this:

  pb = proto.package("my.example.schema")
  msg = pb.Person(
    id = 1234,
    name = "Jane Doe",
    email = "[email protected]",
  )
  print(msg)
For Kubernetes, we're using the schema at https://github.com/kubernetes/api and for Envoy we use https://github.com/envoyproxy/data-plane-api/tree/master/env...
Re:Stripe open-sources Skycfg, a configuration builder for K... by corwin7 on Monday December 03, 2018 @06:44PM (#18594371)
> The main difference is it's designed to be easy to edit, even by non-technical users.

Yaml is beautiful and easy, this looks like a nightmare.

Re:Stripe open-sources Skycfg, a configuration builder for K... by kjeetgill on Monday December 03, 2018 @08:15PM (#18594938)
Many uses of YAML are beautiful and easy but the spec/parsers are anything but.

5 notations for things, unclear whitespace delimiters, graph/labels, etc.

https://news.ycombinator.com/item?id=17358103