|
|
|
|
|
by hardwaregeek
1048 days ago
|
|
Yeah isn't that my point? Rust isn't trying to be short or elegant. There's no zen of Rust. There are elegant aspects of Rust, but it's not a central goal. Whereas with OCaml it's trying to be elegant. It's encouraging people to write a program where you read it, go "wait, how does that work?", then re-read it and marvel at the beauty of it. To be clear, elegance is important. A language absent of elegance would be a bore to write (cough Java cough). But too much elegance and it can eclipse the legibility of the language. No type annotations is elegant. Is it legible? Not in my opinion. But perhaps it is in yours. |
|
The Ocaml program is mostly matching followed by a chain of operations. It’s far removed from elegance for elegance sake. Meanwhile Rust is handicapped by the machinery it forces you to deal with as a lower level language introducing life time.
Type annotations are a non issue. They are systematically provided in Ocaml in a different file than the code. This header file is not provided here because well it’s a blog post.