Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlatSharp Support for 64 Bit FlatBuffers #374

Open
jamescourtney opened this issue Mar 19, 2023 · 0 comments
Open

FlatSharp Support for 64 Bit FlatBuffers #374

jamescourtney opened this issue Mar 19, 2023 · 0 comments

Comments

@jamescourtney
Copy link
Owner

This thread is to document design and other considerations for supporting google/flatbuffers#7537. Support for this in FlatSharp will be nontrivial, but is something that people periodically ask for.

On a whim, the set of issues that need to be resolved are:

  • IInputBuffer interface changes from int to ulong for indices (or, nuint).
  • Alternative to Span<T> that supports 64 bit indexes. Possibly a SpanWindow<T> that could return a span over a given window.
  • Some 64 bit collection replacement for IList<T>, which also only supports 32 bit indexes.

This will constitute a breaking API change for FlatSharp. Further, this will likely require the project to cross a couple of bridges that I've resisted so far:

  • Dependencies on non-Microsoft libraries (Microsoft does not provide 64 bit collections, Spans, Memory, Arrays, etc).
  • Use of unsafe code

All told, this will be more difficult in C# than it really should be. Further, I'm curious about whether people truly want to see this supported. I'm also curious how we'll cross-validate this with google/FlatBuffers C# given that they are likely to run into many of the same 32 bit limitations that FlatSharp is.

So, the questions are:

  • Can FlatSharp (as a C# project) support this?
  • What changes and dependencies would be needed to do so? Given this new set of dependencies and changes, should FlatSharp support this?
  • Are there vetted, secure, and trustworthy 64 bit implementations of Collections, Memory, Span, and other "primitives" that FlatSharp could leverage?
@jamescourtney jamescourtney pinned this issue Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant