alamb commented on issue #10853:
URL: https://github.com/apache/arrow-rs/issues/10853#issuecomment-5441675974

   Thank you for the detailed writeup @juliendurand
   
   I think there may be a misunderstanding about the target: 
`wasm32-unknown-unknown` is not a `no_std` target — the full `std` library 
(including `std::io::Read`) is available there. What's missing is the OS layer, 
so things like `std::fs::File` fail at runtime, but in-memory I/O works fine. 
In fact arrow-rs CI already builds the `arrow` crate with the `csv`, `json`, 
and `ipc` features (and the `parquet` crate) for both `wasm32-unknown-unknown` 
and `wasm32-wasip1` on every PR: 
https://github.com/apache/arrow-rs/blob/main/.github/workflows/arrow.yml
   
   For your use case (CSV bytes uploaded in the browser), I believe the 
existing APIs already cover it:
   
   1. 
[`ReaderBuilder::build`](https://docs.rs/arrow-csv/latest/arrow_csv/reader/struct.ReaderBuilder.html#method.build)
 is generic over `R: Read`, and `&[u8]` implements `Read`, so you can pass your 
byte buffer directly
   2. There is also a lower-level push-based API, 
[`Decoder`](https://docs.rs/arrow-csv/latest/arrow_csv/reader/struct.Decoder.html)
 (via 
[`ReaderBuilder::build_decoder`](https://docs.rs/arrow-csv/latest/arrow_csv/reader/struct.ReaderBuilder.html#method.build_decoder)),
 which takes `&[u8]` chunks directly and doesn't involve any I/O trait at all — 
designed exactly for sources like chunked byte streams. The JSON reader has an 
equivalent 
[`Decoder`](https://docs.rs/arrow-json/latest/arrow_json/reader/struct.Decoder.html)
   
   Could you try one of these on `wasm32-unknown-unknown` and report back if 
you hit a compilation issue? If something in arrow-csv genuinely doesn't 
compile there, that would be a bug worth fixing — but I don't think new traits 
or a `no_std` feature gate are needed for the browser/WASM case. (True `no_std` 
embedded support would be a much larger undertaking and probably worth its own 
discussion if someone has that use case.)
   


-- 
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]

Reply via email to