Closed
Description
Hi, I talked briefly to @Stebalien about merging some of the work from our https://github.com/yatima-inc/sp-multihash no_std fork. Happy to send PRs, but wanted to ask a few questions first:
- Const-Generics:
sp-multihash
is on rust 1.54-nightly, so we were able to adapt @mriise's excellent const generics #116. It looks like you guys are waiting on 🔬 Tracking issue for generic associated types (GAT) rust-lang/rust#44265 hitting stable Rust first before merging const generics #116. To me, the usability regression reported in this comment seems acceptable compared to the usability gains from not having to drag typenums around everywhere. Plus,const-generics
also opens up some really exciting refactoring possiblities, like @Stebalien's neat idea for using DSTs to erase the size-info here: Unsized Cids argumentcomputer/sp-cid#5. Since waiting some weeks/months for stable GATs seems not ideal, I'm wondering if we can figure out some way around this:
- Is the stable requirement an absolute for this lib? Or maybe we could make a "nightly"
rust-multihash
branch/release so that development here isn't impacted by rustc as much? - Alternatively, is there a way to make the above usability regression acceptable to you, using only stable
const-generics
?
- ByteCursor: Our
no_std
work removesstd::io
functions for reading/writing in favor of our bytecursor library. This can be added independently of Const-Generics.
- Is the bytecursor dependency acceptable here? What about
sp-std
? - Do you want to keep the
std::io
, functions gated behind thestd
feature via pragmas? If so, shouldstd
still be default?
- Nix: We've added a Nix build to
sp-multihash
, and can PR (independently of the above) to add one here (preview: https://github.com/yatima-inc/rust-multihash/pull/1/files), if that's of interest.
Metadata
Metadata
Assignees
Labels
No labels