google / google/xls

[enhancement] Support generics in DSLX

Open
#3,345 0 comments 0 reactions 1 assignee Claimed by @richmckeever View on GitHub
dslx enhancement
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)

`T: type` should work anywhere you can now use a value parametric.

### Current best alternative workaround (limit 100 words)

Write N copies of the thing, or use sign + bit count parametrics where possible.

### Your view of the "best case XLS enhancement" (limit 100 words)

This is, by design, not a huge lift from the initial state of TIv2.

The roadmap is basically:

1. Get it working for everything except what is listed below.
2. Handle IR conversion of generic dispatch of impl calls, i.e. `foo.bar()` where `foo` is type T.
4. Handle colon refs through T, like `T::SOME_CONST`, `T::static_fn()`, `foo()`.
5. Fix any cross-module issues.
6. #[derive(ToBits)], concurrently under development, may need to derive a variant per type parameterization of the struct.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.