Is NEON a Better YAML? ###################### :category: Misc :tags: yaml, neon :date: 2020-05-29 06:18:00 +0300 :updated: 2020-06-15 22:18:00 +0300 .. _NEON: https://ne-on.org/ .. _Nette Framework: https://nette.org/ .. _PHPStan: https://phpstan.org/ Short answer: NO. If you know what I mean. .. TEASER_END It seems that YAML's drawbacks have created a niche for alternative better YAMLs. NEON_ is developed as a part of the `Nette Framework`_ and also gained some popularity as a format for PHPStan_ configs. But is it a better YAML? Well, `YAML's Norway Problem`__... .. __: https://medium.com/@lefloh/lessons-learned-about-yaml-and-norway-13ba26df680 .. code-block:: yaml country_names: DK: Denmark NO: Norway # this works ok SE: Sweden scandinavia: - DK - NO # but this is still false - SE ... check. Weird but valid PHP specific syntax: .. code-block:: yaml # this hash&array mixture is common in PHP world but meaningless in other languages # also it's impossible in yaml php_array: - 1 - 2 - 3 four: 4 five: 5 six: 6 becomes .. code-block:: json { "php_array": { "0": 1, "1": 2, "2": 3, "four": 4, "five": 5, "six": 6 } } ... check. Okay, maybe its weird killer feature, entities, is useful for somebody but the rest of the language looks like a worse YAML to me. **Update (2020-06-15):** Weirdly significant whitespace: .. code-block:: yaml # compare to the example above # this will work exactly like yaml and produce exactly what's expected php_array: - 1 - 2 - 3 four: 4 five: 5 six: 6 becomes .. code-block:: json { "php_array": [ 1, 2, 3 ], "four": 4, "five": 5, "six": 6 } ... WTF? I mean, this is fine and logical but it makes the previous example even worse.