Hacker News new | ask | show | jobs
by remram 1965 days ago
Rust is not object-oriented.

You can make "virtual method" calls in Rust (dynamic dispatch through a "trait object", a vtable). This is explicit though, the type will look like `Box<dyn MyInterface>` where Java says `MyInterface` (box = object allocate on heap, dyn = virtual method calls).

I think you might be misunderstanding what "static method call" means: in this context, it means a method which is not "virtual" (in C++ parlance), not a method which is "static" (in C++ parlance, e.g. not called on an object).

1 comments

You're correct, I was assuming that "static" in Rust & Go meant the same thing it meant in Java (which is different than what it means in C, of course). Thank you for clarifying.