There's no Hardware Design Language for rustaceans and I wish there was
(Yes, this is me trying to invoke Cunningham's Law, sorry.)
But seriously, I there is such a language, I haven't found it.
The magic formula that makes Rust amazing to work with has many ingredients. Many of these ingredients feed into each other, eg:
- A very clean import system
- A very straightforward package manager.
- A standard way to run a project immediately after cloning it.
- A standard way to run tests.
- A standard way to write tests.
- First-class error handling.
- Pattern-matching.
if let,let else,forloops.- Rules around mutability which make it really clear what a given part of a code can or can't do.
- A trait system that makes it easy to describe complex abstractions checked before monomorphization.
I'm trying to get into HDLs (Hardware Design Languages, languages that describe a virtual circuit) and I miss a lot of the features I just listed.
These languages feel alien, with a lot of what seems like accidental complexity, where clock edges can trigger rules that trigger other rules that trigger other rules, that can change registers in arbitrary sequential ways that nevertheless get compiled to parallel circuits...
I'm doing a bad job of describing it. It feels like the language I've seen try to accommodate engineers thinking in terms of imperial or object-oriented programming, with modules sending messages to each-other, modifying state, applying sequences of changes to internal state, etc. None of them feel like they're really trying to model what the hardware really does through functional programming.
I wish there was an equivalent of Rust for HDLs, a language with modern syntax and a batteries-included toolchain for running tests, linting programs, simulating hardware, etc. So far I've looked at SytemVerilog and Bluespec and LLHD and few others and have found none of them satisfying. RustHDL shows some promise, but is still very immature and unstable.
What's your experience with HDL toolchains? Do you know of any with a developer experience similar to Rust's?