logoalt Hacker News

9rxtoday at 3:12 AM1 replyview on HN

> Rust has straightforward support for every part of OOP other than implementation inheritance

Except the only thing that makes OOP OOP: Message passing.

Granted, Swift only just barely supports it, and only for the sake of interop with Objective-C. Still, Swift has better OO support because of it. Rust doesn't even try.

Not that OOP is much of a goal. There is likely good reason why Smalltalk, Objective-C, and Ruby are really the only OOP languages in existence (some esoteric language nobody has ever heard of notwithstanding).


Replies

zozbot234today at 3:18 AM

You just need to define a trait, then you can use dynamic dispatch.

show 1 reply