4 ms·
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 SignedIn
by fjfaase 2y ago
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 sequence of Unicode characters.
This makes me wonder whether this is a high-level data model or yet another data representation.
- tonyg 2y agoNo, a record is a tagged (sequence of) value(s). <tag v1 v2 v3> If you put a single dictionary-valued "field" in a record, you get a variation with named fields <tag { field1: value1 field2: value2 field3: value3 }> 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 <true> and <false> and <string [65 66 67]> 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 https://preserves.dev/conventions.html#fn:why-dictionaries
- carterschonwald 2y agoLooks like a lot of excellent work! Are there any good examples of nontrivial schemas etc?
- tonyg 2y agoThanks. Yes there are: see sections 15, 16 and 17 of https://synit.org/book/ https://synit.org/book/, where Preserves, Preserves Schemas, and the Syndicated Actor Model make a reactive replacement system layer for linux (essentially an alternative to systemd)