I collected a couple of these solutions a while ago, There's https://github.com/mratsim/trace-of-radiance/blob/99f7d85d/trace_of_radiance/support/emulate_classes_with_ADTs.nim
Then on nimble https://nimble.directory/pkg/interfaced https://nimble.directory/pkg/shene And https://nimble.directory/pkg/protocoled