Still in love with Rust
dpc.pw
Still in love with Rust
1–10 of 186 posts
Re: Still in love with Rust
#2Re: Still in love with Rust
#3I think this hits the nail on the head for me: abstract structure first, the choice of language C/C++/Rust/... is then a secondary consideration.
Re: Still in love with Rust
#4Re: Still in love with Rust
#5I'd still love to see a good tutorial on setting up Vim to work well with rls and all the other plugins. I only really keep VSCode around since it works with rls and sometimes I want to use the autocomplete for codebases that are large enough to really need good autocomplete, but not so large that rls gets bogged down and doesn't work at all anymore.
Re: Still in love with Rust
#6In addition, there was this thread: https://internals.rust-lang.org/t/concerned-about-rust-2018-...
All in all, Rust will be great when stable (including the ecosystem).
Re: Still in love with Rust
#7While I have not personally dappled this far into concurrency in Go myself, I have read plenty of articles where developers recommend using the mutex package rather than the goroutines themselves.
But I've also read about Rust's thread and resource handling -- and I'll admit, I've been looking for an excuse to write some Rust again -- and so inspired by this entry, I've decided to finish the prototype in Go, and build the real version in Rust.
Re: Still in love with Rust
#8“Bad programmers worry about the code. Good programmers worry about data structures and their relationships.” I think this hits the nail on the head for me: abstract structure first, the choice of language C/C++/Rust/... is then a secondary consideration.
I'm not saying Rust is the right answer but not paying attention to, or worse, putting our heads in the sand, when it comes to our tools is not the answer.
Re: Still in love with Rust
#9“Bad programmers worry about the code. Good programmers worry about data structures and their relationships.” I think this hits the nail on the head for me: abstract structure first, the choice of language C/C++/Rust/... is then a secondary consideration.
The point of a programming tool is to help the programmer to be a better programmer, there is indeed no point using a very strict language, statically typed with lot of constraints attached for a perfect programmer.
But for commoners it would certainly help to have some guiding.
Re: Still in love with Rust
#10> [if] you like it or not.
This is probably the best in-a-nutshell statement that describes what a good programming language is for me.
I had similar moments in the past. Before Python I cared about indention to some degree. But once I got used to the way Python forces you to indent your code, I came to the realization that this is pretty much the way I should format my code anyway and it influenced my coding style in all other block-based languages for the better.
Clojure was another language that showed me how functional programming should be done. My code in all languages changed and I used a lot less variables and a lot more constants and parameters. My code and the systems I created became a lot simpler and much more robust as a consequence. I had used Haskell before but it never really transformed my mind the way Clojure did. I also got a really good grasp on destructuring and list comprehension.
Rust offered me several relevations. I finally understood test-driven-development because the language has excellent support for it. I also understood RAII more deeply. Traits became clear to me (Clojure protocols and Haskell type classes felt strange to me). I finally understood why the Maybe monad in Haskell/ML is one of the simplest and yet bests ideas in programming.
And there is the borrow checker. I already had a functional programming mindset when I picked up Rust. But having a clear owner of data takes the mindset of functional programming even further[1], even when mutability is involved. It is a lot easier to reason about your code when you know exactly which operations can (and should) change a variable.
An aspect that the Python, Clojure and Rust communities have in common is that they emphasize idiomatic code a lot. Therefore it is much easier for newcomers to find examples of professional-level code and learn things the right way. And it is much easier to dive into a new codebase. Clojure is actually a very extreme case of this, because Clojure code tends to use a lot of 1-letter parameter names. In most programming languages you are allowed to have the variable "i" for looping over numbers. But not much more. In contrast, Clojure has a list of well-established 1-letter variables that are recognized by everyone in the community.
[1] This does not adhere to the classical definition of functional programming but I feel that it is a natural extension to it.