Hacker News new | past | comments | ask | show | jobs | submit login

Nim actually does support inheritance though, so you could have just used that with methods. Though I can understand if you wanted to avoid inheritance.



That's true. I think my problem was that I was trying to be to clever and trying to make something like SmartPtr[TButton] have the same inheritance like ptr TButton. If I would have "wrapped" everything in native Nim classes it would have been fine. OTOH, I think there is no equivalent to an interface in Nim, so that would not work in that case.

I'm not saying Nim is deficient, in fact it is one of the most expressive and productive languages I know. But there are subtle difference between object models in different languages that make GUI programming hard, and I think that is one reason many people don't use modern languages but stay on C++/C# or throw there hands up in the air and just use Electron...


Yeah, tbh I think lack of interfaces is one of the biggest misses in Nim.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: