Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It worked alright for Rust, and yes Rust does support OOP, there are many meanings to what is OOP from CS point of view.

I have ported Ray Tracing in One Weekend into Rust, while keeping the same OOP design from the tutorial, and affine types were not an impediment to interfaces, polymorphism and dynamic dispatch.



I don't think it worked well for Rust - in fact one of the core issues of Rust imo, is that it somewhat encourages this OOP style which can cause major headaches when you design an app in a traditional OO way - object compostion, complex and stateful, non-copyable objects full of 'smart' behavior, necessitating clones, and state that needs to be reconciled.

The whole concept of OOP is a major conceptual regression in how it treats aliasing, which is a major headache for compiler writers, necessitating either whole program analysis or JIT like techniques.


Hardly any different from structs with function pointers that are so praised among C and Zig devs.




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

Search: