[rust-dev] map example from the tutorial and copy

2013-10-24 Thread Igor Bukanov
Here is the map example from the tutorial, http://static.rust-lang.org/doc/master/tutorial.html#generics , fn mapT, U(vector: [T], function: fn(v: T) - U) - ~[U] { let mut accumulator = ~[]; for element in vector.iter() { accumulator.push(function(element)); } return

Re: [rust-dev] writing file

2013-10-24 Thread Alex Bradbury
On 24 October 2013 01:01, Alex Crichton a...@crichton.co wrote: We're entertaining the idea of removing conditions, so the `writeln!` macro and related `write!` functions will probably all return a `Result(), ~Error` or whatever the generic error type becomes. Just from the IO module, or the

Re: [rust-dev] On Stack Safety

2013-10-24 Thread Benjamin Striegel
you do compete with Go (4 kB initial stack segment) and Erlang (2.4 kB on 64 bit). Actually, goroutines have a default stack size of 8kb since 1.2. Also, applicable to this discussion, in 1.3 Go will be moving away from segmented stacks to contiguous growable stacks:

Re: [rust-dev] writing file

2013-10-24 Thread Steve Klabnik
Conditions don't require language support, IIRC, they're just a library. So even if they were totally removed, you could still use them. ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Mozilla hiring a research engineer to work on Rust

2013-10-24 Thread David Piepgrass
Mozilla is going to hire another engineer to work on Rust! As we head toward Rust 1.0 we are looking for a motivated individual with serious chops to help us grind through the remaining blocking bugs. Enthusiasm for Servo will also be looked upon with great favor. See all the gory details

Re: [rust-dev] Mozilla hiring a research engineer to work on Rust

2013-10-24 Thread Kevin Cantu
Hiring is hard. Their lawyers aren't going to let a Mozilla employee comment publicly. Send me (off the mailing list) what you sent them and I can give you my two cents of advice, privately, if you want! Kevin On Oct 24, 2013 8:19 AM, David Piepgrass qwertie...@gmail.com wrote: Mozilla is

Re: [rust-dev] On Stack Safety

2013-10-24 Thread Matthieu Monrocq
On Thu, Oct 24, 2013 at 4:18 PM, Benjamin Striegel ben.strie...@gmail.comwrote: you do compete with Go (4 kB initial stack segment) and Erlang (2.4 kB on 64 bit). Actually, goroutines have a default stack size of 8kb since 1.2. Also, applicable to this discussion, in 1.3 Go will be moving

Re: [rust-dev] On Stack Safety

2013-10-24 Thread Patrick Walton
On 10/24/13 9:12 AM, Matthieu Monrocq wrote: On Thu, Oct 24, 2013 at 4:18 PM, Benjamin Striegel ben.strie...@gmail.com mailto:ben.strie...@gmail.com wrote: you do compete with Go (4 kB initial stack segment) and Erlang (2.4 kB on 64 bit). Actually, goroutines have a default

Re: [rust-dev] Rust on Xen

2013-10-24 Thread Brian Anderson
On 10/23/2013 08:47 PM, Thad Guidry wrote: THIS Anvil ? -- http://anvil.readthedocs.org/en/latest/topics/summary.html I was referring to Anil Madhavapeddy, one of the authors of OpenMirage, a system for creating unikernels that run on Xen. ___

Re: [rust-dev] On Stack Safety

2013-10-24 Thread David Rajchenbach-Teller
I am curious. Isn't the stack a very simple region? Couldn't region inference be used to solve pointer-to-stack problems? Or do I completely misunderstand the definition of pointer-to-the-stack? On 10/24/13 6:12 PM, Matthieu Monrocq wrote: This is an interesting move, however the

Re: [rust-dev] map example from the tutorial and copy

2013-10-24 Thread Igor Bukanov
On 24 October 2013 16:23, Corey Richardson co...@octayn.net wrote: It's not necessary for U because there are no clones here, only moves. Thanks, I missed the difference between move and copy here. I wonder is it possible to avoid any move at all? In C++ a push-like method can allocates storage

Re: [rust-dev] map example from the tutorial and copy

2013-10-24 Thread Igor Bukanov
Does it imply that in Rust any type can be moved even the one that have custom destructor? Thus it is not possible to have, for example, a stack-allocated struct that reference itself via a pointer? On 24 October 2013 16:23, Corey Richardson co...@octayn.net wrote: It's not necessary for U

Re: [rust-dev] map example from the tutorial and copy

2013-10-24 Thread Daniel Micay
On Thu, Oct 24, 2013 at 3:33 PM, Igor Bukanov i...@mir2.org wrote: Does it imply that in Rust any type can be moved even the one that have custom destructor? Thus it is not possible to have, for example, a stack-allocated struct that reference itself via a pointer? Every value can be moved,

Re: [rust-dev] map example from the tutorial and copy

2013-10-24 Thread Patrick Walton
On 10/24/13 12:27 PM, Igor Bukanov wrote: On 24 October 2013 16:23, Corey Richardson co...@octayn.net wrote: It's not necessary for U because there are no clones here, only moves. Thanks, I missed the difference between move and copy here. I wonder is it possible to avoid any move at all? In

[rust-dev] 11/20 Rust Bay Area Meetup: SprocketNES

2013-10-24 Thread Erick Tryzelaar
Hey everyone! I'm happy to announce our next Rust Bay Area meetup! On November 20th at 7pm, Patrick Walton will be giving a presentation about his Nintendo emulator SprocketNES. This meetup will be held at the Mozilla San Francisco office at 2 Harrison St. Dinner and drinks will be provided by

Re: [rust-dev] Ideas for academic/research work related to Rust and formal verification

2013-10-24 Thread Tim Chevalier
Hi, Ilmārs -- One of the things we're hoping to do is a type safety proof for a subset of Rust. Because machine-checked proofs are so labor-intensive (and it's almost impossible to appreciate just how labor-intensive until you try a proof for an even slightly realistic language), the usual

Re: [rust-dev] On Stack Safety

2013-10-24 Thread Ben Kloosterman
Yes its a simple region but region analysis is normally compile time while this is runtime..knowing the pointer points to the stack doesnt help . If you copy in a new stack you need to know every pointer to that stack if you move it to a new location .. Copying GCs do this all the time but they

Re: [rust-dev] On Stack Safety

2013-10-24 Thread Patrick Walton
On 10/24/13 6:13 PM, Ben Kloosterman wrote: Yes its a simple region but region analysis is normally compile time while this is runtime..knowing the pointer points to the stack doesnt help . If you copy in a new stack you need to know every pointer to that stack if you move it to a new location

Re: [rust-dev] On Stack Safety

2013-10-24 Thread Brian Anderson
On 10/24/2013 06:16 PM, Patrick Walton wrote: On 10/24/13 6:13 PM, Ben Kloosterman wrote: Yes its a simple region but region analysis is normally compile time while this is runtime..knowing the pointer points to the stack doesnt help . If you copy in a new stack you need to know every