Stack - yaml/YAML2 GitHub Wiki

The YAML Stack

YAML processing is a stack of operations. The diagram from the YAML 1.2 spec shows this:

YAML Stack

The layers of the stack are:

  • Presentation - A stream of YAML text
  • Serialization - A tree of YAML events
  • Representation - A graph of YAML nodes
  • Native - A structure of language objects

There are also processes that go from one layer to the next.

In the direction of objects to text:

  • Dump - Native to Presentation
  • Represent - Native to Representation
  • Serialize - Representation to Serialization
  • Present - Serialization to Presentation

In the direction of text to objects:

  • Load - Presentation to Native
  • Parse - Presentation to Serialization
  • Compose - Serialization to Representation
  • Construct - Representation to Native

ToDo: Write a page for each process, describing what happens


This terminology is OK, in that it is describing the right things, but it is geared a bit more towards the academic, and less towards common usage in modern programming. If we want people to start using this terminology in every day discussion, we should simplify it and make it consistent.

Some terms like Native, Dump, and Load are probably ok as they are. They others should be reconsidered.

All possible terms

It might be good to start with a list of a

Discussions

This should be an ongoing discussion of what terms are appropriate. We can make a section for each existing term:

Serialization

I'm not certain how we ended up with serialization meaning tree. When people use the term serialization they always mean a string of octets. We use presentation for that currently.