News for hackers. Stuff that matters.
Re:Zellij – A Terminal Workspace and Multiplexer by donio on Thursday April 22, 2021 @12:09PM (#26904405)
YAML sucks but so does TOML, especially when it comes to nested data structures like the layout.yaml shown on the front page.

There are no good configuration languages in existence and there never will be. We have rejected Lisp/sexp so now we must suffer endlessly.

Re:Zellij – A Terminal Workspace and Multiplexer by brundolf on Thursday April 22, 2021 @01:27PM (#26905369)
I think JSON would be perfect if it a) allowed comments, and b) had multi-line strings.

It has exactly five data types, each with very clear and distinct notation that nests consistently (the top level isn't somehow "special" and there's no messing with significant whitespace). Only two collection types: keyed, and unkeyed. In some sense it feels like the apotheosis of untyped data-modeling.

Re:Zellij – A Terminal Workspace and Multiplexer by sammorrowdrums on Thursday April 22, 2021 @01:56PM (#26905752)
a) reminds me so much of this classic

https://thedailywtf.com/articles/the-inner-json-effect

“Tell us what you did to JDSL,” one of the VP’s asked.

“I don’t think I did anything,” Jake answered. “I’ve only been here two weeks, trying to learn JDSL and how the customer portal works. I don’t even know how to deploy it!”

“You made a few commits to Subversion!” Tom shouted.

“Well, yes. I added a few code comments, trying to–”

“You can’t use comments in JDSL!” Tom shouted. “THAT’S WHAT BROKE IT!!”

Re:Zellij – A Terminal Workspace and Multiplexer by aniforprez on Thursday April 22, 2021 @02:11PM (#26905939)
That 100% has to be fake. I NEED it to be fake. Are there production systems that work like this? Du they have one "rockstar" developer who does stuff like this?
Re:Zellij – A Terminal Workspace and Multiplexer by fwip on Thursday April 22, 2021 @03:00PM (#26906729)
Most of TDWTF is a kernel of truth surrounded by about three pages of fiction.
Re:Zellij – A Terminal Workspace and Multiplexer by xxpor on Thursday April 22, 2021 @01:42PM (#26905557)
I just wish JSON had fixed decimal numbers, a timestamp type, and a binary blob type :/
Re:Zellij – A Terminal Workspace and Multiplexer by IshKebab on Thursday April 22, 2021 @01:08PM (#26905138)
I agree that TOML sucks for nested structures.

JSON5 is probably the best option at the moment.

https://json5.org/

* Instantly obvious what the structure is (unlike YAML or TOML).

* Everyone knows JSON already. This just makes it a bit nicer.

* No noob security mistakes or type confusion caused by underquoting like YAML.

Re:Zellij – A Terminal Workspace and Multiplexer by somethingwitty1 on Thursday April 22, 2021 @02:45PM (#26906480)
Don't forget the truncation problem with YAML/TOML. A partially read/transmitted YAML/TOML file is often still considered valid.
Re:Zellij – A Terminal Workspace and Multiplexer by dflock on Thursday April 22, 2021 @03:36PM (#26907166)
That also makes it really easy to concatenate them, either `cp a.yaml + b.yaml c.yaml` or just `cat a.yaml >> b.yaml` - which is quite nice, compared to trying to do this with JSON etc... files.
Re:Zellij – A Terminal Workspace and Multiplexer by nine_k on Thursday April 22, 2021 @12:32PM (#26904705)
I would say that Dhall is fine, just from a parallel universe.

JSON is close to sexps, but it sucks when comments are not allowed.

Re:Zellij – A Terminal Workspace and Multiplexer by nathell on Thursday April 22, 2021 @12:42PM (#26904829)
Which is why EDN is so much better for config.
Re:Zellij – A Terminal Workspace and Multiplexer by sysbot on Thursday April 22, 2021 @02:15PM (#26906005)
Have you looked at Cuelang [1] as a configuration language or source of truth?. It's still new but it's a superset of JSON but attempted to combine data/schema into one and reject inheritance and replace with validation instead.

[1] https://github.com/cuelang/cue/tree/master/doc/tutorial/basi...

Re:Zellij – A Terminal Workspace and Multiplexer by rch on Thursday April 22, 2021 @12:36PM (#26904744)
Take a look at HOCON (Human-Optimized Config Object Notation)

https://github.com/lightbend/config/blob/main/HOCON.md

Re:Zellij – A Terminal Workspace and Multiplexer by KajMagnus on Thursday April 22, 2021 @02:04PM (#26905855)
Yes! I logged in just to mention HOCON, then I noticed you have mentioned it already :- )

So, the project you linked to is Java / Scala: https://github.com/lightbend/config

And there're also (basic? complete?) HOCON parsers in Javascript and Rust — I investigated this a while ago, because I want to use HOCON everywhere in my projects:

https://docs.rs/hocon/0.5.1/hocon/ (Rust)

https://www.google.com/search?q=hocon+javascript (Js, a few different)

The Rust version:

> This implementation goal is to be as permissive as possible, returning a valid document with all errors wrapped in `Hocon::BadValue` when a correct value cannot be computed

How nice :- ) (it seems to me)

Re:Zellij – A Terminal Workspace and Multiplexer by wtetzner on Friday April 23, 2021 @11:28AM (#26915721)
I agree about sexps, it feels like the right default for storing human readable data. The only place where I think it's a little weak is when used more like markup, since data would need to be in quoted strings.

That definitely seems like a solvable problem though.