Skip to content

[enhancement] Support generics in DSLX #3345

@richmckeever

Description

@richmckeever

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.
  3. Handle colon refs through T, like T::SOME_CONST, T::static_fn(), foo<T::some_alias>().
  4. Fix any cross-module issues.
  5. #[derive(ToBits)], concurrently under development, may need to derive a variant per type parameterization of the struct.

Metadata

Metadata

Assignees

Labels

dslxDSLX (domain specific language) implementation / front-endenhancementNew feature or request

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions