DEV Community

Discussion on: Zero-overhead interface exploration in Nim language

Collapse
shirleyquirk profile image
shirleyquirk • Edited on

Just seen this:
nimble.directory/pkg/interfaced
I think it provides the semantics you are looking for, really cleanly.
Works by creating a vtable under the hood, just like other oo languages do.

Pretty crazy that Nims macro system makes it possible to add such a feature to the language.

Thread Thread
xflywind profile image
flywind Author

Thanks!

Thread Thread
shirleyquirk profile image
shirleyquirk

Oh man, they just keep coming:
This hidden gem is undocumented, but provides the same functionality without the overhead of a vtable.

github.com/mratsim/trace-of-radian...