ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:98459] [Ruby master Feature#14722] python's buffer protocol clone
       [not found] <redmine.issue-14722.20180428063813.13896@ruby-lang.org>
@ 2020-05-20 20:28 ` dsisnero
  2020-06-17  9:22 ` [ruby-core:98835] " muraken
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: dsisnero @ 2020-05-20 20:28 UTC (permalink / raw
  To: ruby-core

Issue #14722 has been updated by dsisnero (Dominic Sisneros).


Any thoughts on this? This would help to use views of numo_narray and NMatrix without copying to/from ruby.  See https://github.com/ruby-numo/numo-narray/issues/25

----------------------------------------
Feature #14722: python's buffer protocol clone
https://bugs.ruby-lang.org/issues/14722#change-85733

* Author: jsaak (jsaak jsaak)
* Status: Open
* Priority: Normal
----------------------------------------
Is there a way to implement, or even copy Python's buffer protocol in ruby?

There is an article that describes the benefits quite well:
https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-growing-programming-language-due-to-a-feature-youve-never-heard-of/

I did some work with machine vision, and the ability to manipulate images fast was also not realistic with ruby today.
This could be another area where ruby could shine.

Maybe this idea is worth a comment.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:98835] [Ruby master Feature#14722] python's buffer protocol clone
       [not found] <redmine.issue-14722.20180428063813.13896@ruby-lang.org>
  2020-05-20 20:28 ` [ruby-core:98459] [Ruby master Feature#14722] python's buffer protocol clone dsisnero
@ 2020-06-17  9:22 ` muraken
  2020-06-18  8:13 ` [ruby-core:98859] " muraken
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: muraken @ 2020-06-17  9:22 UTC (permalink / raw
  To: ruby-core

Issue #14722 has been updated by mrkn (Kenta Murata).


I have a similar problem.  I want to share raw memory among the different C extension libraries, such as numo-narray, red-arrow, numpy.rb, and pandas.rb.

I intended to implement [PEP-3118](https://www.python.org/dev/peps/pep-3118/) like feature in Fiddle (See [ruby/fiddle#17](https://github.com/ruby/fiddle/issues/17) and [ruby/fiddle#18](https://github.com/ruby/fiddle/issues/18)), but it has not been done, yet. This feature is just related to C extension library layer, so Fiddle should be a suitable place to implement it. But it could not be done because we encountered the difficult issue: referring symbols in a C extension library from the other C extension library.

We need to introduce functions like `PyObject_CheckBuffer` and `PyObject_GetBuffer` for realizing buffer protocol. If we introduce `rb_fiddle_check_buffer` and `rb_fiddle_get_buffer` in fiddle.so, there is no portable and legal way to refer them from the other C extension libraries.

There are two ways to avoid this issue.

1. Introducing [libruby-fiddle.so](http://libfiddle.so) in Fiddle. This provides functions for C extension libraries. It is installed in the directory where [libruby.so](http://libruby.so) is located.
2. Implement buffer protocol features in Ruby's core.

I guess the former way is very difficult because we let `gem install` put `libruby-fiddle.so` in the appropriate place. So it is better to provide buffer protocol in Ruby's core if possible.

----------------------------------------
Feature #14722: python's buffer protocol clone
https://bugs.ruby-lang.org/issues/14722#change-86199

* Author: jsaak (jsaak jsaak)
* Status: Open
* Priority: Normal
----------------------------------------
Is there a way to implement, or even copy Python's buffer protocol in ruby?

There is an article that describes the benefits quite well:
https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-growing-programming-language-due-to-a-feature-youve-never-heard-of/

I did some work with machine vision, and the ability to manipulate images fast was also not realistic with ruby today.
This could be another area where ruby could shine.

Maybe this idea is worth a comment.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:98859] [Ruby master Feature#14722] python's buffer protocol clone
       [not found] <redmine.issue-14722.20180428063813.13896@ruby-lang.org>
  2020-05-20 20:28 ` [ruby-core:98459] [Ruby master Feature#14722] python's buffer protocol clone dsisnero
  2020-06-17  9:22 ` [ruby-core:98835] " muraken
@ 2020-06-18  8:13 ` muraken
  2020-07-16  4:13 ` [ruby-core:99187] " muraken
  2020-09-25 12:06 ` [ruby-core:100143] " muraken
  4 siblings, 0 replies; 5+ messages in thread
From: muraken @ 2020-06-18  8:13 UTC (permalink / raw
  To: ruby-core

Issue #14722 has been updated by mrkn (Kenta Murata).


In today's developer meeting, the participants want to have a look at a concrete implementation proposal.
I'll propose Ruby's version of the buffer protocol later.

----------------------------------------
Feature #14722: python's buffer protocol clone
https://bugs.ruby-lang.org/issues/14722#change-86222

* Author: jsaak (jsaak jsaak)
* Status: Open
* Priority: Normal
----------------------------------------
Is there a way to implement, or even copy Python's buffer protocol in ruby?

There is an article that describes the benefits quite well:
https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-growing-programming-language-due-to-a-feature-youve-never-heard-of/

I did some work with machine vision, and the ability to manipulate images fast was also not realistic with ruby today.
This could be another area where ruby could shine.

Maybe this idea is worth a comment.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:99187] [Ruby master Feature#14722] python's buffer protocol clone
       [not found] <redmine.issue-14722.20180428063813.13896@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2020-06-18  8:13 ` [ruby-core:98859] " muraken
@ 2020-07-16  4:13 ` muraken
  2020-09-25 12:06 ` [ruby-core:100143] " muraken
  4 siblings, 0 replies; 5+ messages in thread
From: muraken @ 2020-07-16  4:13 UTC (permalink / raw
  To: ruby-core

Issue #14722 has been updated by mrkn (Kenta Murata).


I'm working on writing a patch for this issue in https://github.com/ruby/ruby/pull/3261.

----------------------------------------
Feature #14722: python's buffer protocol clone
https://bugs.ruby-lang.org/issues/14722#change-86567

* Author: jsaak (jsaak jsaak)
* Status: Open
* Priority: Normal
----------------------------------------
Is there a way to implement, or even copy Python's buffer protocol in ruby?

There is an article that describes the benefits quite well:
https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-growing-programming-language-due-to-a-feature-youve-never-heard-of/

I did some work with machine vision, and the ability to manipulate images fast was also not realistic with ruby today.
This could be another area where ruby could shine.

Maybe this idea is worth a comment.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:100143] [Ruby master Feature#14722] python's buffer protocol clone
       [not found] <redmine.issue-14722.20180428063813.13896@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2020-07-16  4:13 ` [ruby-core:99187] " muraken
@ 2020-09-25 12:06 ` muraken
  4 siblings, 0 replies; 5+ messages in thread
From: muraken @ 2020-09-25 12:06 UTC (permalink / raw
  To: ruby-core

Issue #14722 has been updated by mrkn (Kenta Murata).

Status changed from Open to Closed

Fixed by https://github.com/ruby/ruby/commit/890bc2cdde4097390f3b71dfeaa36dd92ee0afe2

----------------------------------------
Feature #14722: python's buffer protocol clone
https://bugs.ruby-lang.org/issues/14722#change-87717

* Author: jsaak (jsaak jsaak)
* Status: Closed
* Priority: Normal
----------------------------------------
Is there a way to implement, or even copy Python's buffer protocol in ruby?

There is an article that describes the benefits quite well:
https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-growing-programming-language-due-to-a-feature-youve-never-heard-of/

I did some work with machine vision, and the ability to manipulate images fast was also not realistic with ruby today.
This could be another area where ruby could shine.

Maybe this idea is worth a comment.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-25 12:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-14722.20180428063813.13896@ruby-lang.org>
2020-05-20 20:28 ` [ruby-core:98459] [Ruby master Feature#14722] python's buffer protocol clone dsisnero
2020-06-17  9:22 ` [ruby-core:98835] " muraken
2020-06-18  8:13 ` [ruby-core:98859] " muraken
2020-07-16  4:13 ` [ruby-core:99187] " muraken
2020-09-25 12:06 ` [ruby-core:100143] " muraken

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).