Closed thomaseizinger closed 3 years ago
It is very easy to remove specialization and just put the default (slow) implementation of each primitive as the only one and then enable the faster variants with a nightly
feature.
Would that be of help?
[edit] From memory we're talking about a 70 micro second slow down for a secret key to public key (for example). This would make things like: https://docs.rs/sigma_fun/0.3.1/sigma_fun/ext/dl_secp256k1_ed25519_eq/index.html a second or so slower (would need to bench it).
That would be really nice as secpfun is the only dep forcing us on nightly atm!
I'll see to send a PR for that!
So to be clear the things that need to be done are:
1) from the base implementation (the one where everything is marked default for each impl chain) remove default
i.e.
get rid of them for here unless nightly
feature enabled from here
I suggest trying to make a macro that parses a list of functions and outputs two versions (one with not(feature = nightly)
and the other with feature = nightly
.
2) for each specializing impl just put #[cfg(feature = nightly)]
on top of it
3) Put README.md
embedding which needs extended_key_value_attributes
under nightly as well: https://github.com/LLFourn/secp256kfun/blob/26a0f272d722257ae9d49d764fef609f1e0a92dc/secp256kfun/src/lib.rs#L2
this should be all we need to run on stable.
Fixed in #65.
Are there any plans to move away from Rust nightly?
Specialization doesn't look like it is going to be stabilized any time soon.