GithubHelp home page GithubHelp logo

Implement buffer protocol for Ruby about fiddle HOT 8 CLOSED

ruby avatar ruby commented on June 19, 2024
Implement buffer protocol for Ruby

from fiddle.

Comments (8)

ioquatix avatar ioquatix commented on June 19, 2024

You want to implement support for python buffers in Ruby?

from fiddle.

kou avatar kou commented on June 19, 2024

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.

from fiddle.

ioquatix avatar ioquatix commented on June 19, 2024

How does it fit with existing I/O operations? Can we use this new proposed buffer instead of strings for I/O?

from fiddle.

kou avatar kou commented on June 19, 2024

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?

from fiddle.

ioquatix avatar ioquatix commented on June 19, 2024

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.

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 readv and writev in mind.

from fiddle.

kou avatar kou commented on June 19, 2024

Thanks.
I'll read them later.

from fiddle.

dsisnero avatar dsisnero commented on June 19, 2024

I added this to developers meeting- Hopefully it gets accepted https://bugs.ruby-lang.org/issues/16933

from fiddle.

kou avatar kou commented on June 19, 2024

It's discussing in ruby/ruby#3261 .

from fiddle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.