Re: [rust-dev] Conflicting implementations of a trait

2014-08-03 Thread Lionel Parreaux
Hi, I just stumbled upon your message, and that reminded me of something I had thought about. In Scala, type classes are interfaces, and type class instances are types implementing these interfaces. But the receiver type (the self type, the type of the instance), only serves to define operations,

Re: [rust-dev] Implementation of traits in Rust: could it be dynamic?

2014-07-27 Thread Lionel Parreaux
I see. Thanks for the links, Greg Morrisett's notes are a great survey of possible approaches to this problem. It is funny because I had also come to the conclusion that JIT was the neater solution, as long as JIT is available with the runtime... and you don't have to implement it -- I guess it's

Re: [rust-dev] Implementation of traits in Rust: could it be dynamic?

2014-07-24 Thread Lionel Parreaux
of dictionaries at runtime is actually appropriate for solving a real problem in Rust? Cameron On Jul 22, 2014, at 10:16 AM, Lionel Parreaux lionel.parre...@gmail.com wrote: Hi, So traits seem to be quite similar to Haskell's classes, being also used for parametric polymorphism. Now

[rust-dev] Implementation of traits in Rust: could it be dynamic?

2014-07-22 Thread Lionel Parreaux
Hi, So traits seem to be quite similar to Haskell's classes, being also used for parametric polymorphism. Now, Haskell classes are usually implemented using runtime dictionary passing. In general, code cannot be specialized for every function call, since there may be an unbounded number of