godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.17k stars 21.19k forks source link

Proposal to add YAML support in addition to JSON #4354

Closed ghost closed 4 years ago

ghost commented 8 years ago

Would be nice if we had the option to use YAML as an alternative to JSON. More versatility would be great.

Also seems YAML can do things JSON cannot like : comments, extensible data types, strings without quotation marks and others. And , according to Wikipedia, JSON can be parsed by YAML (ver 1.2) parsers making it a subset of YAML. So at second glance both of these are interchangeable and YAML does seem easier to write, read and more powerful than JSON.

Obvs this is a low priority feature I will leave it up you to decide

Thanks. Keep up the good work πŸ‘

ghost commented 4 years ago

A good post on the downsides of YAML: https://www.arp242.net/yaml-config.html

Personally I think TOML is the way to go.

GammaGames commented 4 years ago

Some counter points to the post:

Insecure by default

I always thought that representing objects directly in YAML was a strange feature. StrictYAML disallows that.

Can be hard to edit, especially for large files

This is not a problem with YAML itself, it is a problem with pretty much any file. If you have any config file that goes over 100 lines you're probably doing something wrong and should break them up anyway. If you're going over 1000 lines, god help you.

It’s pretty complex

That is true, hence the stricter spec. It is still easier to write and read, there aren't brackets everywhere and it looks like a naturally written set of data.

Surprising behaviour

That is why a consistent parser should be necessary. For example, StrictYAML parses everything as a string by default. This puts the ball in the coder's court, no more surprises.

The other points from the post aren't really relevant. It even recommends StrictYAML in the conclusion!

ghost commented 4 years ago

The problem is that the title of the issue is YAML, just wanted to add some more points against YAML in general without regards to StrictYAML. I think either StrictYAML or TOML would be good, although with still a preference for TOML since it's not fragmented and has a better spec without the need for a special parser.

KoBeWi commented 4 years ago

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!