constantinpape / z5

Lightweight C++ and Python interface for datasets in zarr and N5 format
MIT License
111 stars 27 forks source link

[question] Rational way to interface zarr with Rust #201

Closed KestutisMa closed 2 years ago

KestutisMa commented 2 years ago

It's not real a z5py issue, but I think still interesting, as Rust probably could be useful in research (https://www.nature.com/articles/d41586-020-03382-2).

What could be good way to interface zarr with project in Rust?

Native rust zarr implementation seems unmaintained for 2 years https://github.com/sci-rs/zarr. Also, seems there were discussions, but last post was about a year ago and no working implementation yet.

clbarnes commented 2 years ago

The rust N5 implementation is in production use and would certainly serve as a good base. As discussed in that issue, there are possibly design changes which could minimise allocations, but they haven't been forthcoming. Deep optimisation at that level seemed premature when these formats are designed to suppose very heavy IO which would drastically outweigh any marginal gains on path-handling end.

We were resistant to putting significant effort into a rust implementation of zarr v2 when zarr v3 is "around the corner", but there hasn't been a lot of progress on that front in the last couple of years either.

A proposal rust implementation, potentially based off rust-n5, would certainly be welcome.

constantinpape commented 2 years ago

rust-n5 is certainly the way to go, and afaik it also supports zarr as a file format.

zarr v3 is "around the corner", but there hasn't been a lot of progress on that front in the last couple of years either.

There actually has been some momentum recently towards finalizing zarr v3 and there are first implementations in python and c++ already; see recent issues in https://github.com/zarr-developers/zarr-specs/issues

KestutisMa commented 2 years ago

Thank you! Good to know.