So, hello, good afternoon.
Then we are going to start the next talk with Tina Mueller.
And the topic is, do you know Yamu?
Quite interesting topic.
So Tina, this stage is yours.
Thank you.
Hello.
Can everyone hear me as well in the back?
OK.
So who of you knows Yamu?
OK, are you sure you know Yamu?
So something about me, I'm doing Pearl since 1998.
And I'm also intensively doing Yamu since 2017.
So I guess I just have a weakness for misunderstood languages.
Yes, the topics, some introduction, some history,
Yamu usage, versions, new libraries,
and Yamu test infrastructure.
Oh, I got one extra minute because the timer wasn't started.
So Yamu, it all started in 2001.
I think 2004 was the first specification.
It was invented by Orin Benkiki, Clark Evans, and Ingy.net.
And Ingy says hi.
And he's also the one who's still actively working on Yamu
and relate things.
And here's actually a mini talk that he sent me.
He wants you to know about.
So there's Yamu script.
Many people try to do programming things in Yamu,
but Yamu wasn't designed for that.
Ingy has been working on a new Yamu-based programming language.
It's complete and general purpose, best when embedded
in plain old Yamu files.
Excellent interpolation features, merge, filter,
concatenate, any functions you can imagine,
define your own functions, solves most programming things
that people want to do with Yamu.
So here you have a Yamu file, people and places.
And this is the Yamu script.
You can see the header.
And you load the Yamu file.
Then you get people from it and the list of places.
Here you define a function with interpolation.
And here you go over the arguments of the command line.
Shuffle until you iterate over the list.
And the output is this.
And it just works.
It's fast.
And it's really easy to try it out.
Just go to the web page.
And there's a code command which executes a bash.
And then you have it installed.
And yeah, there's a link to it in the slides.
And the slides are already online.
So have fun with it.
And that's the end of the talk in my talk.
And I'll go on.
So what does Yamu stand for?
No Yamu ain't market language.
It's a state-of-the-realization language.
It's a superset of JSON.
It has block style and also flow style, which many people also
call JSON style because it's similar.
And there are many ways to write a string.
But they are all kind of useful in certain areas.
It has aliases, like references or pointers, and commons.
And there's an allowed comma after the last item.
Hello, Jason.
Multiple documents in one file.
And really powerful tags for loading objects
are doing customized loading.
And I started this Yamu.info page, which gives you also
the right words to actually talk about these.
Like, for example, some documentation
referred to Yamu's references.
But it's called aliases and anchors.
And I think it's good to have the right terminology
because then you can actually find
the right documentation for it.
So the history is Yamu 1.1 was implemented by Pi Yamu
and Lip Yamu with some divergence to the spec.
And the decisions were with good intent.
But it had other problems because if you diverge
from the spec and others do not, then it's problematic.
And many other libraries ported this or used Lip Yamu
as a binding.
And 1.2, the version 1.2 was not widely adopted for a long
while.
Many people just didn't know about it.
And there is a prerequest for adding 1.2 for Pi Yamu.
I created it some time ago, but there are some issues.
So it can't be merged yet.
And Lip Yamu and Pi Yamu were even
used in the NASA Mars helicopter mission.
And so this is something you can say these days.
Yeah, as mentioned, 1.1 implementations
were really widely adopted.
And there was no clear change lock for 1.2.
And there hadn't been a test suite until 2016.
So before 2016, updating a library to 1.2
would have just to be sitting down and read the news back
and start from scratch, mostly.
So this is about the history.
And now from a different angle, how do people actually
get in touch with Yamu?
So usually you're using an application that
is using Yamu or some kind of Yamu,
starting with examples from the documentation.
So here's a salt stack.
So you have these funny curly braces here.
And is this a Yamu file?
No, it's an SLS file.
It's not a valid Yamu.
And you cannot use a linter or anything on it,
because first it has to run through ginger templating.
And then the result is Yamu, hopefully.
And many people think this syntax belongs to Yamu,
but it does not.
And the intro on their website doesn't even
say which version it's using, which Yamu version.
And here we have an answerable example.
And here we also have these syntax,
but inside of the string.
That's also ginger templating.
But it happens after you load the Yamu.
So I think that's a better way.
It has disadvantages and advantages, of course.
But also here, many people think this is part of the Yamu.
And they come to our Yamu channel and talk about it.
The website also doesn't say anything about the Yamu version.
Or yeah, it has some links at the bottom.
And the GitHub workflow uses this syntax.
And that's quite nice, because the dollar sign at the beginning
is not special in Yamu, so you don't need to quote it, actually.
And many people think this is part of Yamu, but it's not.
And also no Yamu version information.
So they don't document it.
And I tested GitHub, and I think it's doing Yamu 1.2.
Also, they learn Yamu in why minutes is mentioned,
but it's also not saying anything about Yamu 1.2.
So what are the actual changes?
So they can be divided in syntax and in schema changes.
And the syntax changes are really probably not important.
There are also a few backward incompatible changes,
but affecting even less people.
But the schema changes are important.
So the schema is about deciding if something
is a Boolean, number, null, or string.
And in 1.1, there are 22 values that are resolved as Booleans.
On, off, yes, no.
And you probably all know the Norway problem,
so no is the same as false.
So if you have a list of country codes like ES, DE, and O,
then you will not get what you think.
This is unexpected, and this has been fixed.
So the 1.2 schema just has a lot less values,
a lot less unexpected things happen.
The sex-agasable numbers, base 60, are also gone.
Who knows what sex-agasable numbers are?
Wow, like a handful.
No underscores and numbers allowed anymore,
and the base 2 is also gone.
And you can also click on the link in the slides
to see these differences here.
So only six values for Booleans.
And yeah, it's a lot cleaner.
But still, of course, there is this problem.
When is this a number or not?
So here we have a number.
That's a string, and that's also a string.
The thing is, what do you want?
Like, you don't have to quote, and that's actually nice
in many cases.
And you can't have everything.
So we have to live with the problem
that sometimes we don't know exactly if it is a number or not.
But what you can do and what you should do in many cases
is actually validate.
So who is using JSON schema or something like that
for their YAML files?
Come on.
OK, you should think about it.
And same actually goes for JSON.
At least sometimes you can make mistakes in JSON.
And you don't just send out your JSON or YAML files
and think that it will just work.
We have tests, hopefully.
So use a validator.
And we're using that in openSUSE for openQA.
It can also protect you from processing unexpected data
structure with a recursive tree of aliases, which
is known at the Billion Lafs attack, which is actually
not a real problem of YAML because they're just aliases.
But if you process it or dump it with JSON,
it will be huge.
Yeah, use the right tools.
So who of you knows YAML lint?
OK, great.
So that's a great tool.
And it can tell you if you have unnecessary quotes.
But the thing is I hate typing.
So if you have an extremely limited number of fingers,
you really hate typing.
And so I wrote a YAML tidy, which
is removing the quotes for me.
I don't have to do it manually.
And you are using often four meters for other languages,
too, right?
So here's a YAML tidy configuration.
And here you can say the default scalar style
should be plain.
Here's a YAML file with unnecessary quotes.
And this is what it looks like after YAML tidy.
This would have been a number, so it's the quoted.
And the curly brace here is problematic.
So OK.
YAML lint currently supports 1.1.
And Adrian is working on it to actually support 1.2.
And I also want to support 1.1.
What else can we do to improve the situation?
So there's a YAML test suite.
Started in 2016, like I said.
And Felix implemented NIMYAML and added a lot of cases.
I started with YAMLPP and added test cases.
We have 400 test cases.
And 12 libraries are using it.
But I would like to mention specifically a couple of libraries
that's libfyaml.
And it can be used as a replacement for libfyaml.
It passes all tests.
That's really rare.
It's fast.
It's actively developed.
It can run through YAML comments.
It's still experimental.
And bindings to several languages are planned.
There's also a new JavaScript library.
It passes, I think, all tests by now.
It's actively developed.
Sorry.
It can run through YAML with comments and blank lines.
And it supports 1.2 and 1.1 and the merge key.
And it's really good.
And yeah, just because it's by me, YAMLPP
passes most of the tests, except some things that
are not relevant in ProL anyway, like arrays as hash keys.
It also supports both YAML versions
and comes with a nice highlighter.
So YAML containers, I will go a bit faster
through the last slides.
So Engi started to put things in YAML containers.
And you can actually look at the YAML playground right now.
So here you have to start a Docker container locally.
And now you can live edit YAML here.
And now we just added something that is not valid.
And there's one library which actually thinks it's valid.
But OK.
The test matrix is this one.
And it really looks very red.
Don't be scared.
The test suite contains many edge cases.
So that's why it's so red.
And yeah, we're trying to actually make it better.
And so you can also visit us on our matrix channel.
There is some kind of construction going on,
because Engi is moving the server.
But if it's not there, then there's a fallback on IRC.
So please contact us.
We are really trying to improve YAML and everything around it.
And thank you very much.
Thank you.