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

Binary stream I/O #25

Open
fatcerberus opened this issue Oct 7, 2016 · 4 comments
Open

Binary stream I/O #25

fatcerberus opened this issue Oct 7, 2016 · 4 comments

Comments

@fatcerberus
Copy link
Contributor

Latest development build of minisphere adds a DataReader object which can be used to read binary data from files and sockets:
https://github.com/fatcerberus/minisphere/blob/master/docs/miniRT-api.txt#L514-L615

Do we also want to have a DataWriter, or should we leave that out in order to push developers to use JSON instead for new formats?

@FlyingJester
Copy link
Member

I think that if you have a binary data reader, it only makes sense to include a binary data writer.

@fatcerberus
Copy link
Contributor Author

I was thinking along the lines of the TextEncoder/Decoder standard, where a whole bunch of legacy formats are supported for decoding, but only UTF-8 in the other direction. But I guess binary data isn't really "legacy" in any real sense - it's useful to be able to send binary data over a socket, for instance.

@fatcerberus
Copy link
Contributor Author

One thing I do want to do for the standard binary module is simplify the schema format used by readStruct(). The schema format used in the miniRT module has a lot of fancy features like backreferences, conditional sections, etc. which allow me to read entire Sphere v1 formats in one go (including RMP and all RSS versions, which is quite an accomplishment). That's a bit too much complexity to standardize on, I think.

@FlyingJester
Copy link
Member

Perhaps something closer to the format I used in TurboSphere (using the json formats I put under the Spehre-Group name)? It's true it required the script to determine what kind of block came next, but I found that provided a pretty simple and straightforward mechanism to load the Sphere formats at least.

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

2 participants