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

topic: packing and unpacking binary data #14

Open
gvwilson opened this issue Mar 8, 2024 · 7 comments
Open

topic: packing and unpacking binary data #14

gvwilson opened this issue Mar 8, 2024 · 7 comments
Assignees
Labels
assigned Topic has been assigned in-content Is the issue in lesson content?
Milestone

Comments

@gvwilson
Copy link
Collaborator

gvwilson commented Mar 8, 2024

  • Like this Python lesson, show how to pack and unpack binary data according to format specs
@gvwilson gvwilson added help-wanted A request for assistance discuss An issue or PR currently being discussed in-content Is the issue in lesson content? propose-addition A suggestion for an addition to content or infrastructure labels Mar 8, 2024
@gvwilson gvwilson added this to the topic-outline milestone Mar 8, 2024
@FabHof
Copy link
Contributor

FabHof commented Mar 11, 2024

Roc has encoding and decodin abilities. Do you think It would be a good idea to write a simple en-/decoder using those abilities?

@gvwilson
Copy link
Collaborator Author

That would be a great place to start, and then we could see how to expand it (e.g., show readers what we would do if we didn't already have those capabilities and had to implement some parts ourselves). Would you like to take this one?

@FabHof
Copy link
Contributor

FabHof commented Mar 12, 2024

Yes please add me.
I think we currently don't even have a binary encode formatter, just json, so this might even lead to an actual usable package.

@lukewilliamboswell
Copy link
Collaborator

It's been on my todo list for a while to build one of these. Folkert suggested I look at https://postcard.jamesmunns.com/wire-format.html as that is something similar and works well with rust. It's not something I have spent much time investigating, just thought I would share in case that helps.

@lukewilliamboswell
Copy link
Collaborator

Also for reference here is a conversation topic about some missing functions we need to implement in builtins to build out the full functionality. Basically we can't do floats rn, but I guess for the sake of the book article those could be left unimplemented.

https://roc.zulipchat.com/#narrow/stream/383402-API-Design/topic/reading.20integers.20from.20bytes/near/418549425

@FabHof
Copy link
Contributor

FabHof commented Mar 12, 2024

Thank you for the links. I am aware of the current limitations, but maybe we can implement the missing methods by the time the book is released. On the other hand, dec and float don't have to be part of the chapter.

I was also thinking of doing a BSON encode formatter. Like "We have this for JSON, let's see how we would do this in a similar binary format".

@gvwilson
Copy link
Collaborator Author

Thanks @FabHof - please create a subdirectory under the project root called binary and put your code there, along with an index.md file with notes to yourself. Cheers - Greg

@gvwilson gvwilson added assigned Topic has been assigned and removed help-wanted A request for assistance discuss An issue or PR currently being discussed propose-addition A suggestion for an addition to content or infrastructure labels Mar 12, 2024
@gvwilson gvwilson changed the title topic proposal: packing and unpacking binary data topic: packing and unpacking binary data Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned Topic has been assigned in-content Is the issue in lesson content?
Projects
None yet
Development

No branches or pull requests

3 participants