← Back to context

Comment by hresvelgr

7 hours ago

I understand trying to improve popular technologies that have issues, but for a text format with mass ubiquity, JSON has very little wrong with it to the point where I believe that projects like this are a profound waste of everyone's time.

I am all for people experimenting and making things they like, but a domain was purchased so I can only assume a serious intent to make something of this and my only reaction is that I hope this is not taken seriously and disappears.

Plus it hyperfocuses and compares to JSON, but there's many popular configuration languages that should be compared with as well like YAML, TOML, etc.

  • That's because MAML is a superset of JSON. It has some added features (comments, multiline strings, etc), but it will likely be confused for JSON upon first glance. MAML will also have to reference JSON implementations to resolve ambiguities, e.g. how to handle multiple identical array keys. So MAML can not live outside the JSON world.

    • > MAML will also have to reference JSON implementations to resolve ambiguities, e.g. how to handle multiple identical array keys

      Isn’t the spec (https://maml.dev/spec/v0.1), which says “Duplicate keys are not allowed within an object.” sufficient for that?

      Or am I misunderstanding what you mean by “array keys”?

      It seems the spec is silent on whether key order is significant in dictionaries, though.

      1 reply →

    • No way to confuse with JSON, where you would instead expect // or /* */ for a comment facility which align with Javascript.

      Also """ for multiline string, I only encountered that in Python. But apparently Java, Kotlin and Swift also do that now. In js, backquote already do the trick.

      And the project is targeting more on configuration file, where TOML or YAML indeed are already competitors just as historically valid as JSON.

JSON with comments would go a long way

  • Douglas Crockford addressed this many years ago: write your human readable config with comments and run it through a pre-processor to strip them out before handing the config to a JSON parser. Seems like almost no one picked up on the idea.

    • That is such a horrible non-solution. It breaks all tooling which isn't aware of your particular preprocessor and adds a compilation step to every configuration.

  • Use Lua tables. Lua's parser is smaller than many JSON parsers, the syntax is almost the same and you can use comments.