Hacker News new | past | comments | ask | show | jobs | submit login

If you're talking about a language being readable to those that aren't proficient, Rust is about as bad as one could imagine.

Your example is also less about Rust and more about type signatures.




> Your example is also less about Rust and more about type signatures.

No, is HOW Rust use type signatures. Rust is in the camp of "advanced usage", not like C#, Python and others, where a "type" is barely for classification. Instead, Rust use types to inform: Memory type (heap vs stack), Cost (cheap to copy or must clone and can be potentially very big), Permisions (read/mutable), Behavior, Share-ability (can go in threads), lazy or not (iterable), etc.

It use types for a lot, and communicate much information densely.

P.D: Not always perfect and I agree that the syntax is not as nice to me, but is incredible how much you can understand from most codebases just reading, even on docs (not need IDE assistance that much)


> No, is HOW Rust use type signatures.

No, I don't really agree. The example was "def read(path)", which is intentionally vague and any typed language would clarify.

Your points can be/are valid, but they don't really change the fact that the above example was a cherry pick, and Rust's (over)use of symbols and special characters make it, again, about as hard to read as one could imagine. Just because you _can_ derive meaning from it doesn't change that.


Ok, so how you do it or what can be used as counter-example?


func Read (p Path) ([]byte, error)

From your post:

> What is path? Anything that can become path on the file system.

> What it read? Anything that can be pointed with that PATH

> What it return? Vec of bytes or a IO::Error


With io::error and is set!


Right...so it's about types, not Rust.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: