I vibe coding a small JSON library with Nimony, and it went more smoothly than I expected.
So far it includes:
- A JSON value model built with Nimony's latest sum type syntax: null / bool / int / float / string / array / object
- JSON parsing and writing
- Support for concatenated JSON streams, e.g. [{"a":1}][{"b":true}]
- Basic type conversions
- A simple deriveJson(T) implemented through the plugin system, generating toJson / fromJson for objects
- Parse failures now raise SyntaxError, and the tests can check them with try/except ErrorCode
Overall, my impression is that Nimony is already much more complete than I expected. The key pieces like sum types, plugins, and raises already work well enough to build a real small library, not just a demo.
There are still rough edges and some places where I had to work around current compiler/stdlib limitations, such as not-nil check, but it already feels basically usable.
demo code: https://github.com/bridgeQiao/nim_json