Since years, our Open Source
mORMot framework offers several ways to work with any kind of runtime arrays/objects documents defined, e.g. via JSON, with a lot of features, and very high performance.
Our
TDocVariant custom variant type is a powerful way of working with such schema-less data, but it was found confusing by some users.
So we developed a new set of interface definitions around it, to ease its usage, without sacrificing its power.
We modelized them around Python Lists and Dictionaries, which is proven ground - with some extensions of course, including several enumerators for ranges or searching.
Two one-liners may show how our
mORMot library is quite unique in the forest/jungle of JSON libraries for FPC (and Delphi):
assert(DocList('[{ab:1,cd:{ef:"two"}}]')[0].cd.ef = 'two');
assert(DocList('[{ab:1,cd:{ef:"two"}}]').First('ab<>0').cd.ef = 'two');
Yes, this code compiles and run on FPC.
If you compare e.g. to how the standard JSON library works in the RTL, with all its per-node classes, you may find quite a difference!
And there is no secret in regard to performance, that our JSON processing is fast. The fastest for FPC for sure.
More info:
https://blog.synopse.info/?post/2024/02/01/Easy-JSON-with-Delphi-and-FPC