[rust-dev] "Virtual fn" is a bad idea

Maciej Piechotka uzytkownik2 at gmail.com
Tue Mar 11 14:15:58 PDT 2014


On Tue, 2014-03-11 at 13:44 -0700, Patrick Walton wrote:
> On 3/11/14 1:42 PM, Daniel Micay wrote:
> > Existing object systems like COM, DOM and gobject are worth looking at,
> > but Rust shouldn't bend over backwards to support them. They're legacy
> > technologies and while interacting with them is important, I don't think
> > it should result in any extra complexity being added to Rust.
> 
> We have to support the technologies that are in use in a pleasant way, 
> or else Rust will not be practical. Regardless of your feelings about 
> existing OO systems, Rust has to support them well.
> 
> So far nobody in this thread has demonstrated an understanding of the 
> constraints here. Traits are simply not sufficient to model the DOM, for 
> example.
> 
> Patrick
> 
> 

Could you elaborate on DOM? I saw it referred a few times but I haven't
seen any details. I wrote simple bindings to libxml2 dom
(https://github.com/uzytkownik/xml-rs - warning - I wrote it while I was
learning ruby) and I don't think there was a problem of OO - main
problem was mapping libxml memory management and rust's one [I gave up
with namespaces but with native rust dom implementation it would be
possible to solve in nicer way]. Of course - I might've been at too
early stage.

Regarding existing OO systems - Haskell interops with few of them (like
gtk+ for example) using typeclasses without problems I know of. Possible
next stage would be modelling the same hierarchy but since most systems
use multiple inheritance in one form or another it would not help much.

Best regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140311/7b032787/attachment.sig>


More information about the Rust-dev mailing list