The current documentation compares a verbose JSON representation against a highly optimized domain-specific syntax (MDL), then concludes that MDL is significantly more token-efficient.
Issues can be found in:
|
A simple entity definition illustrates the difference. |
|
== Slide 8: Token Comparison |
I think this comparison is misleading because the two examples are not equivalent in design goals or verbosity level.
Current Example
Verbose JSON:
{
"entity": {
"name": "Customer",
"documentation": "Customer master data",
"attributes": [
{"name": "Name", "type": {"type": "String", "length": 200}},
{"name": "Email", "type": {"type": "String", "length": 200}}
]
}
}
Compact MDL:
/** Customer master data */
CREATE PERSISTENT ENTITY Sales.Customer (
Name: String(200),
Email: String(200)
);
Why This Is Problematic
The comparison mixes:
- a generic serialization format (JSON)
- with a purpose-built DSL (MDL)
The JSON example is also intentionally verbose:
- repeated
"type" nesting
- repeated object wrappers
- redundant field naming
A more compact JSON representation could be:
{
"name": "Customer",
"doc": "Customer master data",
"fields": {
"Name": "string(200)",
"Email": "string(200)"
}
}
Or even:
{
"Customer": {
"Name": "string(200)",
"Email": "string(200)"
}
}
At that point, the claimed token difference becomes much smaller.
Suggested Improvement
Instead of presenting this as “JSON vs MDL token efficiency,” I’d suggest framing it as:
- MDL is more concise because it is a domain-specific language
- JSON prioritizes generic interoperability and machine tooling
- MDL prioritizes human-readable schema authoring
That would make the comparison feel more technically fair and less like an apples-to-oranges benchmark.
The current documentation compares a verbose JSON representation against a highly optimized domain-specific syntax (MDL), then concludes that MDL is significantly more token-efficient.
Issues can be found in:
mxcli/docs/10-user-docs/mxcli-slides.md
Line 105 in 3539cf6
mxcli/docs-site/src/preface/what-is-mdl.md
Line 37 in 3539cf6
mxcli/docs/10-user-docs/mxcli-slides.typ
Line 145 in 3539cf6
I think this comparison is misleading because the two examples are not equivalent in design goals or verbosity level.
Current Example
Verbose JSON:
{ "entity": { "name": "Customer", "documentation": "Customer master data", "attributes": [ {"name": "Name", "type": {"type": "String", "length": 200}}, {"name": "Email", "type": {"type": "String", "length": 200}} ] } }Compact MDL:
Why This Is Problematic
The comparison mixes:
The JSON example is also intentionally verbose:
"type"nestingA more compact JSON representation could be:
{ "name": "Customer", "doc": "Customer master data", "fields": { "Name": "string(200)", "Email": "string(200)" } }Or even:
{ "Customer": { "Name": "string(200)", "Email": "string(200)" } }At that point, the claimed token difference becomes much smaller.
Suggested Improvement
Instead of presenting this as “JSON vs MDL token efficiency,” I’d suggest framing it as:
That would make the comparison feel more technically fair and less like an apples-to-oranges benchmark.