Article 652DG Gaynor: Buffers on the edge: Python and Rust

Gaynor: Buffers on the edge: Python and Rust

by
corbet
from LWN.net on (#652DG)
Alex Gaynor examines theawkwardness that comes when trying to interface Python and Rust code.

The challenge is that if you want to pass some bytes to a Rustlibrary to parse them (or do any other processing for that matter),the library almost certainly expects a &[u8], andthere's no way to turn a &[ReadOnlyCell<u8>]into a &[u8] safely, without allocating andcopying. And of course, the whole point of the Python bufferprotocol is to avoid these sorts of inefficiencies.

Therefore, the regrettable solution is that, right now, there is noway to have all three of: efficiency, interoperability, andsoundness.

External Content
Source RSS or Atom Feed
Feed Location http://lwn.net/headlines/rss
Feed Title LWN.net
Feed Link https://lwn.net/
Reply 0 comments