5 ms·
> Which parts of Rust would you give up to make this happen? And how would this be implemented? Traits, maybe? Switch to an OO model more closely aligned to w
by lelanthran 4y ago
> Which parts of Rust would you give up to make this happen? And how would this be implemented?
Traits, maybe? Switch to an OO model more closely aligned to what the majority of developers understand. Dump all of the line-noise-type syntax.
My Own Toy Language (ComingRealSoonNow)^tm that I started designing had exactly one goal - prevent the majority of memory errors, not prevent ALL memory errors. All I wanted was to indicate when/where an object will be destroyed/mutated. That's enough for me.
- pjmlp 4y agoActually something like traits (as concept) is what powers COM, WinRT, the basis of Objective-C protocols that influenced interfaces in more common OOP languages. Also the basis for one programming language that used to be widespread in the enterprise for quick and dirty solutions, VB and its ecosystem of OCX libraries. It is more widespread that people think, because when many argue about OOP, they miss the full spectrum of how OOP is approached.
- NoGravitas 4y agoTraits seem, to me, a lot like generic functions and methods in CLOS (Common Lisp). It's just that CLOS doesn't bundle a group of generic functions into a trait, they're a la carte.
- pjmlp 4y agoYes they do, they are called protocols.
- lelanthran 4y ago> Actually something like traits (as concept) is what powers COM, WinRT, the basis of Objective-C protocols that influenced interfaces in more common OOP languages. So? Giving up Rust-Traits doesn't mean that I will give up on interfaces as a whole. I don't like the way C++ does interfaces, for example, but that doesn't mean that my ideal language won't have interfaces.
- jules 4y agoTraits are the one part of Rust that should definitely not be given up. It is way better than the traditional OO model.