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
Implement IOList BIFs #362
Conversation
I'm starting with pretty naive implementations here, to get my feet wet. This is my first Rust programming, and first exposure to both the Lumen dev environment and to iolist, so I've gotta find a handhold somewhere. It's taken a bit of digging to find good information on the use cases for iolist vs the similar I'm beginning to understand the use case of optimizing memory usage when streaming data such as when writing to a file or socket. The iolist functions can allow for more efficient list operations and memory usage. Handling improper lists is part of this use case. Helpful resources on this: here, here, here, here. |
I'm not sure whether adding test coverage for the binary sub-types is important. Interested to hear what a reviewer thinks about that. |
@KronicDeth do you have any feedback regarding whether it's important to test with various binaries that would result in different internal typed terms? (ProcBin, HeapBinary, SubBinary, MatchContext) Seems like I saw something possibly related on #200 . |
You definitely need to test subbinaries to show that you handle non-binary ones correctly. |
6c83d3a
to
d698266
Compare
I rebased onto I was not successful at constructing a MatchContext that I could pass in as a term from the test module. I tried adding a test for ProcBin, which seemed to expose the fact that the |
52f71a1
to
2dc5176
Compare
2dc5176
to
002a066
Compare
… in list for iolist_to_iovec/1
…lements to binaries
002a066
to
7bf6919
Compare
Recursion isn't safe to do in Rust the way it is in Erlang/Elixir.
b24a16e
to
fdd7d4b
Compare
Fixes binaries in iolists showing up as empty spaces like `[0 | ]` for `[0 | ""]`.
Include proper argument name instead of using "string".
Resolves #153.
iolist_to_binary/1
iolist_size/1
iolist_to_iovec/1
SubBinary
MatchContext
This doesn't seem to be possible yet.