Comments (5)
With has
there shouldn't be any problems. But with is
, if we just remove them there will be a name collision between the concrete instantiation and the trait. So this should be taken in account for the refactor
from lambdaworks.
Fwiw, naming the trait and the struct the same thing isn't the worst.
You could always partially or fully qualify the trait. For example, math::traits::Field
, which is fine as you likely only use the trait in one place per file.
You can also do a renaming import: use math::traits::Field as FieldTrait
.
Both are fine for clarity's sake and avoid awkward naming conventions.
from lambdaworks.
Fwiw, naming the trait and the struct the same thing isn't the worst.
You could always partially or fully qualify the trait. For example,
math::traits::Field
, which is fine as you likely only use the trait in one place per file.You can also do a renaming import:
use math::traits::Field as FieldTrait
.Both are fine for clarity's sake and avoid awkward naming conventions.
I agree with this, we should take a similar approach.
from lambdaworks.
The naming convention we used is: "Nouns only for structs". Every name that is not a noun is allowed for a trait. For example adjectives, verbs, or things like "IsSomething" are all allowed. The "Is" or "Has" prefix is not mandatory, but we found it more declarative in some cases, specially when you see variable types: where F: IsField
.
In my opinion it would be good if we have some kind of naming convention, it doesn't have to be this one necessarily.
from lambdaworks.
The naming convention we used is: "Nouns only for structs". Every name that is not a noun is allowed for a trait. For example adjectives, verbs, or things like "IsSomething" are all allowed. The "Is" or "Has" prefix is not mandatory, but we found it more declarative in some cases, specially when you see variable types:
where F: IsField
.In my opinion it would be good if we have some kind of naming convention, it doesn't have to be this one necessarily.
I think the "Is" or "Has" or any prefix for that matter feels very un-rust-like. I feel in my rust experience most libraries would prefer to pub mod trait
and qualify the trait or import rename.
from lambdaworks.
Related Issues (20)
- Chore: rayon feature -> parallel in math module
- Parallelize Stark Prover round2: transitions and accumulated results HOT 1
- Stark Prover Round1: RAP. Instrument + Parallelization + Optimization
- Feat (perf): Investigate pre-allocating the vector in extend() and merge() from Multilinear Polynomials
- Unsigned Integer limb.to_hex() returns string of size 14, ignoring 2 characters
- Feat(perf): Benchmark Plonky2 bit reversal vs current implementation HOT 1
- Feat(perf): Benchmark alternative algorithm for computation of eq poly evaluations within DenseMultilinearPoly::evaluate() HOT 1
- Update Winterfell adapter to the new AIR HOT 1
- Unify all the transcripts under one API
- MerkleTree: Add parallelization of inner nodes HOT 1
- Add Merkle Mountain Range HOT 1
- Make curves and their fields easier to find
- Unable to verify a Cairo 1 proof HOT 4
- Add delayed-reduction loops for Mersenne 31
- Optimization (Montgomery): Add fast from_u64 conversion using pre-computed lookup Table
- Optimization (Montgomery): Add mul for small values
- Add Jacobian Coordinates for Short Weierstrass HOT 2
- CUDA - Icicle
- Extract new AIR design from AIR Workshop
- Does the stark prover support (perfect)zero knowledge? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lambdaworks.