I don't get this. Heres Fibonacci[1] in only 74 lines of YAML, or how about some kind of football CLI program[2] in only ~600 lines of YAML. I've got no idea why anyone would use this, or why the hell YAML was chosen to represent the AST.
Edit: Not to crap over the authors project, it seems to produce quite neat output[3][4], it's just writing 600 lines of unreadable YAML to generate a ~32 line Python program seems a bit pointless.
Yep, you're not supposed to write the yaml yourself, it's just a compilation target and an intermediate format.
Why YAML then? Well it's still nice to be able to read it easily in that early phase of the project and it's fairly well supported in most popular languages(and a little bit more compact than JSON).
I would guess the idea is to create some intermediate representation to transpile between languages. The yaml is then probably not meant to be read or written manually.
This could be used in software modelling tools that use a more declarative style, which then creates that IR, which then compiles to some real world language.
I'm not saying this is a good idea, just trying to guess the intention ;) 15 years ago somebody would have used XML and created an even more verbose OMG standard based on such an idea.
Edit: Not to crap over the authors project, it seems to produce quite neat output[3][4], it's just writing 600 lines of unreadable YAML to generate a ~32 line Python program seems a bit pointless.
1. https://github.com/alehander42/pseudo/blob/master/examples/f...
2. https://github.com/alehander42/pseudo/blob/master/examples/f...
3. https://github.com/alehander42/pseudo/blob/master/examples/f...
4. https://github.com/alehander42/pseudo/blob/master/examples/f...