Live data from Hacker News

Show HN: I made Confetti: a configuration language file format

confetti.hgs3.me

11–20 of 64 posts

Re: Show HN: I made Confetti: a configuration language file format

#11

> Confetti does not compete with JSON or XML, it competes with INI. It clearly competes with JSON. I think I would still much rather use JSON5 over this. It's quite similar in terms of structure and terseness, but I don't have to learn anything. // This is a comment. { probe_device: ["eth0", "eth1"], users: [ { user: "*", login: "anonymous", password: "${ENV:ANONPASS}", machine: "167.89.14.1", proxy: { try_ports: [58…

JSON with comments and trailing commas is all I want.

Call it j5on

Re: Show HN: I made Confetti: a configuration language file format

#12

> Confetti does not compete with JSON or XML, it competes with INI. It clearly competes with JSON. I think I would still much rather use JSON5 over this. It's quite similar in terms of structure and terseness, but I don't have to learn anything. // This is a comment. { probe_device: ["eth0", "eth1"], users: [ { user: "*", login: "anonymous", password: "${ENV:ANONPASS}", machine: "167.89.14.1", proxy: { try_ports: [58…

JSON with comments and trailing commas is all I want. Call it j5on

This exists: jsonc – and it's somewhat widely used, such as for VS Code configuration.

Re: Show HN: I made Confetti: a configuration language file format

#13

> Confetti does not compete with JSON or XML, it competes with INI. It clearly competes with JSON. I think I would still much rather use JSON5 over this. It's quite similar in terms of structure and terseness, but I don't have to learn anything. // This is a comment. { probe_device: ["eth0", "eth1"], users: [ { user: "*", login: "anonymous", password: "${ENV:ANONPASS}", machine: "167.89.14.1", proxy: { try_ports: [58…

JSON with comments and trailing commas is all I want. Call it j5on

That's JSONC. But JSON5 adds some more nice stuff without being overkill IMO.

https://json5.org/

Re: Show HN: I made Confetti: a configuration language file format

#14

Why is typeless considered something good?

You're going to read the configuration in a target programming language So if the config format has its own type system you then have to convert between config types and language types If the config type doesn't map exactly onto the target lang type you either ignore it and accept some values won't round-trip cleanly or without error, or you fall back to using strings (e.g. various possible integer type sizes, signed…

I see your argument tho maybe im just not getting the real use case.

Because when saying defaulting back to string and thatfor ignoring typing, wouldnt that just be the same as beeing typeless? Therefor doesn't every format support string therefor supporting typeless?

Also, in how many cases do you need to parse the same configuration in multiple different languages?

Im not saying its not useful - i just try to get the use case for this arguments.

Re: Show HN: I made Confetti: a configuration language file format

#15
post #7

Why is typeless considered something good?

I guess its because you can allow for custom data formats. You'll have to validate/parse the file anyways, and maybe having utc timestamps is worse than local date-time notation. Especially if the user is supposed to edit the file by hand. I know for sure I'd like "timeout: 1h6m10s" more than "timeout: 3970". So unless you want to support really specific datatypes just being typeless is better. Putting everything in…

So i get your point with date/time - while i may be an oldie with still preferring just having an integer seconds - but thats subjective to me.

Tho the quote for string argument i can't fully agree on. While sure in for example a json i would have to quote the values if i want them "typeless as string" - tho json is far supported everywhere and i'm able to interpret the parsed string values in whatever way i want to.

Adding a new dependency (confetti parsing) to spare out quotes doesn't seem to be worth the convenience to me.

Tho - both probably very subjective things to me.

Re: Show HN: I made Confetti: a configuration language file format

#19
So weird, I was toying with a DSL 1-2 years ago and strongly considered turning it into a configuration language because the ergonomics were much nicer than JSON or YAML, and reminded me of HCL in a way. It looked very similar to this.

I abandoned the effort, but nice to know that someone else had a similar idea. Will be trying this out!

Re: Show HN: I made Confetti: a configuration language file format

#20
post #18

I don't trust a config file that doesn't enforce quotes around strings. it's a footgun especially when it collides with ill-defined boolean

I think you missed the "typeless" idea. That basically means every value is a string and so it's up for the application to parse and validate.
Post reply on HN