Live data from Hacker News

Preserves: An Expressive Data Language

preserves.dev

21–30 of 46 posts

Re: Preserves: An Expressive Data Language

#21

gotta have some examples on the landing before the fold, otherwise i have no reason to explore

https://preserves.dev/TUTORIAL.html

Not a fan of annotation (that can be used as comment syntax) having # followed by a space character have a different behaviour feels strange.

Re: Preserves: An Expressive Data Language

#24
post #14
post #12

Is 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…

No, a record is a tagged (sequence of) value(s). 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…

Looks like a lot of excellent work!

Are there any good examples of nontrivial schemas etc?

Re: Preserves: An Expressive Data Language

#25

gotta have some examples on the landing before the fold, otherwise i have no reason to explore

Tutorial link too hard to click? Seriously: these comments inevitably come up for most language related pages, and I don’t see how they don’t fall under the site guidelines of “Please don't post shallow dismissals”.

Re: Preserves: An Expressive Data Language

#27
post #20
post #3

Why/when/where would I need this?

I was going to ask the exact same question. The title makes it sound like something I might be interested in, then I visited the page and I have no idea what it does. 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…

Thank you! That makes more sense now

Re: Preserves: An Expressive Data Language

#28
Does Preserves have a page with a comparison to other common serialization languages?

As someone familiar with Protobuf, comparing Preserves vs Protobuf text format, here's my quick comparison between the two after reading through the tutorial:

- Preserves' Symbol is very close to Protobuf enums. But Symbol can contain characters like dash

- There doesn't seem to be an equivalent of Preserves' Record in Protobuf, but the tutorial's example of using To denote a missing can be simulated using the `oneof` field in Protobuf.

- Having to write #t/#f in Preserves is unfortunate. I guess this is the result of schemaless serialization language and potential parsing ambiguity with a Symbol?

- Protobuf have a way to annotate the schema and reuse at runtime, very similar to Preserves' annotations.

Re: Preserves: An Expressive Data Language

#29
post #25

gotta have some examples on the landing before the fold, otherwise i have no reason to explore

Tutorial link too hard to click? Seriously: these comments inevitably come up for most language related pages, and I don’t see how they don’t fall under the site guidelines of “Please don't post shallow dismissals”.

The comment specifically said "on the landing before the fold", so yours is the shallow dismissal. I agree with the comment; lead with the things we shall judge ye by.
Post reply on HN