[rust-dev] "intimidation factor" vs target audience

Dean Thompson deansherthompson at gmail.com
Tue Jan 22 06:55:46 PST 2013


I am new to Rust, but quite excited about it.  I have read most of the
docs 
carefully.

I'm looking at some code that Niko Matsakis updated in
https://github.com/stevej/rustled/commits/master/red_black_tree.rs

  pure fn each(&self, f: fn(&(&self/K, &self/V)) -> bool) {
    match *self {
      Leaf => (),
      Tree(_, ref left, ref key, ref maybe_value, ref right) => {
        let left: &self/@RBMap<K,V> = left;
        let key: &self/K = key;
        let maybe_value: &self/Option<V> = maybe_value;
        let right: &self/@RBMap<K,V> = right;
        left.each(f);
        match *maybe_value {
            Some(ref value) => {
                let value: &self/V = value;
                f(&(key, value));
            }
            None => ()
        };
        right.each(f);
      }
    }
  }

I understand this code reasonably well. I greatly value the attention
to safety in Rust, and I appreciate the value of pointer lifetimes in
maintaining that safety.

My gut reaction, though, is that this code is almost as intimidating
as Haskell. Even more worrisome to me, I think most mainstream
programmers would find the *explanation* of this code intimidating.

Who is our target audience for Rust? Graydon has said it is
"frustrated C++ developers", but how sophisticated and how "brave"
are we thinking they will be?

(I'd like to think of myself as a team member who is just getting
started, so while deferring to the senior folks, I'll say "we".)

How intimidating do we think Rust is today? Am I just overreacting
to unfamiliarity?

How can we calibrate our "intimidation factor" before language
decisions start getting harder to change?

Do we want (and is it feasible) to define a simpler subset of the
language that beginners are encouraged to stick to and that most
libraries don't force clients away from?

Dean
----

Dean Thompson
https://github.com/deansher




More information about the Rust-dev mailing list