samitbasu / rust-hdl

A framework for writing FPGA firmware using the Rust Programming Language
Other
325 stars 17 forks source link

Support Sum Types #23

Open ThePerfectComputer opened 1 year ago

ThePerfectComputer commented 1 year ago

Both Clash HDL and Bluespec have support for sum types. If rust-hdl could have sum types, where a register could simply be sized to hold the largest variant of the sum type - that could be a huge productivity boon in terms of designing things like decoders.

I do see this, perhaps that's where one could begin to work towards implementing sum types?

ThePerfectComputer commented 1 year ago

They're a particular team at a well known company that may be able to use RustHDL in production. I do think however that Sum Types could really help.

samitbasu commented 1 year ago

That is a good point. I never thought of them for hardware designs. But I don't see a priori why you could not add them. There is already the notion of both enums and structs. I will work on some concepts. Thanks for the suggestion!