paleolimbot commented on issue #403:
URL:
https://github.com/apache/arrow-nanoarrow/issues/403#issuecomment-2004207000
I would love to see/use these!
When I wrote the initial tests for nanoarrow I was (1) not very good at C++
yet, (2) was attempting a vague simulation of the C code somebody might type,
since it was C library, after all, and (3) there were no C++ helpers yet and so
I didn't use them.
Since then it's become clear that even though having the C runtime library
is important for size, portability, and to not exclude would-be vendorers that
are not set up to build using C++, most libraries and/or Python/R packages that
use nanoarrow are doing so from C++ (including our own R bindings and probably
the Python bindings at some point).
I'd like to keep C++11 support around for a while, at least in the "all of
our tests still build and run on gcc4.8" sense. This is just because we're a
vendorable library whose main purpose is to build anywhere and not cause
downstream libraries any issues. Helpers that need C++17 are still welcome,
though, for the day we do drop support, plus things like benchmarks and
tutorials aren't subject to the C++11 constraint. I think it's possible add the
helpers and `#ifdef` around that.
For:
```cpp
struct ArrowArrayStream* stream = get_stream();
for (const ArrowArray* array : *stream) {
for (Maybe<int32_t> value : ArrayAs<int32_t>(array)) {
// ...
}
}
```
I'm a little worried about adding C++ interpretations of the actual
`ArrowArrayStream`. Maybe `ArrayStreamIterator(stream_ptr)`? Another
consideration is error handling...even the C++ helpers use the "return
`ArrowErrorCode` and accept `ArrowError*` pattern because the C++ usage is
almost always combined with nanoarrow C library calls. I'm not sure how to
reconcile that with the iteration (or maybe the iteration is just a place that
we have to use exceptions).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]