JSON to Flex Buffers converter

369 views
Skip to first unread message

Maxim Zaks

unread,
Apr 8, 2017, 10:26:11 AM4/8/17
to FlatBuffers
As a user I want to write my configuration files in JSON, but read them at runtime as flex buffer with 0 parsing overhead.

In order to achieve this goal, I implemented a function in FlexBuffersSwift which transforms JSON into FlexBuffers binary format.
Users can now write small build scripts which convert JSON to FlexBuffers and use FlexBuffers at runtime.
In order to achieve it in an efficient way I implemented a JSON parser which uses FlexBuffers directly as a model for parsed text.

I think it is a great addition and can be adopted by main project specifically as FlatBuffers already has a JSON parser implemented.

I am also considering to write a CSV to FlexBuffers converter where the data can be stored as vector of vectors, vector of maps or map of vectors.
In game development (specially simulation games) it is often the case that economy configs are defined in spread sheets which can be easily exported as CSV.
Being able to read large CSV files with random access and 0 parsing overhead, is a great benefit.

mikkelfj

unread,
Apr 8, 2017, 7:15:24 PM4/8/17
to FlatBuffers
I am also looking into UCL and HCL (Hashicorps variation) for configuration languages. No short term plans, but I think it is a good option for configuration files to Flatbuffers with a proper schema check.

Wouter van Oortmerssen

unread,
Apr 10, 2017, 12:46:52 PM4/10/17
to mikkelfj, FlatBuffers
Yup, the current C++ parser can probably quite easily be extended to convert JSON to FlexBuffers.

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages