rs-ipfs / rust-ipfs

The InterPlanetary File System (IPFS), implemented in Rust.
Apache License 2.0
1.26k stars 163 forks source link

ipfs-unixfs: no_std and alloc -ification for wasm use #247

Open koivunej opened 4 years ago

koivunej commented 4 years ago

Creating this issue following interest expressed in the comments of #222. I don't have much to go on from my previous comment on this topic.

nuke-web3 commented 4 years ago

I am finally getting a start on this, and my entry into this got a minor error trying to cargo build an example (#266) . Based on your last comment, I may be going down the wrong path?

koivunej commented 4 years ago

Would the use of bytes in ipfs-unixfs hurt this goal, or is it no_std compat or could we somehow be generic over the buffer type? It would of course be nice to seek out less allocation or less copying solutions as well.

ljedrz commented 4 years ago

As far as I can tell, bytes is no_std-aware and uses core and alloc internally. Enabling (default) std utilizes IoSlice.

koivunej commented 4 years ago

Well, that's just excellent. Yeah, need to do some bytes exploration, that might allow a path to much simpler impl and better perf. I'll try to write the thoughts up... Later.