loading...

re: Zero-overhead interface exploration in Nim language VIEW POST

TOP OF THREAD FULL DISCUSSION
re: hey, great post the thing about Nim is that since it isn't strictly object oriented, interfaces aren't really necessary, as it separates functi...
 

Thanks for your comments!

 

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.

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...

Code of Conduct Report abuse