noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
824 stars 178 forks source link

Epic: Implement Traits #2568

Open nickysn opened 10 months ago

nickysn commented 10 months ago

This is a tracking issue for the implementation of traits.

Noir Traits Roadmap

Note: Traits are a huge feature, and this list is by no means final. Expect more steps to be added along the way.

Parser

Parser (optional)

Def collector

Name resolution/Type checking

Monomorphization

### Support generic traits
- [ ] Allow generic traits to be implemented multiple times for the same type.
- [x] Pick the correct overload for trait methods based on call arguments.
- [ ] https://github.com/noir-lang/noir/issues/3471

Implement builtin traits

  • [x] Operator overloading: Rust std::ops equivalents (Add, Sub, ...)
  • [x] Operator overloading: Rust std::cmp equivalentes (Eq, PartialEq)
  • [ ] Function traits (Fn)
### Support combining of traits
- [ ] https://github.com/noir-lang/noir/issues/3949

Testing

### Bugs
- [ ] https://github.com/noir-lang/noir/issues/3474
- [ ] https://github.com/noir-lang/noir/issues/3940
- [ ] https://github.com/noir-lang/noir/issues/3948
- [ ] https://github.com/noir-lang/noir/issues/3964
- [ ] https://github.com/noir-lang/noir/issues/4088
- [ ] https://github.com/noir-lang/noir/issues/4095
- [ ] https://github.com/noir-lang/noir/issues/4124
kevaundray commented 10 months ago

Adding #2629 for when this Epic is nearing completion

Savio-Sou commented 6 months ago

Added a "Bugs" section to the original Issue with latest ones @jfecher gathered.

Savio-Sou commented 6 months ago
jfecher commented 3 months ago

I've made issues for all the remaining items. They are:

Of these, only #4538 is a major item. The rest are mostly small syntactic shorthands which would be nice to have. #4539 is to some degree necessary, but only once we have #4538.