algebra
algebra copied to clipboard
Inconsistent feature gate "curve" is annoying
We should standardise the use of the feature across all crates.
This is required for macro based compilation in cuda kernels.
Agreed. Same applies to base_field and scalar_field.
I'd suggest we follow the convention currently done in bls12_377 for example. That would mean feature gating:
base_fieldforfqscalar_fieldforfrcurvefor extension fieldsfqX(if any), as well as the fullcurvessubmodule (<Curve Family>Configas well as individual curve configs in different forms, type aliases etc., if any)default = [ "curve" ]
Are these features even required? If rustc produces multiple .o files within the crate, then linkers should remove the dead code, so these features only save build time.
At least objdump -t on files in ./target shows rustc placing symbols into into different files sometimes, but maybe codegen-units = 1 or whatever changes this.
Another more extreme option: split some field crates off from their curve crates. I doubt this is worth the effort.
It's more for compile-time savings than for space savings. But I agree that we should be consistent about these feature flags throughout the repo, instead of having them only in one-off crates.