On 02/01/2014 11:39 PM, Corey Richardson wrote:
```
forall<T, U> struct Foo { ... }
forall<T, U> impl Trait<T> for Foo<T, U> { ... }
forall<T, U> fn foo(...) { ... }
```

Why not

```
fn foo: pub unsafe <T, U> => (f: |T| -> U, arg: T) -> U { f(arg) }
struct foo: <T, U> => { ... }
impl Foo: <T, U> => Trait<T> { ... }
```

Can we please not put more stuff in front of the identifier? Have we ran out of space after it? What will this look like once the types start looking like `template<typename KeyFromValue, typename Hash, typename Pred, typename SuperMeta,typename TagList, typename Category> class hashed_index`? Do we really need all that in front of a function name?

The immediate, and most pragmatic, problem is that in today's Rust one cannot
easily search for implementations of a trait. Why?

Because the only existing Rust parser is geared towards a native Rust compiler, not a non-Rust IDE. That's the problem, not `grep`, and syntax changes won't help unless you want to redesign the language to be completely regex-compatible. Write a C-bindable parser, plug it into `ack`, `ctags` and a couple of IDEs, and everyone will be happy.

(Here I ignore the issue of tooling, as I do not find the
argument of "But a tool can do it!" valid in language design.)

Then why have such a parsing-oriented grammar in the first place? Following this logic, Rust should look more like Haskell, with a Hello Kitty binop `(=^.^=)`. (I swear I've seen this in real code somewhere)


_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to