I want to have basic drop-in components, I'm making a sort of incredibly simplified LLVM clone that works equally well as a compiler and as a decompiler and I want to take in something that will generate my IR from bytecode
My first thought was to take in a function that returned what I wanted, then I thought for a bit and got the idea to make a trait which forced you to have a serialize and deserialize function, but now I'm thinking I don't like the idea of making consumers make a class and that I want to make it use functions again
I'm stuck, any opinions and insight would be nice, would you rather make a class or would you rather pass in a function?