roee88 edited a comment on issue #177:
URL: 
https://github.com/apache/arrow-datafusion/issues/177#issuecomment-963761947


   @seddonm1 compile and run?
   
   I have experimented with that yesterday. I tried wasm32-wasi first and a 
simple sample works in single threaded mode after disabling some parquet 
features. See this gist for the example: 
https://gist.github.com/roee88/91f2b67c3e180fa0dfb688ba8d923dae
   
   For wasm32-unknown-unknown adding getrandom with js as a dependency of the 
sample makes it compile IIRC, but actually running it is a different story. I 
tried to get a sample working with wasm-pack and it stops execution on the 
datafusion context creation, I suspect that it uses some sync primitives that 
are unsupported in wasm32-unknown-unknown but I didn't investigate further.
   
   I didn't try wasm32-unknown-emscripten yet since my local rust version is 
incompatible with my installed emcc version (both latest at the time of this 
writing). 
   
   Edit: re tokio, the sample above worked on wasm32-wasi with other executors 
including futures 0.3, https://github.com/richardanaya/executor, and 
async-global-executor. As long as you don't hit code paths that use things like 
tokio::spawn (used in hash aggregate) it might be fine. I'm not sure what's the 
best approach for library code that needs to spawn tasks. I have seen opinions 
for 1) a library should never spawn, 2) futures should be universally 
supported, 3) a library should accept an executor trait (as implemented in 
https://github.com/najamelan/async_executors). I didn't check the state of 
futures and WebAssembly recently.


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