There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

sugar_in_your_tea ,

How able Lua?

It’s a programming language, so you can do fancy stuff, or you can just use it as a regular key value file. You can also safely enable/disable features so you only need to allow the subset of Lua that you need.

It works really well for things like editor configuration (see neovim), and it’s especially nice if you already use Lua as a plugin language or something.

Andy ,
@Andy@programming.dev avatar

nestedtext.org

It’s like yaml but simple, consistent, untyped, and you never need to escape any characters, ever.

Types and validation aren’t going to be great unless they’re in the actual code anyway.

static_caster ,

If you use protobuf/gRPC anywhere in your application, text format protobuf. Writes like JSON, but with a clear schema, a parser that already exists in most languages, and has comments.

Lettuceeatlettuce ,
@Lettuceeatlettuce@lemmy.ml avatar

.ini has never let me down.

flambonkscious ,

It’s a bit janky with spaces and things, but the simplicity is insane!

Lettuceeatlettuce ,
@Lettuceeatlettuce@lemmy.ml avatar

Yup yup!

drwho ,
@drwho@beehaw.org avatar

Not XML. Not binary-only (looking at you, Solaris).

Personally, I like .ini-style config files, but I’m weird that way.

GissaMittJobb ,

Toml is kind of ini++, though, isn’t it.

drwho ,
@drwho@beehaw.org avatar

I don’t know. Never really thought about TOML.

GissaMittJobb ,

Check out the spec sometime. It’s basically ini with some stuff added on top.

It’s quite nice when you need something that parses into some kind of map, while being human readable.

argv_minus_one ,

JSON is overly verbose and doesn’t allow comments. Please do not use it for anything that humans frequently need to read or write.

YAML is a syntactic minefield. Please do not use it for anything ever.

Sir_Simon_Spamalot ,

How is it syntatic minefield? I find it at least more reasonable than XML. The comment feature is nice to have.

nubbucket ,

yaml is susceptible to things like the Norway problem: www.bram.us/2022/01/11/yaml-the-norway-problem/

There’s also a lot of stuff that can go wrong with deserialisation that make it a tricky dependency for security purposes. I like how yaml looks and it’s obviously much better than XML, but it had those potential problems

dmoonfire ,

Overall, JSON5 (having comments and end-of-line commas is a big reason I got into YAML).

I suffer with YAML, but use it pretty heavily. It also has the * and & operators which I use fairly heavily, and it fits well with the Markdown + YAML I use, but I hate that whitespace indenting with a passion.

Occasionally, I look at Nickle (https://github.com/tweag/nickel) and KDL (https://kdl.dev/) and I get really tempted, just haven't made that jump.

hellishharlot ,

Json

jollyrogue ,

UCL and HCL are interesting, but YAML is more widely supported.

ksynwa ,
@ksynwa@lemmygrad.ml avatar

I really dislike when indentation is a part of the syntax (like in YAML). Apart from that it depends on the requirements of the project.

JackbyDev ,

The one already being used by the project.

sugar_in_your_tea ,

Yup. If I have to pick one for a new project, I’ll go with TOML unless there’s a reason to pick something else. I like that it’s simple, while also having a bunch of features for when the project grows.

JackbyDev ,

Pretty much same here. With Spring stuff I still use YAML because TOML doesn’t have first class support yet. If TOML is an option I don’t have to go too far out of my way for them I go for it.

YAML has too many foot guns. It’s still less annoying to read and write than JSON though. Properties files are okay but there doesn’t seem to be an agreed upon spec, so for edge cases it can be confusing.

sugar_in_your_tea ,

Yup, YAML is a terrible data format, but for a configuration format that you completely control, it works well. Your parser only needs to be good enough to read the configs you create.

Likewise, JSON is a pretty bad config format due to strictness in the syntax (no optional commas, excessive quotes, etc), but it’s pretty good data format because it’s pretty easy to parse.

TOML is like YAML, but it has fewer corner cases so it’s pretty easy to learn completely.

Though anything is superior when it’s already the status quo on a project.

JackbyDev ,

I don’t know dude, with YAML treating the word no as a Boolean and having like 6 types of multi line strings I’m really inclined to disagree with the “fewer corner cases” part. It’s like waaaaaaaay less corner cases. Imagine pasting the ISO abbreviation for a country as a Boolean value.

BitSound ,
JonnyRobbie ,
@JonnyRobbie@lemmy.world avatar

Meh, at that point, you may as well use python.

BitSound ,

I like Python and use it a lot, but Dhall has several guarantees that Python doesn’t. If you hand someone clever a Python interpreter, they can and will find a way to run rm -rf / or what-have-you, no matter what safeguards you put in place. Dhall also guarantees that it will terminate, which is pretty useful if you’re embedding it in something else. In Python you could pretty easily accidentally or purposefully get into a while True loop.

Lanthanae ,
@Lanthanae@lemmy.blahaj.zone avatar

nix

This post was sponsored by NixOS gang

(jokes aside, json is king. Yaml is a pain in the ass)

SorteKanin ,
@SorteKanin@feddit.dk avatar

Definitely not yaml. It’s spec is horrible.

Toml is pretty nice though.

richieadler ,

I hate table definitions in TOML with a passion.

I like YAML. I guess that’s because I don’t need to build parsers for it. What’s your worst complain about it?

SorteKanin ,
@SorteKanin@feddit.dk avatar
JonnyRobbie ,
@JonnyRobbie@lemmy.world avatar

Thie essentially boikls down to “quote yur shit”. Yes, it can be frustrating if a language superficially allows you to use unqoted strings with the promise that it will inteligently interprets that. It’s like parentheses in arithmetics. If you are not sure or if you are not competent in a language enough to predict the order of operations, use parentheses. The same with strings and quotes in yaml.

SorteKanin ,
@SorteKanin@feddit.dk avatar

… or just use another tool where you don’t even have to think about this problem.

richieadler ,

I get that JSON is intuitive and a huge improvement over XML, but I still find it verbose.

richieadler ,

Very educational.

silent_squirrel ,

Not xml

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines