Timely and Differential Dataflow can almost be compiled and run using WASM in the browser, at least with the single-threaded worker.
The only bit that prevents this is the use of std::time::Instant::now() which is not available in the wasm32-unknown-unknown target (as there is no access to system clock). In Timely this is only used in connection to logging and could be patched with about 10 changes across the crate.
The simplest solution would be to use the instantcrate, which only has one dependence itself and works as std::time::Instant on all platforms other than WASM. An alternative could be to directly qualify the use of instants in Timely itself.
That said, I noticed there was an old issue about time in logging, so maybe my suggestion is not as innocuous as it seems.
Timely and Differential Dataflow can almost be compiled and run using WASM in the browser, at least with the single-threaded worker.
The only bit that prevents this is the use of
std::time::Instant::now()
which is not available in thewasm32-unknown-unknown
target (as there is no access to system clock). In Timely this is only used in connection to logging and could be patched with about 10 changes across the crate.The simplest solution would be to use the
instant
crate, which only has one dependence itself and works asstd::time::Instant
on all platforms other than WASM. An alternative could be to directly qualify the use of instants in Timely itself.That said, I noticed there was an old issue about time in logging, so maybe my suggestion is not as innocuous as it seems.