preserves/README.md

94 lines
5.4 KiB
Markdown
Raw Permalink Normal View History

2019-08-11 15:19:08 +00:00
---
2019-08-18 21:08:55 +00:00
projectpages: "https://gitlab.com/preserves/preserves"
2021-05-21 19:56:59 +00:00
projecttree: "https://gitlab.com/preserves/preserves/tree/main"
2019-08-18 21:08:55 +00:00
title: "Preserves: an Expressive Data Language"
no_site_title: true
2019-08-11 15:19:08 +00:00
---
2019-08-08 13:46:03 +00:00
2019-08-11 15:52:29 +00:00
This [repository]({{page.projectpages}}) contains a
[definition](preserves.html) and various implementations of *Preserves*, a
2023-10-16 16:20:55 +00:00
data model with associated serialization formats in many ways
2022-06-18 17:11:08 +00:00
comparable to JSON, XML, S-expressions, CBOR, ASN.1 BER, and so on.
2019-08-08 13:46:03 +00:00
2019-08-18 21:08:55 +00:00
## Core documents
2021-05-25 12:13:09 +00:00
### Preserves data model and serialization formats
2021-06-02 18:32:40 +00:00
Preserves is defined in terms of a syntax-neutral
2022-06-18 17:11:08 +00:00
[data model and semantics](preserves.html#semantics)
2021-06-02 18:32:40 +00:00
which all transfer syntaxes share. This allows trivial, completely
automatic, perfect-fidelity conversion between syntaxes.
2022-06-18 17:11:08 +00:00
- [Preserves specification](preserves.html):
- [Preserves semantics and data model](preserves.html#semantics),
- [Preserves textual syntax](preserves-text.html), and
- [Preserves machine-oriented binary syntax](preserves-binary.html)
2019-08-18 21:08:55 +00:00
- [Preserves tutorial](TUTORIAL.html)
2023-10-17 08:55:11 +00:00
- [Quick Reference for Preserves syntax](cheatsheet.html)
2019-10-08 12:27:35 +00:00
- [Canonical Form for Binary Syntax](canonical-binary.html)
2021-06-02 18:32:40 +00:00
- [Syrup](https://github.com/ocapn/syrup#pseudo-specification), a
hybrid binary/human-readable syntax for the Preserves data model
2019-08-18 21:08:55 +00:00
### Preserves schema and queries
2021-05-25 12:13:09 +00:00
- [Preserves Schema specification](preserves-schema.html)
- [Preserves Path specification](preserves-path.html)
2021-05-25 12:13:09 +00:00
2021-06-02 18:32:40 +00:00
## Implementations
2023-10-27 13:23:22 +00:00
#### Implementations of the data model, plus Preserves textual and binary transfer syntax
| Language[^pre-alpha-implementations] | Code | Package | Docs |
|-----------------------|------------------------------------------------------------------------------|--------------------------------------------------------------------------------|-------------------------------------------|
| Nim | [git.syndicate-lang.org](https://git.syndicate-lang.org/ehmry/preserves-nim) | | |
| Python | [preserves.dev]({{page.projecttree}}/implementations/python/) | [`pip install preserves`](https://pypi.org/project/preserves/) | [docs](python/latest/) |
| Racket | [preserves.dev]({{page.projecttree}}/implementations/racket/preserves/) | [`raco pkg install preserves`](https://pkgs.racket-lang.org/package/preserves) | |
| Rust | [preserves.dev]({{page.projecttree}}/implementations/rust/) | [`cargo add preserves`](https://crates.io/crates/preserves) | [docs](https://docs.rs/preserves/latest/) |
| Squeak Smalltalk | [SqueakSource](https://squeaksource.com/Preserves.html) | `Installer ss project: 'Preserves';`<br>`  install: 'Preserves'` | |
| TypeScript/JavaScript | [preserves.dev]({{page.projecttree}}/implementations/javascript/) | [`yarn add @preserves/core`](https://www.npmjs.com/package/@preserves/core) | |
[^pre-alpha-implementations]: Pre-alpha implementations also exist for
[C]({{page.projecttree}}/implementations/c/) and
[C++]({{page.projecttree}}/implementations/cpp/).
#### Implementations of the data model, plus Syrup transfer syntax
| Language | Code |
|------------|----------------------------------------------------------------------------------------------------------------------------------|
| Guile | [github.com/ocapn/syrup](https://github.com/ocapn/syrup/blob/master/impls/guile/syrup.scm) |
| Haskell | [github.com/zenhack/haskell-preserves](https://github.com/zenhack/haskell-preserves) |
| JavaScript | [github.com/zarutian/agoric-sdk](https://github.com/zarutian/agoric-sdk/blob/zarutian/captp_variant/packages/captp/lib/syrup.js) |
| Python | [github.com/ocapn/syrup](https://github.com/ocapn/syrup/blob/master/impls/python/syrup.py) |
| Racket | [github.com/ocapn/syrup](https://github.com/ocapn/syrup/blob/master/impls/racket/syrup/syrup.rkt) |
2021-06-02 18:32:40 +00:00
## Tools
### Preserves documents
- [preserves-tool](doc/preserves-tool.html), generic syntax translation and pretty-printing
### Preserves Schema documents and codegen
2021-09-02 11:46:49 +00:00
- [Tools for working with Preserves Schema](doc/schema-tools.html)
2019-08-18 21:08:55 +00:00
## Additional resources
2023-11-01 14:15:24 +00:00
- [Preserves Expressions (P-expressions, pexprs)](preserves-expressions.html)
2019-08-18 21:08:55 +00:00
- Some [conventions for common data types](conventions.html)
- [Open questions](questions.html); see also the
[issues list]({{page.projectpages}}/issues)
- [Why not Just Use JSON?](why-not-json.html)
2019-08-08 13:46:03 +00:00
## Contact
Tony Garnock-Jones <tonyg@leastfixedpoint.com>
## Licensing
The contents of this repository are made available to you under the
[Apache License, version 2.0](LICENSE)
(<http://www.apache.org/licenses/LICENSE-2.0>), and are Copyright
2022-06-10 15:48:08 +00:00
2018-2022 Tony Garnock-Jones.
2023-10-27 13:23:22 +00:00
## Notes