I was able to use casting pointer (rather unsafely I believe) for some dependency injection, but that's only because it relies on the builder being defined inline to the shape: https://github.com/mattsah/mininim-core/blob/main/src/mininim/dic.nim Used here: https://github.com/mattsah/mininim-cli/blob/main/src/mininim/cli.nim