Message Example
Here is an example what a message looks like for a javascript-object:
{
name: "John Smith",
age: 41,
address: {
street: "Second Avenue",
postalCode: "1356-A",
city: "Yorkistan"
},
isNiceGuy: true,
hobbies: [
"Playing cards",
"Shopping",
"Asking odd questions"
],
favouritePoem: {
title: "Digital Dreams",
created: Temporal.PlainDateTime.from("2024-09-16T12:13:00"),
content:
"In the code, we drift and weave,\n"
+ "A dance of data we perceive.\n"
+ "With each keypress, a world unfolds,\n"
+ "Infinite stories, yet untold."
}
}
This object is serialized in following form:
112345aca
E
A@ name
B@ JKJohn Smith
A@ !age
B@ !Id41
A@ "address
B@ "E
A@ #street
B@ #JKSecond Avenue
A@ $postalCode
B@ $JK1356-A
A@ %city
B@ %JKYorkistan
F
A@ &isNiceGuy
B@ &Iet
A@ 'hobbies
B@ 'C
JKPlaying cards
JKShopping
JKAsking odd questions
D
A@ (favouritePoem
B@ (E
A@ )title
B@ )JKDigital Dreams
A@ *created
B@ *Ii2024-09-16T12:13:00.000
A@ +content
B@ +JL
OIn the code, we drift and weave,
OA dance of data we perceive.
OWith each keypress, a world unfolds,
NInfinite stories, yet untold.
M
F
F
This message is not really human-readable as is, but it can be visualized in an assembly-like format:
| Command | Description |
|---|---|
MCSM 12345aca |
Model checksum |
OBJB (plain) |
Object begin |
DEFN 8388608 name |
Define id for name |
ASGV 8388608 (name) STRN SSTR John Smith |
Assign "John Smith" to name-property |
DEFN 8388609 age |
Define id for age |
ASGV 8388609 (age) NATV FLOAT64 41 |
Assign 41 to age |
DEFN 8388610 address |
Define id for address |
ASGV 8388610 (address) OBJB (plain) |
Assign a new object to address |
DEFN 8388611 street |
Define id for street |
ASGV 8388611 (street) STRN SSTR Second Avenue |
Assign "Second Avenue" to street |
DEFN 8388612 postalCode |
Define id for postalCode |
ASGV 8388612 (postalCode) STRN SSTR 1356-A |
Assign "1356-A" to postalCode |
DEFN 8388613 city |
Define id for city |
ASGV 8388613 (city) STRN SSTR Yorkistan |
Assign "Yorkistan" to city |
OBJE |
End of the child object |
DEFN 8388614 isNiceGuy |
Define id for isNiceGuy |
ASGV 8388614 (isNiceGuy) NATV BOOLEAN TRUE |
Assign true to isNiceGuy |
DEFN 8388615 hobbies |
Define id for hobbies |
ASGV 8388615 (hobbies) ARRB |
Assign an array to hobbies |
STRN SSTR Playing cards |
Add "Playing cards" to the array |
STRN SSTR Shopping |
Add "Shopping" to the array |
STRN SSTR Asking odd questions |
Add "Asking odd questions" to array |
ARRE |
End the array |
DEFN 8388616 favouritePoem |
Define id for favouritePoem |
ASGV 8388616 (favouritePoem) OBJB (plain) |
Assign a new object to favouritePoem |
DEFN 8388617 title |
Define id for title |
ASGV 8388617 (title) STRN SSTR Digital Dreams |
Assign "Digital Dreams" title |
DEFN 8388618 created |
Define id for created |
ASGV 8388618 (created) NATV LOCAL_DATETIME 2024-09-16T12:13:00.000 |
Assign local datetime to created |
DEFN 8388619 content |
Define id for content |
ASGV 8388619 (content) STRN STBG |
Assign a string using a string builder to content |
STNL In the code, we drift and weave, |
Add text to the builder with newline-marker |
STNL A dance of data we perceive. |
Add text to the builder with newline-marker |
STNL With each keypress, a world unfolds, |
Add text to the builder with newline-marker |
STPA Infinite stories, yet untold. |
Add text to the builder without newline |
STEN |
End of the string builder |
OBJE |
End of an object |
OBJE |
End of the root object |