hoodlum
hoodlum copied to clipboard
Keywords "def" and "def mut"
This issue is for bikeshedding keywords.
"def" is introduced as an analog for "wire" in Verilog, albeit more strictly typed (no latches should be inferred when using this). The term "def" for definition is used instead of "let" because we don't lexically scope the variable definition; instead it is referencable by the entire entity.
"def mut" is analogous to "reg" in Verilog, and is meant to draw a similarity to Rust's "mut" declaration. This means that a latch will be generated (if necessary) for the variable, and it can only be assigned using nonblocking "<=" or blocking ":=" operators inside of an on <expr> { ... }
block.
"def" for defining a static declaration isn't my favorite; "static" would be nice, but is fairly verbose. "mut" I am more comfortable with, though it means something different in Rust and HDL, since the guarantees by either feel similar.
Coming from python, "def" makes me think it's a function. What is wrong with "wire"?