Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Eric Reed
I think the 'new(place) expr' or 'box(place) expr' is pretty confusing syntax. To me, it's not at all clear that new(varA) varB means eval varB and put it into varA instead of eval varA and put it into varB. I'd much prefer syntax that makes it very clear which is the expression and which is the

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Ziad Hatahet
On Mon, Dec 2, 2013 at 12:43 AM, Eric Reed ecr...@cs.washington.edu wrote: In either case, I think keeping ~ as sugar for allocating on the exchange heap would be nice (i.e. ~expr is sugar for ~expr in Unique or put expr in Unique). `box expr in place` reads nicely too. I don't know about

Re: [rust-dev] do

2013-12-02 Thread Alex Bradbury
On 1 December 2013 03:54, Daniel Micay danielmi...@gmail.com wrote: I don't understand the point of `do` beyond making zero-parameter closures look a bit better. If it doesn't even do that, why bother? If an editor isn't indenting it properly, that's an editor issue. As far as I can tell, the

Re: [rust-dev] do

2013-12-02 Thread Gaetan
if do makes the code more readable or more beautiful, I higly recommend keeping this sugar syntax. If there are corner cases where do doesn't do the job, the developer should not use it in these cases. It's still the same debat, when GIMP had this ugly multi panels system, developers was saying

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Eric Reed
I don't think it introduces any ambiguity. The optional in is similar to the optional else in if. I'm pretty sure this grammar would suffice: alloc_expr : ~ expr in_tail ? ; in_tail : in expr ; The expr of in_tail would need to be considered a 'place' (some sort of trait I assume) by the

Re: [rust-dev] This Week in Rust

2013-12-02 Thread Liigo Zhuang
great work 2013/12/1 Corey Richardson co...@octayn.net Welcome to another issue of *This Week in Rust*, a weekly newsletter summarizing Rust's progress and community activity. As always, if you have something you'd like to be featured, just [send me an

[rust-dev] Can traits define instance vars?

2013-12-02 Thread jeti789
Hello, I lately had a look at Rust and really liked it in many ways. Rust has really everything Im missing in Go ;-). There is something about traits I would like to ask I cant see from the manual. Question is whether you define instance variables in traits or abstract variables like Ceylon and

Re: [rust-dev] Can traits define instance vars?

2013-12-02 Thread Eric Reed
Hi Oliver, Glad you're liking Rust so far :) Currently traits can only have methods (functions that have a self parameter) and associated functions (functions without a self parameter). There's a proposal to add inheritance on structs to Rust, which would allow a trait to extend a struct and

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Kevin Ballard
I think `box expr in place` is unnecessarily verbose. I also don't think `box(place) expr` will be confusing in practice, because it will presumably look something like `box(Gc) expr`, which should be pretty obvious that Gc is how it's being boxed, not what's being boxed. -Kevin On Dec 2,

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Kevin Ballard
With @ going away another possibility is to leave ~ as the normal allocation operator and to use @ as the placement operator. So ~expr stays the same and placement looks either like `@place expr` or `expr@place` -Kevin Ballard ___ Rust-dev mailing

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Eric Reed
This is my new favorite idea, especially expr@place. It's concise. It reads expr at place, which is exactly what it does. It goes along with Rust's putting the type after the value. expr in place could be good too. On Mon, Dec 2, 2013 at 2:57 AM, Kevin Ballard ke...@sb.org wrote: With @ going

Re: [rust-dev] Can traits define instance vars?

2013-12-02 Thread spir
On 12/02/2013 11:12 AM, jeti...@web.de wrote: Hello, I lately had a look at Rust and really liked it in many ways. Rust has really everything I'm missing in Go ;-). There is something about traits I would like to ask I can't see from the manual. Question is whether you define instance variables

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread spir
On 12/02/2013 09:43 AM, Eric Reed wrote: I think the 'new(place) expr' or 'box(place) expr' is pretty confusing syntax. To me, it's not at all clear that new(varA) varB means eval varB and put it into varA instead of eval varA and put it into varB. I'd much prefer syntax that makes it very clear

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread spir
On 12/02/2013 11:57 AM, Kevin Ballard wrote: With @ going away another possibility is to leave ~ as the normal allocation operator and to use @ as the placement operator. So ~expr stays the same and placement looks either like `@place expr` or `expr@place` I like that, with expr@place. Does

Re: [rust-dev] Error casting to trait: value may contain borrowed pointers

2013-12-02 Thread Felix S. Klock II
rust-dev- In general, we need to ensure that for an expression `source as target` that any borrowed pointers in the type of source are not obscured [1] by the cast. A collection of conditions sufficient to enforce this are listed in a comment in librustc/middle/kind.rs that I think is

Re: [rust-dev] Rust forum

2013-12-02 Thread David Piepgrass
Hey, why not set up a Discourse forum? That would be so. much. better. than a mailing list. As an OSS dev I've been itching to get one myself, but don't have time or much money to set it up. For Mozilla, though? No problem I'm sure. http://www.discourse.org/ Google: discourse hosting.

Re: [rust-dev] Rust forum

2013-12-02 Thread Simon Sapin
On 02/12/2013 16:21, David Piepgrass wrote: That would be so. much. better. than a mailing list. Hi. Could you expand on this? I don’t necessarily disagree, but as the one proposing change it’s up to you to convince everyone else :) -- Simon Sapin

Re: [rust-dev] Rust forum

2013-12-02 Thread Paul Nathan
On 12/2/13 8:21 AM, David Piepgrass wrote: Hey, why not set up a Discourse forum? That would be so. much. better. than a mailing list. As an OSS dev I've been itching to get one myself, but don't have time or much money to set it up. For Mozilla, though? No problem I'm sure.

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Kevin Ballard
What do you mean? This suggestion uses @ as an operator, not as a sigil. -Kevin On Dec 2, 2013, at 10:23 AM, Patrick Walton pwal...@mozilla.com wrote: Anything with @ feels like it goes too close to pointer sigils for my taste. Patrick spir denis.s...@gmail.com wrote: On 12/02/2013

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Eric Reed
But it's nothing like a pointer sigil. @ doesn't appear in the types at all. It's just the placement allocation operator. On Mon, Dec 2, 2013 at 10:23 AM, Patrick Walton pwal...@mozilla.com wrote: Anything with @ feels like it goes too close to pointer sigils for my taste. Patrick spir

Re: [rust-dev] Rust forum

2013-12-02 Thread spir
On 12/02/2013 07:15 PM, Kevin Ballard wrote: Personally, I’ve never met a forum that I cared for. Mailing lists are nice. I second the idea of a rust-users ML. Same for me. denis ___ Rust-dev mailing list Rust-dev@mozilla.org

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Eric Reed
I think the idea was to have the syntax desugar into method calls just like other existing operators. There'd be a trait like: trait BoxT { fn box(val: T) - Self } and something like box expr in place would desugar into place::box(expr). One question this poses is why are we requiring the

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Erick Tryzelaar
Is there any way we can use a method and move semantics for this? This feels pretty natural to me: let foo = gc_allocator.box(bar); On Mon, Dec 2, 2013 at 10:23 AM, Patrick Walton pwal...@mozilla.com wrote: Anything with @ feels like it goes too close to pointer sigils for my taste.

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Patrick Walton
Still too punctuation heavy. Kevin Ballard ke...@sb.org wrote: What do you mean? This suggestion uses @ as an operator, not as a sigil. -Kevin On Dec 2, 2013, at 10:23 AM, Patrick Walton pwal...@mozilla.com wrote: Anything with @ feels like it goes too close to pointer sigils for my taste.

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Patrick Walton
That would require an unnecessary move. It needs to be built into the language. Eric Reed ecr...@cs.washington.edu wrote: I think the idea was to have the syntax desugar into method calls just like other existing operators. There'd be a trait like: trait BoxT { fn box(val: T) - Self } and

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread comex
On Mon, Dec 2, 2013 at 2:33 PM, Patrick Walton pwal...@mozilla.com wrote: That would require an unnecessary move. It needs to be built into the language. Devil's advocate - aren't such unnecessary moves really easy for LLVM to optimize? ___ Rust-dev

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Patrick Walton
Besides, unless you remove the unique default (which I think would be too verbose) the default allocator reduces to a pointer sigil. Patrick Walton pwal...@mozilla.com wrote: Still too punctuation heavy. Kevin Ballard ke...@sb.org wrote: What do you mean? This suggestion uses @ as an operator,

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Patrick Walton
Only if you SROA and inline the constructor, I think. comex com...@gmail.com wrote: On Mon, Dec 2, 2013 at 2:33 PM, Patrick Walton pwal...@mozilla.com wrote: That would require an unnecessary move. It needs to be built into the language. Devil's advocate - aren't such unnecessary moves really

Re: [rust-dev] Rust forum

2013-12-02 Thread Benjamin Striegel
I'm not sure that discussion forums are the best alternative to the typical foo-users mailing list. Topics are generally less about discussion and more about getting a quick answer to a problem; IRC is okay for this at the moment, but once Rust stabilizes I'd much prefer just using StackOverflow

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Kevin Ballard
~ would still be the unique default. @ would require a place (because there's no placement without a place). Just because C++ uses the same operator for regular allocation and for placement doesn't mean we have to do the same. As it's been pointed out already, C++'s use of `new` for placement

Re: [rust-dev] Placement new and the loss of `new` to keywords

2013-12-02 Thread Eric Reed
And @ even makes sense for what it's doing (placing something at somewhere) when compared with most operators. On Mon, Dec 2, 2013 at 12:04 PM, Kevin Ballard ke...@sb.org wrote: ~ would still be the unique default. @ would require a place (because there's no placement without a place). Just

Re: [rust-dev] RFC: Put Unicode identifiers behind a feature gate

2013-12-02 Thread Kevin Cantu
When I started my old Rust PPA (now superseded), the first user to email me was an engineer from China who was getting ready to give a talk introducing Rust to a programming user group in Guǎngzhōu bigger than any of the Rust-specific meetups we've ever had yet in the San Francisco Bay area.

Re: [rust-dev] RFC: Put Unicode identifiers behind a feature gate

2013-12-02 Thread Corey Richardson
The compiler still handles it, and there are still tests for it. I think it's more of a not 1.0 priority, than anything else. On Mon, Dec 2, 2013 at 11:31 PM, Kevin Cantu m...@kevincantu.org wrote: When I started my old Rust PPA (now superseded), the first user to email me was an engineer from

Re: [rust-dev] Rust forum

2013-12-02 Thread David Piepgrass
On 02/12/2013 16:21, David Piepgrass wrote: That would be so. much. better. than a mailing list. Hi. Could you expand on this? I don?t necessarily disagree, but as the one proposing change it?s up to you to convince everyone else :) -- Simon Sapin Okay, well, I've never liked mailing

Re: [rust-dev] Rust forum

2013-12-02 Thread Eric Reed
Well there's always r/rust/ http://www.reddit.com/r/rust/. It usually works pretty well. On Mon, Dec 2, 2013 at 9:45 PM, David Piepgrass qwertie...@gmail.comwrote: On 02/12/2013 16:21, David Piepgrass wrote: That would be so. much. better. than a mailing list. Hi. Could you expand on