Re: [rust-dev] Rust and object capabilities?

2014-07-03 Thread David Renshaw
Perhaps relevant: Cap'n Proto's RPC protocol http://kentonv.github.io/capnproto/rpc.html aims to be a cross-language distributed-object-capability system, and I have been working on a Rust implementation https://github.com/dwrensha/capnproto-rust. On Thu, Jul 3, 2014 at 2:09 AM, Rob Meijer

[rust-dev] capnproto-rust: performance and safety compared to C++

2013-11-17 Thread David Renshaw
Hi everyone. I wrote up some of my latest experiences implementing Cap'n Proto encoding for Rust. A performance comparison to C++, or capnproto-rust is pretty fast: http://dwrensha.github.io/capnproto-rust/2013/11/16/benchmark.html A discussion of safety, or why I'm so keen to see support for

Re: [rust-dev] capnproto-rust: performance and safety compared to C++

2013-11-17 Thread David Renshaw
The asReader() methods are also doing more work than necessary. To address that, I think I'll first need to get the lifetime parameter situation sorted out. On Sun, Nov 17, 2013 at 4:49 PM, Huon Wilson dbau...@gmail.com wrote: On 18/11/13 06:30, David Renshaw wrote: Hi everyone. I wrote

Re: [rust-dev] Trait method self parameter type clashes with lifetime annotation required by the implementation

2013-09-28 Thread David Renshaw
If I add an unused parameter of type Option'self () to the walk() method, I can get your example to compile: https://gist.github.com/dwrensha/29ed998566e2f9218c18 On Sat, Sep 28, 2013 at 4:42 PM, Vladimir Matveev dpx.infin...@gmail.com wrote: Hi all, The problem I'm writing about in this

Re: [rust-dev] Trait method self parameter type clashes with lifetime annotation required by the implementation

2013-09-28 Thread David Renshaw
If I drop the unused parameter, I get an internal compiler error: 'assertion failed: self.variance.is_some()' ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

[rust-dev] 'self in static trait methods (issue 7331)

2013-09-24 Thread David Renshaw
Hello, I have been thinking about how to fix issue 7331 (https://github.com/mozilla/rust/issues/7331), because I think that something like the `Constructable` trait is going to be important for capnproto-rust (https://github.com/dwrensha/capnproto-rust). I've managed to find a one-line change

[rust-dev] instantiating parameterized impls

2013-09-05 Thread David Renshaw
Hi, When I try to compile the below program, why do I get a conflicting implementations error? I do not define any implementations of Bar, so the parameterized impl of Foo should never get instantiated, right? --- trait Foo { fn foo() - Self; } trait Bar : std::num::Zero {

Re: [rust-dev] Cap'n Proto and region variables

2013-07-24 Thread David Renshaw
(self_r=None, self_ty=Some(BUG[0]), tps=[]) On Wed, Jul 24, 2013 at 9:09 AM, Niko Matsakis n...@alum.mit.edu wrote: On Sun, Jul 21, 2013 at 12:44:24PM -0400, David Renshaw wrote: Hello everyone, I'm playing around with a Rust implementation for Cap'n Proto. Check it out: http://github.com/dwrensha

[rust-dev] Cap'n Proto and region variables

2013-07-21 Thread David Renshaw
Hello everyone, I'm playing around with a Rust implementation for Cap'n Proto. Check it out: http://github.com/dwrensha/capnproto-rust . I welcome any comments or contributions. The reason I'm sharing this project with you now is I'd like to ask about a language feature missing from Rust that I

Re: [rust-dev] cross-file trait impls

2013-06-24 Thread David Renshaw
Thanks. For the sake of completeness, here is the fixed version: test-crate.rc mod file1; mod file2; fn main() { file1::bar(); } -- file1.rs use file2::HasInt; struct X { x : int } impl HasInt for X { fn foo(self) - int { self.x } } pub fn

[rust-dev] cross-file trait impls

2013-06-23 Thread David Renshaw
Hello, I have a question that may be related to Ashish's recent questions. I was trying to compile the below files and I discovered, unexpectedly, that one fix is to add the line use file1::file2::*; at the top of test-crate.rc. Can someone clarify what's going on here? Is there a fix that