Nim implementation of the Preserves data language
Go to file
Emery Hemingway e65dc2271f Preserve JSON object keys as symbols 2023-08-01 11:09:29 +01:00
src Preserve JSON object keys as symbols 2023-08-01 11:09:29 +01:00
tests Fix some decoder defects 2023-05-20 13:53:21 +01:00
.envrc Better build system 2023-06-07 18:11:06 +01:00
.gitignore Add Direnv metadata 2023-05-16 22:53:59 +01:00
.gitmodules Remove submodule 2022-02-19 10:33:16 -06:00
README.md Add note on syndicate-nim to README 2023-04-05 20:05:42 -05:00
Tuprules.tup Manage Nimble packages with Tup 2023-04-03 17:04:57 -05:00
UNLICENSE Unlicense 2021-08-31 17:00:00 +02:00
depends.tup Manage Nimble packages with Tup 2023-04-03 17:04:57 -05:00
preserves.nimble Preserve JSON object keys as symbols 2023-08-01 11:09:29 +01:00
schema.bin Remove submodule 2022-02-19 10:33:16 -06:00
schema.prs Remove submodule 2022-02-19 10:33:16 -06:00
shell.nix Better build system 2023-06-07 18:11:06 +01: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

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.