[enhancement] DSLX Polymorphism
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
### What's hard to do? (limit 100 words)
It's hard to write reusable components like an arbiter because you ideally want it to be type-generic, e.g.
```
proc Arb {
...
config(inputs: chan[N] in, outputs: chan out) { ... }
...
}
```
With traits (#617, #618), you could event take advantage of interfaces to do more interesting things besides shuffling data around.
### Current best alternative workaround (limit 100 words)
Rewrite or use templating. Channel legalization builds type-generic arbiters as part of an opt pass, which is an option if the pattern is common enough.
### Your view of the "best case XLS enhancement" (limit 100 words)
Rust-style type generics with traits.
Contributor guide
Assessment
This issue has not been assessed yet.