Hacker News new | ask | show | jobs
by shahsyed 2142 days ago
You're partially kidding but you're 100% right.

Someone in another thread mentioned using some LISP or LISP-like language to solve this problem.

Would something like TOML make things better here?

What would have been the solution?

2 comments

Dhall is an example of a configuration language. Its programs must terminate. It aims for safety, claiming that it can support safe evaluation of untrusted code. https://dhall-lang.org/

TBH, I have no experience with it. But, it sounds like if you need a configuration language with programmatic features, it would be more suited to the job than a general purpose programming language.

XML, but I guess I won't get many friends for asserting that.
I really regret disliking XML all those years ago, now that I've seen the alternative.
Nope. Json has schema validation too, and every language has a json parser
JSON doesn't do comments.
Not officially, but it's fakeable
Which for me is a design smell, why bother with workarounds when XML already offers me all the best tooling out of the box.
For me, xml is just too much, and when working with C or C++ (not t sure about rust) it's just a pain. Can your json schema file not serve as the documentation?
If something like k8s implemented comments as specific comment fields that would actually be pretty useful. The fields could be parsed and show in GUIs.
That is the workaround, just add it as "comment":"comment text". Having one comment for each field in an object would get unwieldy though. Anther place for them is possibly in the json schema file.
Then use HTML and extend the functionality with JSX
Useless work when XML already has all the tooling available and battle tested in production.