Use of YAML in my upcoming project is extensive. What I am doding is
taking a page out of the lisp playbook: the code is the data, and
using YAML to facitlitate that, as the structured data syntax for a
complete programming language.
There are two things I would like to address in regards to my
experience with using YAML in this way.
First may seem a bit OT but it relates in the broader picture --JSON.
It looks like JSON is getting a bigger uptake than YAML these days. I
expect it is doing so for two reasons. 1) it's simpler syntax stucture
apps. I know that YAML is making a few small changes to make JSON a
compatible subset of YAML. That's good in a way. But in a sense it
also sends the message, "just use JSON" and not bother with the extra
complexity of YAML. To the point, the simplicity of JSON has led to
quick support by more languages than YAML.
In that light I think it's prudent to take a step back and work on
simplifying the YAML specification some to help facilitate it in the
same manner. I don't mean to reduce it to JSON, obviously. YAML has
some features that JSON does not, and it should keep those. But I
think there room for improvements that could make a big difference. I
would like to hear other people ideas on this.
In turn I think it's also important to focus, highlight and strengthen
the capabilites the set YAML apart from JSON, most importantly it's
human readibility. In working on my language project, I've come across
some places where minor changes to YAML would help in this regard.
Take this example:
"hello world" console.println
This blows up in YAML becuase it takes the first quote to mean the
start of a string, but obviously that is not what I want. If I start a
string indented after a newline break, doesn't that indicate that the
indention and the indention only shoud mark the end of that string? It
would be better if it did. Any indication of style should begin on the
Right now I've noticed Syck does some off things. Try putting a '|' at
the beginning of the seond line and you'll see that it removes it but
also acts like it's not even there. (Of course I still wonder if
literal might make the better default style.)
Another is a simplier way to do non-indent based systax. If I have
and convert it to non-indent form it's not as simple a just wrapping
it in curly brackets becuase I also has to add a comma between each
map element. The same applies to sequences. It would be better to have
newlines serve for commas too. So one could just do.
Finally, I would also like to see an inerpolation standard --an
imporved YIP, if you will.