[rust-dev] Designing long-running subtasks

2014-06-04 Thread Paul Nathan
Hi, I'm designing a system which, for the purposes of the email, is a job/worker assignment queuing system (it's more nuanced than this, but this is what the approach is). Also, it's not just a "toy" system, I'd like to use it daily. Fundamentally, the task is as follows: The dispatcher receives

Re: [rust-dev] Bring Back Type State

2014-06-04 Thread Eric Reed
I'm not going to claim canonicity, but I used the type system to encode the socket state machine (see std::io::net::{tcp,udp}). TcpListener consumes itself when you start listening and becomes a TcpAcceptor. UdpSocket can "connect" (i.e. ignore messages from other sources) and become a UdpStream, w

Re: [rust-dev] Bring Back Type State

2014-06-04 Thread Cameron Zwarich
Is there a canonical example of encoding a state machine into Rust's substructural types? Cameron > On Jun 4, 2014, at 10:14 PM, Brian Anderson wrote: > > Thank you for your suggestion, but typestate is not coming back. There is no > room in the complexity budget for another major piece of ty

Re: [rust-dev] GADT

2014-06-04 Thread Cameron Zwarich
There are at least two tricky aspects to adding GADTs in Rust: 1) Rust implements parametric polymorphism via monomorphization (duplicating polymorphic functions for each type), but GADTs are really only useful with polymorphic recursion, which requires a polymorphic function to be applied to a

Re: [rust-dev] GADT

2014-06-04 Thread Evan G
I'm pretty sure closure*s are *on the list to be addressed before 1.0 See https://github.com/mozilla/rust/issues?milestone=20&page=1&state=open for a good idea of our roadmap is before 1.0 On Thu, Jun 5, 2014 at 12:09 AM, Suminda Dharmasena wrote: > Some features like 2 closure syntaxes is not

Re: [rust-dev] Bring Back Type State

2014-06-04 Thread Brian Anderson
Thank you for your suggestion, but typestate is not coming back. There is no room in the complexity budget for another major piece of type system, and linear types can serve much the same purpose. On 06/04/2014 10:11 PM, Suminda Dharmasena wrote: Hi, The initial Type State implementation in R

[rust-dev] Bring Back Type State

2014-06-04 Thread Suminda Dharmasena
Hi, The initial Type State implementation in Rust was not a great way to get about it. Please reconsider adding type state like it has been done in the Plaid language. Basically you can use traits mechanism to mixin and remove the trait when methods marked as having state transitions. Suminda P

Re: [rust-dev] GADT

2014-06-04 Thread Suminda Dharmasena
Some features like 2 closure syntaxes is not appealing for version 1.0 of the language. You should have a different way to specify capture. I send a mail reading this also. ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/r

Re: [rust-dev] GADT

2014-06-04 Thread Evan G
The thought-process is (as I know it) A) Taking things out is hard, and breaks code B) 1.0 should be stable, and supported without breakage for a long time C) Adding things is pretty easy, and doesn't break code D) A stable release should happen as soon as is reasonable, to get Rust used and tested

Re: [rust-dev] GADT

2014-06-04 Thread Suminda Dharmasena
Hi, My thinking is that not to be too premature to get to version 1.0. My feeling is that there are still quite a few areas where the language syntax and features can evolve before version 1.0 Suminda ___ Rust-dev mailing list Rust-dev@mozilla.org http

[rust-dev] 7 high priority Rust libraries that need to be written

2014-06-04 Thread Brian Anderson
Greetings, all. Looking for ways to have an impact on Rust? The current plan for Rust defers the creation of some key libraries until after Rust 1.0, but that doesn't mean we can't start on them now if the interest is out there. Here are 7 libraries that need to be created soon rather than lat

[rust-dev] How do I bootstrap rust form armhf?

2014-06-04 Thread Vladimir Pouzanov
I'm trying to run rustc on an arm board, but obviously there's no precompiled stage0 to build the compiler. Is there a procedure to cross-compile stage0 on other host machine where I do have rustc? -- Sincerely, Vladimir "Farcaller" Pouzanov http://farcaller.net/

Re: [rust-dev] How to kill a child task from parent?

2014-06-04 Thread Alex Crichton
Rust tasks do not support being killed at arbitrary points. You'll have to arrange ahead of time for a "please die" message to be sent a long a channel, or a similar scheme for transmitting this information. On Wed, Jun 4, 2014 at 9:33 AM, Aravinda VK wrote: > Hi, > > I am trying different altern

[rust-dev] How to kill a child task from parent?

2014-06-04 Thread Aravinda VK
Hi, I am trying different alternative to kill a task from parent, But I didn't get any ways to kill a task from its parent. In the following approach I started worker2 inside worker1 and worker1 from main. After 1000 miliseconds worker1 dies, but worker2 still continues. use std::io::timer::

Re: [rust-dev] GADT

2014-06-04 Thread Steve Klabnik
We'd love to have more advanced type system features (I'm looking forward to HKT myself), but the focus right now (seems to be) is cutting out everything that needs to be cut before 1.0. We can add neat new things after. ___ Rust-dev mailing list Rust-dev

[rust-dev] GADT

2014-06-04 Thread Suminda Dharmasena
Hi, It is great you have ADT but can you extend it to have GADTs? Suminda ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

[rust-dev] Closure Capture

2014-06-04 Thread Suminda Dharmasena
Hi, The Box is a welcome change over ~. Any way the closure syntax can improve. Instead of having 2 syntaxes be explicit of what is captured. let x = 3; fn fun_arg (arg: int) -> () { println!("{}", arg + x) } // cannot capturelet closure_arg = (arg: int)|x| -> () { println!("{}", arg +

Re: [rust-dev] syntax for explicit generics when calling static method

2014-06-04 Thread Igor Bukanov
Thanks, Testnew() works indeed. On 4 June 2014 09:52, Sebastian Gesemann wrote: > On Wed, Jun 4, 2014 at 9:28 AM, Igor Bukanov wrote: >> What is the syntax for calling a static method of a generic struct >> while selecting the the generic parameters explicitly? Apparently >> Struct::static_me

Re: [rust-dev] syntax for explicit generics when calling static method

2014-06-04 Thread Tommi
Apparently this works as well: let t = Testnew().test(); println!("t={}", t); On 2014-06-04, at 10:50, Tommi wrote: > I don't know if there's a better way, but this at least works: > > let tmp: Test = Test::new(); > let t = tmp.test(); > println!("t={}", t); > > On 2014-06-04, at 10:28, I

Re: [rust-dev] syntax for explicit generics when calling static method

2014-06-04 Thread Sebastian Gesemann
On Wed, Jun 4, 2014 at 9:28 AM, Igor Bukanov wrote: > What is the syntax for calling a static method of a generic struct > while selecting the the generic parameters explicitly? Apparently > Struct::static_method does not work. For example, consider the > following program: > > #[deriving(Show)] >

Re: [rust-dev] syntax for explicit generics when calling static method

2014-06-04 Thread Tommi
I don't know if there's a better way, but this at least works: let tmp: Test = Test::new(); let t = tmp.test(); println!("t={}", t); On 2014-06-04, at 10:28, Igor Bukanov wrote: > What is the syntax for calling a static method of a generic struct > while selecting the the generic parameters exp

[rust-dev] syntax for explicit generics when calling static method

2014-06-04 Thread Igor Bukanov
What is the syntax for calling a static method of a generic struct while selecting the the generic parameters explicitly? Apparently Struct::static_method does not work. For example, consider the following program: #[deriving(Show)] struct Test { i: int } impl Test { fn new() -> Test { Test {