Live data from Hacker News

Preserves: An Expressive Data Language

preserves.dev

1–10 of 46 posts

Re: Preserves: An Expressive Data Language

#4
post #2

Here is the ABNF: https://preserves.dev/preserves-text.html

Or, in "quick reference card" form: https://preserves.dev/cheatsheet.html

The syntax isn't the most interesting part though; the thing that distinguishes it from most other data languages out there is that it has semantics (= a rigorous definition of when values are equal and when they aren't). So you can use Preserves semantics with JSON syntax (a subset of Preserves' text syntax) as one way of getting actually-meaningful JSON.

Plus, comments (and other annotations) ;-)

Re: Preserves: An Expressive Data Language

#5
post #3

Why/when/where would I need this?

Useful if you have a JSON-keyed table, for example: JSON lacks a useful (standardised) equivalence relation, meaning you get weak and/or implementation-specific guarantees about how key lookup works. Equivalences were the motivation for developing Preserves: I was (and am) working on a generalized approach to messaging middleware, you might say, meaning that things like "patterns over values" and "filters" and "value-keyed tables" are all things I need to talk about. (This all comes out of RabbitMQ/AMQP thinking back in the day and my PhD-and-after work subsequently.)

Re: Preserves: An Expressive Data Language

#6
> 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.

Re: Preserves: An Expressive Data Language

#8
post #6

> 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)

Re: Preserves: An Expressive Data Language

#10

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...
Post reply on HN