Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider XML for plan files #125

Open
MattWindsor91 opened this issue Feb 1, 2021 · 0 comments
Open

Consider XML for plan files #125

MattWindsor91 opened this issue Feb 1, 2021 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@MattWindsor91
Copy link
Collaborator

But Matt, it's 2021! Nobody uses XML anymore!

The more I think about how plan files work, the more I'm convinced XML might actually be a better fit than JSON. To wit:

Plan metadata

The first key in the plan is the metadata:

"metadata": {
  "created": "2021-01-05T09:09:28.556225918Z",
  "seed": 1609837768556225918,
  "version": 20210127,
  "stages": []
}

All of this, except the stages, is an auxiliary detail of the plan, and we could put it in the attributes of the root node:

<plan created="2021-01-05T09:09:28.556225918Z" seed="1609837768556225918" version="20210127">
</plan>

Stages could be a lot simpler than they are atm: from

{
"stages": [
  {
    "stage": "Plan",
    "completed_on": "2021-01-04T16:30:49.355106881Z",
    "duration": 68349693018
  }
]
}

to

<stages>
  <stage id="Plan" completed_on="2021-01-04T16:30:49.355106881Z" duration="68349693018" />
</stages>

States

{
  "tag": "counter",
  "values": {
	"0:r0": "0",
	"0:r1": "0",
	"1:r0": "0",
	"2:r0": "1",
        "x": "0"
    }
},

A fantasy encoding in xml might look like this:

<state tag="counter">
  <mapping tid="0" var="r0" value="0" />
  <mapping tid="0" var="r1" value="0" />
  <mapping tid="1" var="r0" value="0" />
  <mapping tid="2" var="0" value="1" />
  <mapping var="x" value="0" />
</state>

Not much less compact than what we've got at the moment; splitting the TIDs and vars out like this in JSON would be a nightmare of encoding space.

@MattWindsor91 MattWindsor91 added enhancement New feature or request question Further information is requested labels Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant