On Tue, Jul 25, 2017 at 8:47 AM, jacobus erps <jacobus.erps@xxxxxxxxx> wrote:
The textual representation will look a lot like JSON.
You say "a lot like JSON". In what ways will it not be *exactly* JSON?
The reason I ask is that there is a lot of value to being able to
generate standard JSON, and import directly from standard JSON.
Granted, there may be some information loss in terms of specific data
types. But I strongly recommend that a subset of valid RpgMap
instances be EXACTLY serializable as JSON, such that they can make a
round trip to JSON and back to RpgMap with 100% fidelity.
Then a broader subset of RpgMap instances should still be serializable
into standard JSON but with type loss (for example, your RpgMap may
contain declared 20-digit integers, but as long as their values fit in
10 digits, it should be acceptable that in the round trip, they come
back as 10-digit integers).
Hopefully, you can import *any* valid JSON into an RpgMap. Obviously
you'll have to have rules for type conversions, but this would be a
killer feature. It would go a long way toward popularizing your
library as well as making RPG a friendlier language for JSON
processing.
I understand you'll want to be able to serialize any RpgMap perfectly.
This could either be with custom extensions to JSON (which would only
be readable by your library, but would handle the RpgMap instances
that don't serialize into standard JSON), or a completely separate
format. (You could perhaps draw inspiration from Python's pickle
format, for example, as well as the way Python handles JSON.)
Forgive me if you've already thought of all those things. If so, then
just consider it advance positive feedback. :)
John Y.
As an Amazon Associate we earn from qualifying purchases.