Live data from Hacker News

Still in love with Rust

dpc.pw

11–20 of 186 posts

Re: Still in love with Rust

#11

I'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.

Does vim-racer[0] not work for you? I don't exactly know what you mean by "good autocomplete", but if you are more specific, then maybe we can help you a little more? :-)

FWIW, my Rust setup in vim is mostly the following plugins:

* NERDCommenter, for commenting stuff

* rust.vim, for general rust things (like integration with rustfmt, playground, and the next two plugins)

* tagbar, for showing the list of tags (of the ctags-esque sense) in a sidebar.

* syntastic, for on-the-go syntax checking.

[0]: https://github.com/racer-rust/vim-racer

Re: Still in love with Rust

#12
"No race conditions, leaking resources, dangling pointers, unhandled exceptions, ..., the list goes on."

Except of dangling pointers, Rust has everything else from this list.

About compilation time issue: it doesn't exist anymore. Current versions do "cargo check" in a few seconds even for big projects (my biggest project is 45k LoC) and it takes a couple of minutes to compile it because of incremental compilation. For libraries it takes seconds to compile and 1-2 seconds to run "cargo check" (or clippy).

Re: Still in love with Rust

#14
post #3

“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.

Which brings up the question when/why to pick Rust? There are a plethora of languages which from my layman perspective seem more interesting. OTOH there are a plethora of languages with rich ecosystems, proven pedigree and with a high demand for such developers.

Re: Still in love with Rust

#15
post #3

“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.

Sure, nobody would choose Rust over C++ if you couldn't express pretty much the same data structures and relationships in Rust that you can express in C++.

Re: Still in love with Rust

#16
post #10

> Rust will force you to be a good programmer, > [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…

Python formatting is egregious though, with hopelessly long lines and no sign of where to break them up, or at the most weird places. Yes I'm one of those persons who adheres to the terminal 80 column rule, it's neat for splitting and cascades into many benefits. Python often looks like unkempt code to me, like the developer has no care for how it looks or layouts (which isn't true, it's Python's fault.) The forced indentation (I love proper formatting with consistency and indentation in languages) is among the first reasons I never liked or used Python, until recently when I gave in because it's such a great ecosystem to build scripts and such, but I still hate the formatting everyday. Clojure is beautiful though. Even C is gorgeous compared to a Python 'forced' program layout. I'll start adding Hy to the mix and touch vanilla Python as little as possible, but I still have to read library code.

Re: Still in love with Rust

#18
post #10

> Rust will force you to be a good programmer, > [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…

Python formatting is egregious though, with hopelessly long lines and no sign of where to break them up, or at the most weird places. Yes I'm one of those persons who adheres to the terminal 80 column rule, it's neat for splitting and cascades into many benefits. Python often looks like unkempt code to me, like the developer has no care for how it looks or layouts (which isn't true, it's Python's fault.) The forced i…

Doesn't Python have an autoformatting tool like gofmt or Prettier?

Re: Still in love with Rust

#19
post #10

> Rust will force you to be a good programmer, > [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…

Python formatting is egregious though, with hopelessly long lines and no sign of where to break them up, or at the most weird places. Yes I'm one of those persons who adheres to the terminal 80 column rule, it's neat for splitting and cascades into many benefits. Python often looks like unkempt code to me, like the developer has no care for how it looks or layouts (which isn't true, it's Python's fault.) The forced i…

I follow the 80 columns rule as well. Do you have an example of such unkempt code that you can share?
Post reply on HN