CSTML is targeting many of the same weaknesses in JSON. It's fun to see a whole different, competing set of design choices at work. I had a very different take on schema validation and how to use the < syntax.
Do you have a link for CSTML, please? Googling is showing a bunch of possibilities none of which look quite relevant enough to be right...
Preserves: An Expressive Data Language
11–20 of 46 posts
Re: Preserves: An Expressive Data Language
#12Interesting on how on one hand the size of SignedInteger is unlimited, but on the other hand there is a ByteString. A ByteString could also have been represented by as a sequence of SignedInteger. I also wonder if it would not better to have a Unicode character as an atomic unit and represent a string as a sequence of Unicode characters.
This makes me wonder whether this is a high-level data model or yet another data representation.
Re: Preserves: An Expressive Data Language
#13Re: Preserves: An Expressive Data Language
#14Is it true that Records are the same as Dictionaries, because the labels in the records can have any value? Interesting on how on one hand the size of SignedInteger is unlimited, but on the other hand there is a ByteString. A ByteString could also have been represented by as a sequence of SignedInteger. I also wonder if it would not better to have a Unicode character as an atomic unit and represent a string as a sequ…
If you put a single dictionary-valued "field" in a record, you get a variation with named fields
Records have positional "fields" because of the Scheme heritage of the design.--
Re bytestring -- yes there are some concessions to real machines/languages in there that aren't absolutely required. Other examples include booleans and strings, which could have been and and etc respectively.
There's a little more on this topic in footnote 2 on the "conventions" page: https://preserves.dev/conventions.html#fn:why-dictionaries
Re: Preserves: An Expressive Data Language
#15Re: Preserves: An Expressive Data Language
#16I can not find an Emacs mode. Does anybody know one?
Re: Preserves: An Expressive Data Language
#17Re: Preserves: An Expressive Data Language
#18So EDN?
Re: Preserves: An Expressive Data Language
#19> This is a good time to mention that even though from a semantic perspective sets and dictionaries do not carry information about the ordering of their elements. Except they do in Python. It is extremely useful, surprisingly often.
Python remembers order, and exposes it in its iterations, but doesn't use it in its equivalence over dictionaries (== semantics). (ETA: What are you quoting there? I don't think that text appears on the Preserves site) (ETA2: Ah, it's the tutorial. Cool)
Plain dict maintains insertion order but equality checks only check that the key/value pairs are the same. [2] [3]
[1] https://docs.python.org/3/library/collections.html#:~:text=e...
[2] https://docs.python.org/3/library/stdtypes.html#:~:text=dict...
[3] https://docs.python.org/3/library/stdtypes.html#:~:text=dict...
Re: Preserves: An Expressive Data Language
#20Why/when/where would I need this?
After some brief reading of docs, I'm trying to write one sentence explanations. Maybe this will be helpful to you
What
Preserves is a specification and set of libraries in popular languages that lets you reliably exchange data between XML, JSON and EDN.
Who
Preserves is built for (data engineers|data framework writers) to reliably interchange data.
Why
Formats like JSON in particular are imprecise. Preserves forces you to deal with these vagaries up front
What else?
With P-Expressions you can search a preserve compliant datasource much like you would query JSON with JQ
Who Not? Who shouldn't use this
This will not help a data analyst exchange data between CSV and Excel