Type-class-based dispatch
Open
Nobody has claimed this yet.
enhancement
question
- Dominant language
- C++
- Stars
- 693
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
Could we have type-class-based dispatch?
This would involve greatly expanding type classes.
Here's some ideas:
- Link types and matching type classes
- We could store matching types in type classes. The domain will have to update registered type classes when types change. This puts a burden on type creation but keeps types cleaner.
- Alternatively types could have a list of matching type classes. This could make things easier on lookups, but becomes problematic when new type classes appear. Supporting this would mean that we might need to update "live" types, which is unpleasant and would involve locks.
- Maybe only the type class list in a type could be lockable and all other features remain immutable (and lockless)
- We could of course have an immutable type class list in a type, but that means new type classes (say, from a plugin) become much less versatile
- In the end a bidirectional mapping may end up being desirable
- Create type class vtables (dispatch tables)
- Does it make sense to have type-class-level features (more than just function dispatch)
- If we're pursuing multiple dispatch, perhaps they should be per function/feature rather than per type class
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by reviewing the existing type-class and dispatch design, then resolve the mapping, mutability, locking, vtable, and multiple-dispatch questions before implementation; done requires an agreed design and a defined scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100