Re:My experience crafting an interpreter with Rust (2021)
by mamcx on Saturday March 25, 2023 @10:19PM
(#35310038)
I think a bigger one from what I have looked is the complexity of (en^de)code bytes around.
I suspect if you could use UNION better and be the same as Enum in Rust you could do us a favor! Also I wish I could do this easily:
enum Tag {
Int,
Bool
}
enum Data {
Int(Vec<i32>),
Bool(Vec<bool>)
}
struct Val {
tag:Tag,
data:Data
}
let n = val.as_i32::<Tag::Int>(&self) -> Vec<i32>
I suspect if you could use UNION better and be the same as Enum in Rust you could do us a favor! Also I wish I could do this easily: