Flatbuffers: FlexBuffers Java/JavaScript Example?

Created on 8 Jan 2020  路  8Comments  路  Source: google/flatbuffers

Hi! Was curious if you would have an example of implementing FlexBuffers in Java and JavaScript? Currently, the docs (https://google.github.io/flatbuffers/flexbuffers.html) only have C++...

Thanks!

stale

Most helpful comment

Swift repo has an example in README
https://github.com/mzaks/FlexBuffersSwift
I would also recommend to have a look at unit tests
https://github.com/mzaks/FlexBuffersSwift/tree/master/FlexBuffersTests

FlexBuffers-CSharp also has an example in README:
https://github.com/mzaks/FlexBuffers-CSharp#flexbuffer-builder
And also lots of unit tests:
https://github.com/mzaks/FlexBuffers-CSharp/tree/master/FlexBuffersCSharpTests

In general I think it would be great to have one, or even multiple standardised examples which every language needs to implement. Similar to what we have here for FlatBuffers:
https://github.com/google/flatbuffers/tree/master/samples

PS: I already wrote couple of article on medium about FlexBuffers, but they were mostly about dedicated language implementations. I can write a more generic explaining the internals and how a buffer is built and read. IMHO this could make it easier for people to use FlexBuffers and also write ports for other languages.

All 8 comments

Yup, would be nice to add examples in other languages, though that may need to be pulled into a file like Tutorial.md where you can select the language.

@paulovap (Java) @CasperN (Rust) @mzaks (Swift)

Swift repo has an example in README
https://github.com/mzaks/FlexBuffersSwift
I would also recommend to have a look at unit tests
https://github.com/mzaks/FlexBuffersSwift/tree/master/FlexBuffersTests

FlexBuffers-CSharp also has an example in README:
https://github.com/mzaks/FlexBuffers-CSharp#flexbuffer-builder
And also lots of unit tests:
https://github.com/mzaks/FlexBuffers-CSharp/tree/master/FlexBuffersCSharpTests

In general I think it would be great to have one, or even multiple standardised examples which every language needs to implement. Similar to what we have here for FlatBuffers:
https://github.com/google/flatbuffers/tree/master/samples

PS: I already wrote couple of article on medium about FlexBuffers, but they were mostly about dedicated language implementations. I can write a more generic explaining the internals and how a buffer is built and read. IMHO this could make it easier for people to use FlexBuffers and also write ports for other languages.

Tutorial.md

i like it.

my repo https://github.com/tsingson/fastws-example --- golang / javascript websocket example via flatbuffers , fasthttp, fastws.

@mzaks please do! We can link it from the docs here, though if you wanted to expand the FlexBuffers docs in this repo that be even better!

Hey there,

I think I added basic examples for the website, but I think it needs to be regenerated. Not sure if @aardappel updated the site already.

But you can also take a look at the tests, even though they are not complex examples:

https://github.com/google/flatbuffers/blob/master/tests/JavaTest.java#L940

Yeah the docs haven't been updated in a while, will do that when the release happens.

This issue is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NN--- picture NN---  路  6Comments

rw picture rw  路  3Comments

siebeneicher picture siebeneicher  路  6Comments

eduardosm picture eduardosm  路  3Comments

cberner picture cberner  路  3Comments