Re: [rust-dev] Daemonizing a process

2014-07-15 Thread Gulshan Singh
Alex Crichton helped me figure out a solution: use std::io::Command; use std::os; use std::io::timer::sleep; fn main() { let args = os::args(); if args.len() == 1 { let child = Command::new(args.get(0).as_slice()) .arg(child) .detached().spawn().unwrap();

Re: [rust-dev] Daemonizing a process

2014-07-15 Thread Ilya Dmitrichenko
Sure, traditional deamons don't have stdio. You will need to write to a log file and then also care about how that file is being rotated etc. Traditionally daemons have a signal handle that execution reopening of logs... You will also need to write an init script to actually start it. What I

Re: [rust-dev] C++ to Rust - Is that about right?

2014-07-15 Thread Steve Klabnik
You shouldn't return a BoxT unless you have to: box does placement new, so by not doing it yourself, you give them options: struct Point { x: int, y: int, } impl Point { fn bad_new() - BoxPoint { box Point { x: 1, y: 1 } } fn good_new() - Point { Point { x:

Re: [rust-dev] C++ to Rust - Is that about right?

2014-07-15 Thread Masklinn
On 2014-07-15, at 13:51 , Steve Klabnik st...@steveklabnik.com wrote: let z = box(std::gc::Gc) Point::good_new(); // this is a GcPoint, with no copy. } Unless that's changed in 0.11, IIRC that should be box(std::gc::GC). Which remains weird and annoying, is there any plan to drop the

Re: [rust-dev] C++ to Rust - Is that about right?

2014-07-15 Thread Steve Klabnik
Whoops, yes, it was just a typo. ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] C++ to Rust - Is that about right?

2014-07-15 Thread Andrew Poelstra
On Tue, Jul 15, 2014 at 5:25 AM, Christoph Husse thesaint1...@googlemail.com wrote: Further I notices that they often seem to mix test and production code which is also strange to me. For instance with test driven development you have tons of problems with that approach. Only mentioning a

[rust-dev] 7/31 SF Bay Area Meetup

2014-07-15 Thread Erick Tryzelaar
Hello Oxidizers! I'm pleased to announce the next Bay Area Rust Meetup on Thursday July 31, 2014, at Hack Reactor in San Francisco. Sign up here to attend: http://www.meetup.com/Rust-Bay-Area/events/181256992/ This meetups theme is based on the amazing work at building Rust's web