News for hackers. Stuff that matters.
Re:NestedText, a nice alternative to JSON, YAML, TOML by quietbritishjim on Saturday October 03, 2020 @11:38PM (#24676364)
> You can just compile any constant as a stand-alone serialized message that you mmap into your code in a safe way.

Are you suggesting using a binary format for your config files? I think most people would find that more trouble than a decent text format.

> ... than you get with things like text protobuf

You can just use protobuf's canonical JSON representation (thought the lack of ability to use comments is annoying).

Re:NestedText, a nice alternative to JSON, YAML, TOML by vlovich123 on Sunday October 04, 2020 @01:59AM (#24676822)
You store your configuration as plain text in your repository and whatnot. When it comes to deployment you just compile it to a binary file.

Cap’n’proto also has plain text and JSON serialization formats if you really want to have your deployed config file be directly human-editable and deserialize from that. I was just noting a very cool feature of having your config written in cap’n’proto and it’s what Cloudflare uses to maintain a bunch of config internally if I read Kenton’s allusions to it correctly.

Re:NestedText, a nice alternative to JSON, YAML, TOML by vlovich123 on Sunday October 04, 2020 @11:21AM (#24679657)
Just to be clear, I'm saying you use Cap'n'Proto constants to store your schema: https://capnproto.org/language.html#constants

You can then compile it into whatever format (JSON, plain text, binary) that you want for actually reading it from disk.

Re:NestedText, a nice alternative to JSON, YAML, TOML by LibertyBeta on Sunday October 04, 2020 @12:08AM (#24676458)
I think the parent is typing to say that the data is stored in a map which is read to a proto, etc. Kinda like what GPRC does over HTTP. Which kinda makese sense. The schema gives you a great idea of what "should be", and the typing/errors/etc are understood by the host language.