https://kotlinlang.org logo
Title
h

holgerbrandl

10/19/2018, 10:23 AM
@voddan interesting perspective. But jvm arrays can also be shared by reference between libraries, couldn’t they?
v

voddan

10/19/2018, 10:27 AM
@holgerbrandl I think the point is to share parts of the array (like with C pointers)
h

holgerbrandl

10/19/2018, 10:28 AM
isn’t a jvm reference pretty close to a pointer?
☝️ 1
v

voddan

10/19/2018, 10:28 AM
The use case they mention is storing an image in a chunk and then allow image processing libraries to read certain regions of this image
h

holgerbrandl

10/19/2018, 10:30 AM
you can certainly do this with libraries such as https://github.com/imglib/imglib2/ which has some array as data-backend and which defines various iterators to traverse it.
v

voddan

10/19/2018, 10:32 AM
Can it provide C interop to work with GPU shaders?
h

holgerbrandl

10/19/2018, 10:34 AM
I guess the reference to the data array can be exposed via JNI, but no clue about GPUs. But I’d not think that python arrays can be gpu-processed without copying.
n

Nikky

10/19/2018, 10:39 AM
KN could certainly interface with C libraries and share pointers, not sure how much KN can do shaders or gpu processing though
for that you would probably need a C lib
h

holgerbrandl

10/19/2018, 10:40 AM
kn==Kotlin?
n

Nikky

10/19/2018, 10:41 AM
kotlin/native
v

voddan

10/19/2018, 11:33 AM
To add some perspective, here is a pythonist's explanation of what Buffers Protocol is useful for: "Well, in scientific computing, most of the interesting algorithms are implemented in compiled code: for example, scipy is essentially a set of wrappers around NetLib utilities, which are well-tested implementations of scientific algorithms written mostly in Fortran and C. The ability for Python to natively share data with these compiled libraries is incredibly important for scientific computing. " from https://jakevdp.github.io/blog/2014/05/05/introduction-to-the-python-buffer-protocol/
e

elizarov

10/19/2018, 11:44 AM
I frankly think that 99.999% of Python users only care about having a concise scripting language (Pyton) and an ecosystem of libraries (NumPy and beyond) that work and solve their needs. What the hell library authors has to go though to write those libs they care less (and it is a hell in Python world despite the claims of the miraculous buffer protocol).
👍 3
3
🤔 1
t

thomasnield

10/19/2018, 3:37 PM
I agree with @elizarov. I don't think the implementation of libraries are paid much attention to by most library users. I also think few library users are pushing the limits of the libraries to where they start questioning the implementation.
l

louiscad

10/20/2018, 2:19 AM
Something interesting is that Python is no longer the fastest growing language as seen in GitHub Octoverse… Kotlin is! You can now write headlines like: "Learn machine learning with the fastest growing programming language" 😜