/preserves-nim

Nim implementation of the Preserves data language

Primary LanguageNimThe UnlicenseUnlicense

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.