Re: [rust-dev] std::rand::Rng

2014-09-18 Thread Felix S. Klock II
On 17 Sep 2014, at 23:33, Sean McArthur wrote: > On Wed, Sep 17, 2014 at 2:26 PM, Evan Davis wrote: > > The problem is that you're trying to use a trait as a type. > > That shouldn't be a problem. You can use a `&mut Trait`, and you'll get > dynamic dispatch. You cannot mix dynamic dispatch

Re: [rust-dev] Right list?

2014-08-14 Thread Felix S. Klock II
Philppe (cc’ing rust-dev)- Hi! I think that we are currently encouraging users to post questions about using the language (or tools, etc) to StackOverflow, using the “rust” tag so that the community can find them easily. http://stackoverflow.com/questions/tagged/rust You can see Brian’s recen

Re: [rust-dev] How to write Generic traits for enums

2014-07-22 Thread Felix S. Klock II
T{ > match settings.get(&key) { > MyBool(x) => x, > MyStr(x) => x, > MyInt(x) => x > } > } > > But I don't know how to make this work. > > Thanks. > > > > On Tue, Jul 22, 2014 at 4:55 PM, Felix S. Klock

Re: [rust-dev] How to write Generic traits for enums

2014-07-22 Thread Felix S. Klock II
Aravinda (cc’ing rust-dev)- You didn’t show us exactly what you had tried to do to get your code to work, nor did you really describe what it is you want here. E.g. you seem to want `get_value(MyBool(true))` to return a boolean, but since `MyBool` belongs to the `MyTypes` enum, that implies tha

Re: [rust-dev] Why no "@Override" analogy?

2014-07-17 Thread Felix S. Klock II
Note that we are well aware that the issue Christoph mentioned is a wart for some uses of traits. E.g. some trait implementors really would like to be told when they missed a method because it has a default implementation already. One way to resolve this would be a lint; that has been previousl

Re: [rust-dev] Clarification about RFCs

2014-06-16 Thread Felix S. Klock II
Gabor (cc’ing rust-dev)- I have filed an issue to track incorporating the answers to these questions into the RFC process documentation. https://github.com/rust-lang/rfcs/issues/121 Here is some of my opinionated answers to the questions: 1. When an RFC PR is merged as accepted into the repo

Re: [rust-dev] Why explicit named lifetimes?

2014-05-22 Thread Felix S. Klock II
Michael (cc'ing rust-dev)- On 22 May 2014, at 16:32, Michael Woerister wrote: > Lately I've been thinking that it might be nice if one could omit the > lifetimes from the list of generic parameters, as in: > > fn foo(x: &'a T, y: &'b MyStruct) -> (&'b int, &'a uint) > > instead of > > fn foo

Re: [rust-dev] Private trait items

2014-04-22 Thread Felix S. Klock II
Tommi (cc'ing rust-dev)- I recommend you make a small fake github repository of your own, and learn the github workflow directly by forking that (perhaps with a separate fresh dummy github user account). I am not being facetious; I did a lot of that when I was first getting my bearings using g

Re: [rust-dev] Why mod.rs files?

2014-04-17 Thread Felix S. Klock II
Tommi (cc'ing rust-dev)- I don't know if this is considered an anti-pattern or not, but if you want to structure your files in the manner you describe, you can do so without resorting to `#[path=…]`, assuming you're willing to add a bit of boilerplate to the foo.rs and bar.rs to pull in the mod

Re: [rust-dev] Improving our patch review and approval process (Hopefully)

2014-02-19 Thread Felix S. Klock II
On 19/02/2014 21:12, Flaper87 wrote: 2. Approval Process [...] For example, requiring 2 r+ from 2 different reviewers instead of 1. This might seem a bit drastic now, however as the number of contributors grows, this will help with making sure that patches are reviewed at least by 2 core rev

Re: [rust-dev] Fwd: Problems building rust on OSX

2014-02-10 Thread Felix S. Klock II
Martin (cc'ing rust-dev)- I recommend you file a fresh bug with a transcript of your own build attempt. I infer you are pointing us to issue #11162 because of some similarity in the log output you see between that and your own build issue, but issue #11162 is fundamentally related to a local

Re: [rust-dev] Joe Armstrong's "universal server"

2013-12-19 Thread Felix S. Klock II
, Rust is incompatible with dlopen()? Nathan Myers On 12/19/2013 03:03 AM, Felix S. Klock II wrote: rust-dev- From reading the article, I thought the point was that a universal server could be deployed and initiated before the actual service it would offer had actually been *written*. I agree with

Re: [rust-dev] Joe Armstrong's "universal server"

2013-12-19 Thread Felix S. Klock II
rust-dev- From reading the article, I thought the point was that a universal server could be deployed and initiated before the actual service it would offer had actually been *written*. I agree with Kevin that the exercise would be pretty much pointless for Rust, unless you enjoy writing int

Re: [rust-dev] [whoami] "crate", "package" and "module" confused me!

2013-12-18 Thread Felix S. Klock II
Gaetan (cc'ing rust-dev)- On 18/12/2013 09:48, Gaetan wrote: but I wouldn't understand why the 'mod' keyword would stay Because a Rust module is not the same thing as a crate. Changes to the syntax for linking to an external crate is orthogonal to the concept of a module. So as long as we wa

Re: [rust-dev] Rust crates and the module system

2013-12-13 Thread Felix S. Klock II
On 13/12/2013 12:53, spir wrote: I think this is a good possibility, make the module/crate organisation mirror the filesystem (or the opposite): * 1 module = 1 file of code * 1 package = 1 dir This may be limiting at times, possibility one may want multi-module files and multi-file modules. Ye

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 ` as ` that any borrowed pointers in the type of 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 apropos here: https:/

[rust-dev] Plz separate mail threads for separated compilation [was Re: Separated/Incremential compilation]

2013-11-29 Thread Felix S. Klock II
First off, the topic of rustc slowness and long bootstrap times has indeed been discussed many times. If you have not yet tried skimming the archives, I recommend doing so, e.g. via http://lmgtfy.com/?q=+site%3Amail.mozilla.org+rust+crate+compilation+speed (I provide a (surely incomplete) lis

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

2013-11-22 Thread Felix S. Klock II
On 22/11/2013 19:32, Brian Anderson wrote: On 11/21/2013 08:53 PM, Patrick Walton wrote: There are several issues in the backwards-compatible milestone related to Unicode identifiers: #4928: XID_Start/XID_Continue might not be correct #2253: Do NKFC normalization in lexer Given the extreme la

Re: [rust-dev] Struct members in trait definitions

2013-09-20 Thread Felix S. Klock II
Andres (cc'ing rust-dev)- An initial question, since I'm not clear on one thing: What is your goal in proposing this change? That is, is your primary concern that you dislike writing either method invocations or method definitions? Or are you concerned about the ability of the compiler to op

Re: [rust-dev] implicit vs explicit generic bounds

2013-09-17 Thread Felix S. Klock II
turing-completeness proofs of C++ templates. Does that mean rust generics are not turing complete? Gokcehan On Tue, Sep 17, 2013 at 3:28 PM, Felix S. Klock II mailto:pnkfe...@mozilla.com>> wrote: Gokcehan- My understanding is that C++, due to its policy of SFINAE [1], usual

Re: [rust-dev] implicit vs explicit generic bounds

2013-09-17 Thread Felix S. Klock II
Gokcehan- My understanding is that C++, due to its policy of SFINAE [1], usually provides error feedback after the template has been fully instantiated and the fully instantiated version fails to compile. This can lead to hard to debug compile-time failures. Good compilers can help with diss

Re: [rust-dev] Compiler assertion and trait impl question

2013-09-12 Thread Felix S. Klock II
Carl, David (cc'ing rust-dev)_ Note that #6396 is about the 'self lifetime. That may or may not be related to the rustc assertion failure that David mentions in one of his comments, but I think the bulk of his example does not use lifetimes at all. (So I'm assuming that his main issues about

Re: [rust-dev] libsyntax default methods refactor -- anyone know what went wrong here?

2013-09-12 Thread Felix S. Klock II
Lindsey (cc'ing rust-dev)- Its not due to your changes. These are problems that are in master that for some reasons bors has not caught: Issue #9127: debug no-optimize make check yields three failures https://github.com/mozilla/rust/issues/9127 Cheers, -Felix On 12/09/2013 06:17, Lindsey K

Re: [rust-dev] Structural enums for datasort refinements

2013-08-28 Thread Felix S. Klock II
Bill (cc'ing rust-dev)- [Executive summary: the provided proposal needs further work.] I do not know which discussion of data sort refinements you had been reading; I would have liked context about where you were coming from. I assume it was either Niko's blog post [1] or issue #1679 [2], but

Re: [rust-dev] Rust on bare metal ARM - sample project

2013-07-16 Thread Felix S. Klock II
On 16/07/2013 19:52, Svetoslav Neykov wrote: On 15.07.13 23:37, Patrick Walton wrote: >On 7/14/13 1:04 PM, Svetoslav Neykov wrote: >> ·"unsafe" is not a normal block and doesn't return a value, can't be >> used as an expression. This made it impossible to wrap the unsafe casts >> from fixed

Re: [rust-dev] Incremental and generational GC

2013-07-11 Thread Felix S. Klock II
On 11/07/2013 13:30, Felix S. Klock II wrote: On 10/07/2013 22:04, Graydon Hoare wrote: I assume you've read this: http://www.hpl.hp.com/techreports/Compaq-DEC/WRL-91-8.pdf This is also relevant, I think (and more recent): Antony L. Hosking. 2006. Portable, mostly-concurrent, mostly-co

Re: [rust-dev] Incremental and generational GC

2013-07-11 Thread Felix S. Klock II
On 10/07/2013 22:04, Graydon Hoare wrote: On 13-07-10 11:32 AM, Patrick Walton wrote: I've been thinking about what will be needed to support incremental and generational GC in Rust. To be clear, I don't think we should block on it now, but we should not make it unduly difficult for us to imple

Re: [rust-dev] howto: c++ reference in rust

2013-06-25 Thread Felix S. Klock II
Rémi (cc'ing Philipp and rust-dev list)- We track bugs, work-items, and (some) feature requests here: https://github.com/mozilla/rust/issues Cheers, -Felix On 25/06/2013 12:18, Rémi Fontan wrote: good to know. should I be reporting the bug to some sort of bug-report-system? Rémi On Mon,

Re: [rust-dev] Using new I/O error handling

2013-06-03 Thread Felix S. Klock II
On 01/06/2013 06:10, Brian Anderson wrote: On 05/31/2013 01:44 AM, Sanghyeon Seo wrote: Is it actually possible to use new I/O error handling at the moment? It seems to me that it is not possible to get at std::rt::io::io_error at all, because conditions are private and do not work cross-crate

Re: [rust-dev] PSA: use #[inline(always)] with care

2013-05-30 Thread Felix S. Klock II
On 30/05/2013 05:15, James Miller wrote: This meant that a fairly simple, standard pass, was being called on over 100x more code than it needed to be. If you want to know why a full build takes so long, there is why. Since I've been curious about the build times this week, I thought I'd experim

Re: [rust-dev] RFC: Pattern matching binding operator

2013-05-03 Thread Felix S. Klock II
Patrick (cc'ing rust-dev)- Between the two options Patrick presented, my vote is for bifurcating the grammar into irrefutable and refutable variants. I like having one operator to denote binding (even if it also sometimes means mutation). However, my (potentially-wrong) intuition is that the

[rust-dev] continue and related keyword bikeshed [was Re: LL(1) problems]

2013-04-26 Thread Felix S. Klock II
On 26/04/2013 17:22, Alex Bradbury wrote: On 26 April 2013 16:15, Erik S wrote: For how rarely used "continue" is, four extra characters don't much matter. The time savings from not having to check the documentation to confirm what the keyword is will outweigh four characters of typing. Indeed

Re: [rust-dev] LL(1) problems

2013-04-25 Thread Felix S. Klock II
On 25/04/2013 18:12, Graydon Hoare wrote: I've been relatively insistent on LL(1) since it is a nice intersection-of-inputs, practically guaranteed to parse under any framework we retarget it to. I'm a fan of this choice too, if only because the simplest efficient parser-generators and/or parse

Re: [rust-dev] Shared 2 Owned

2013-04-23 Thread Felix S. Klock II
Alexander- What are you suggesting would be the semantics for a Shared -> Owned conversion? Just think about it in the the abstract for a moment: If X and Y are both sharing a reference to a @Pizza, and X decides it wants to hand the pizza to a customer who is expecting a ~Pizza, what is X s

[rust-dev] blog post with my proposal for associated item syntax

2013-04-23 Thread Felix S. Klock II
The team had some discussions recently regarding associated items. In Vancouver I outlined a small change to the grammar that might solve a lot of problems. I have written up the proposal here, with lots of gory background: http://blog.pnkfx.org/blog/2013/04/22/designing-syntax-for-associated-

Re: [rust-dev] Debugging in Ubuntu via GDB or related tools

2013-04-08 Thread Felix S. Klock II
Artelia (cc'ing rust-dev)- FYI: There is no '-g' flag, at least not in Rust 0.6. According to the #rust IRC channel, the correct flag is now "-Z debug-info" From the #rust IRC channel: http://irclog.gr/#show/irc.mozilla.org/rust/444262 Cheers, -Felix On 08/04/2013 14:45, Tim Chevalier wro

Re: [rust-dev] legality/utility of modules inside functions

2013-04-06 Thread Felix S. Klock II
John (cc'ing rust-dev)- You can still use the module in other contexts. pub fn baz() { mod z { pub fn f () -> int { 19 } } fn g() -> int { use z; z::f() } g(); } Cheers, -Felix On 06/04/2013 03:50, John Clements wrote: Our grammar currently

Re: [rust-dev] JFYI: ANTLR grammar for Rust tokens

2013-03-26 Thread Felix S. Klock II
Cool, John beat me to the punch and posted a grammar to a repository! (And better still, John's grammar looks way more complete than my own.) I went ahead and shoved my version of Rust.g4 into a branch on a fork of your repo, so that people can skim and compare the approaches. (E.g. the use o

Re: [rust-dev] RFC: Bless mod.rs

2013-02-20 Thread Felix S. Klock II
I haven't been thrilled with the `mod.rs` convention (because my emacs buffers all have the same name) At this point this probably deserves an entry on the wiki or somewhere: https://www.google.com/search?q=emacs+uniquify I strongly recommend changing Emacs's default setting for this. Cheers

Re: [rust-dev] Compilation Error in Rust in Nesting of Modules

2013-02-04 Thread Felix S Klock II
Ranvijay (cc'ing rust-dev)- Since you put your source code in the file c/c.rs, that code belongs to a module named `c` *inside* of the `c` module you have already put into your orig.rs crate. You can see the "git diff" invocation in the transcript below to see how I fixed your code. Cheers

Re: [rust-dev] Rust 0.5 for Windows

2013-02-01 Thread Felix S Klock II
On Fri Feb 1 19:13:03 2013, Graydon Hoare wrote: (they act as sequence-points for make, since it cannot easily guess the actual hash-based output filenames of the libraries) I was idly wondering about those hashy filenames: Is the long term plan to continue to encoding hashes into the filenam