Hi folks,
my YAML implementation is approaching a first stable release, and I'd like to
have some comments on the interface before the release. You can find
documentation and code examples `over here <http://flyx.github.io/NimYAML/>`_.
Some issues I have not yet decided upon:
* Using ``int`` and ``float`` is currently disallowed, as serialized YAML might
not round-trip between 32bit and 64bit binaries. Instead, types with explicit
size (e.g. ``int32``) must be used. This causes many types of the standard
library to not be automatically serializable, because they contain ``int`` or
``float``. I am not quite happy with that.
* NimYAML focuses on serializing native Nim types. There is a DOM API, but it's
pretty basic. I wonder if people rather want to use native types or DOM. Native
types have the slight disadvantage that they cannot really map to YAML objects
containing heterogeneous data (a sequence with strings and integers, for
example). It is possible to implement this in Nim, but it is impractical.
* NimYAML supports serializing to and from JSON. This is nice for
interoperability with other tools. However, features get lost when downgrading
to JSON: Reference types get duplicated on each occurrence, cyclic structures
lead to an infinite loop, and mappings with complex keys are also not
available. I wonder if there is a demand for a more complete YAML-JSON mapping,
which will make the JSON more complex, but can then support all features the
YAML output has.
* ``nil`` strings and sequences are not supported. It would be possible, but I
am not sure if that is a âgoodâ feature.
Any comments would be appreciated.