News for hackers. Stuff that matters.
Re:How I went about learning Rust by pjmlp on Friday July 15, 2022 @09:37AM (#32108040)
I will debate it is one, yes.

Just like being an FP language isn't "like Haskell does it", when I learned FP, Haskell didn't even exist.

Try to express Eiffel, CLOS, SELF or BETA in Java.

By the way, here is One Weekend Raytracing in Rust, perfectly using OOP with dynamic dispatch and interfaces (sorry traits).

https://github.com/pjmlp/RaytracingWeekend-Rust

Re:How I went about learning Rust by Ygg2 on Friday July 15, 2022 @12:43PM (#32110061)
Ok. But noticed what I said. *Things* that are easy in one OOP should be similarily easy to express in other OOP language.

Counter example: Html5 DOM.

Re:How I went about learning Rust by pjmlp on Friday July 15, 2022 @02:35PM (#32111379)
Counter example of what?

A graph representation of nodes based on JavaScript object model?

Fine, https://rustwasm.github.io/docs/wasm-bindgen/examples/dom.ht...

Re:How I went about learning Rust by Ygg2 on Saturday July 16, 2022 @09:26AM (#32117818)
Yeah but if you dig deeper you'll notice it is riddled with unsafe, casts and Deref misuse.

It's a brittle simulation of Inheritance. To transform a saying "Just because you can write Ada in C, doesn't make C Ada".

Re:How I went about learning Rust by Ygg2 on Saturday July 16, 2022 @10:44AM (#32118638)
Post Scriptum: one way to prove this is that we could use https://www.youtube.com/watch?v=43XaZEn2aLc as a base.

How to prove.

Assume that we add struct inheritance to Rust (it looks similar to JS) - call it RustInh.

Does adding inheritance to Rust increase expressive power? If yes, then right now Rust can't express OOP concept as inheritance. I.e. is there a C[RustInh] = C[Rust].

And way to prove it is to look at Deref anti-patterns https://github.com/rust-unofficial/patterns/blob/main/anti_p...

I'm still not sure that fully captures my intuition of easy to write.