Nim implementation of the Preserves data language
Go to file
Emery Hemingway e22b354c11 initDictionary with capacity 2024-06-28 18:47:52 +03:00
src initDictionary with capacity 2024-06-28 18:47:52 +03:00
tests Build system refactor 2024-06-08 17:43:18 +03:00
.gitignore Build system refactor 2024-06-08 17:43:18 +03:00
README.md Build system refactor 2024-06-08 17:43:18 +03:00
Tupfile Build system defactor 2024-06-23 15:28:10 +03:00
Tuprules.jq Build system defactor 2024-06-23 15:28:10 +03:00
Tuprules.tup Add lockfile 2023-10-19 18:14:14 +01:00
UNLICENSE Unlicense 2021-08-31 17:00:00 +02:00
default.nix Build system refactor 2024-06-08 17:43:18 +03:00
depends.tup Build system refactor 2024-06-08 17:43:18 +03:00
lock.json Split pkSignedInteger into pkRegister and pkBigInt 2024-01-01 17:32:50 +02:00
preserves.nimble Replace Nimble with an SBOM 2024-06-01 12:35:35 +03:00
sbom.json initDictionary with capacity 2024-06-28 18:47:52 +03:00
schema.bin Remove submodule 2022-02-19 10:33:16 -06:00
schema.prs Replace #! notation with #: 2024-02-08 14:24:01 +00:00

README.md

Preserves

Nim implementation of the Preserves data language.

If you don't know why you need Preserves, see the Syndicate library.

Library

To parse or produce Preserves one should write a schema and generate a Nim module using the preserves_schema_nim utility. This module will contain Nim types corresponding to schema definitions. The toPreserve andfromPreserve routines will convert Nim types to and from Preserves. The decodePreserves, parsePreserves, encode, and $ routines will convert Preserve objects to and from binary and textual encoding.

To debug the toPreserves and fromPreserves routines compile with -d:tracePreserves.

Utilities

  • preserves-schema-nim
  • preserves-encode
  • preserves-decode
  • preserves-from-json
  • preserves-to-json
  • preserves-from-xml
  • preserves-to-xml

Installation

preserves_encode is a multi-call binary that implements preserves-encode, preserves-decode, preserves-from-json, and preserves-to-json, so the appropriate symlinks should be created during packaging.