fee1-dead
Apache Statement on White House Open Source Security Summit
I wouldn't rewrite my project to some other language before I know how it is going to look like in the language. I had to be somewhat confident. If you find yourself frustrated by Rust's borrow checker, that tells me that you are not yet ready to port a project to Rust. You don't have the "Rust mindset" yet.
I guess you could say `->` is too verbose and you can omit it in other languages. Rust has a complex type system and there can be confusing code when you omit `->`.
1. Closure Return Types.
You can define a closure with an explicit return type:
``` let my_closure = |i: u32| -> u64 { i as u64 }; ```
Now how do you omit the arrow here? How do you know `u64` is the return type and not constructing a struct?
2. Parsing stuff
It becomes impossible to parse none-delimited types. Is `fn() fn()` two different types or a function pointer returning a function pointer?
3. Readability
I mean, tokens can be read out loud and omitting it stops making sense.
`fn foo(bar: i32) -> f32` can be read as a "function named 'foo' that takes an argument named bar with type i32 and returns f32". The word returns directly corresponds to the `->` token.
Rust also has the `!` (read: never) type. Poorly formatted code when `->` is omitted is very confusing: `fn a()!` when compared to `fn a()->!`, or just one character generic types: `fn a<T>()T` compared to `fn a<T>()->T`.