spiraldb / ziggy-pydust

A toolkit for building Python extensions in Zig.
https://pydust.fulcrum.so/
Apache License 2.0
371 stars 16 forks source link

Add more ergonomic usage of Buffer protocol with SIMPLE flag. #90

Open gatesn opened 11 months ago

gatesn commented 11 months ago

PyBUF_SIMPLE is a flag used to denote a buffer is a pure 1-dimensional contiguous unsigned u8 array.

This is a pretty common use-case, so we should make it close to trivial to map back and forth to Zig []u8.

In fact, we could support quite a lot of the 1-dimensional buffer protocol using comptime.

delta003 commented 11 months ago

Related -> https://github.com/fulcrum-so/ziggy-pydust/issues/29