You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No.
It's for Ruby. It doesn't care about compatibility with Python's buffer protocol (at least for now).
Apache Arrow, XND or something will be suitable for data exchange over languages.
I don't think about I/O related operations for the buffer protocol. I just think about data exchange.
It may be interesting. Do you have any (potential) use-case with I/O operations? Async I/O related?
It would be great to support readv and writev by supplying array rather than string. Maybe buffer operation can do the same. It would be nice to handle explicit offsets into buffers for both read and write operations, e.g. https://bugs.ruby-lang.org/issues/15560.
We end up treating a string like a binary buffer, but it's often the case this duality causes weird interface issues, e.g. https://bugs.ruby-lang.org/issues/13626.
If we can introduce some kind of buffer concept, with mapping to string, and support for multiple chunks, to make I/O operation more efficient, it would be fantastic. But it needs to be built with I/O readv and writev in mind.
Activity
ioquatix commentedon May 27, 2019
You want to implement support for python buffers in Ruby?
kou commentedon May 28, 2019
No.
It's for Ruby. It doesn't care about compatibility with Python's buffer protocol (at least for now).
Apache Arrow, XND or something will be suitable for data exchange over languages.
ioquatix commentedon May 28, 2019
How does it fit with existing I/O operations? Can we use this new proposed buffer instead of strings for I/O?
kou commentedon May 28, 2019
I don't think about I/O related operations for the buffer protocol. I just think about data exchange.
It may be interesting. Do you have any (potential) use-case with I/O operations? Async I/O related?
ioquatix commentedon May 28, 2019
It would be great to support
readvandwritevby supplying array rather than string. Maybe buffer operation can do the same. It would be nice to handle explicit offsets into buffers for bothreadandwriteoperations, e.g. https://bugs.ruby-lang.org/issues/15560.There are issues with handling binary string concatenation, e.g. https://bugs.ruby-lang.org/issues/14975.
We end up treating a string like a binary buffer, but it's often the case this duality causes weird interface issues, e.g. https://bugs.ruby-lang.org/issues/13626.
If we can introduce some kind of buffer concept, with mapping to string, and support for multiple chunks, to make I/O operation more efficient, it would be fantastic. But it needs to be built with I/O
readvandwritevin mind.kou commentedon May 28, 2019
Thanks.
I'll read them later.
dsisnero commentedon Jun 17, 2020
I added this to developers meeting- Hopefully it gets accepted https://bugs.ruby-lang.org/issues/16933
kou commentedon Sep 13, 2020
It's discussing in ruby/ruby#3261 .