Live data from Hacker News

Still in love with Rust

dpc.pw

71–80 of 186 posts

Re: Still in love with Rust

#71

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.

Same. Rust needs a one-click install "integrated de"

Re: Still in love with Rust

#72
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…

Only as good as Rust allows you to be, which is fine for some until they stagnate or grow out of it; but far from the final answer to anything. I don't get at all how being forced to do anything could ever be a good thing. Smells like cognitive dissonance from here. I'm all for powerful tools that enables me to write better code faster; but being forced, really? That's the best thing about Rust? Ew.

> I don't get at all how being forced to do anything could ever be a good thing.

So anarchy it is, then?

Re: Still in love with Rust

#73
post #66
post #6

Rust is a wonderful language, but I still have the impression that it is not stable as of 2018. All the toys I've made to play with it during the last years went deprecated quickly, especially if you rely on the ecosystem of packages (web server, database, ...). In 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…

What do you mean by deprecated? Unsupported dependencies? All the code I've written post-1.0 still compiles correctly (although a lot of it could use an update to use new language capabilities). I even have a bit of Rust in production at work and I haven't encountered any maintenance issue so far. Now the ecosystem itself can move pretty fast depending on the dependencies you use, that's true, but that's a different…

> Now the ecosystem itself can move pretty fast depending on the dependencies you use, that's true, but that's a different issue.

Is it? I’m used to languages which bundle a huge set of standard libraries as part of the language.

Re: Still in love with Rust

#74
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…

Only as good as Rust allows you to be, which is fine for some until they stagnate or grow out of it; but far from the final answer to anything. I don't get at all how being forced to do anything could ever be a good thing. Smells like cognitive dissonance from here. I'm all for powerful tools that enables me to write better code faster; but being forced, really? That's the best thing about Rust? Ew.

I'd chalk it up to the old advice of "learn new programming languages that teach you something new [because you'll become a better programmer]" applying to Rust, as there is something new to most programmers in it. I remain skeptical that a total beginner starting with just Rust will be any better of a programmer (however you're measuring that) than another beginner who had started with, say, Python, giving both a year.

Re: Still in love with Rust

#75
post #62

Earlier quoted context omitted.

But list/dict comprehension puts the programmer in bad shoes, because anything interesting/powerful done with it gets dangerously long. This and other features where non-trivial statements or calls are written seem poorly thought-out, from a formatting perspective (nevermind 120 columns being the style goal for the language and common IDEs, already longish for term vim and Emacs.) Adding to it for the other commenter…

Comprehensions are very easy to format spanned across multiple lines - since they're always enclosed in some kind of brackets, you can split them over multiple lines in a readable fashion: ys = [x + 1 for x in xs if x > 0] or: ys = [ x + 1 for x in xs if x > 0 ]

To me it's similar to having to break-up a long line in the middle of a non-important function call, because parens is where it's at. Feels like hooking into the middle of nowhere-don't-care just because that's the unpractical rule Python follows, since indentation is part of syntax.

Re: Still in love with Rust

#76
post #61

Earlier quoted context omitted.

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…

Long lines come most often in conditions of if- and while-blocks, mostly because there's no way to split them over multiple lines that isn't visually hideous. But a condition can be easily split if it is assigned to a variable, and that variable then tested. And naming said variable well can make a comment explaining the condition redundant.

Yes, prefer a named variable if the logic gets long. If it is really long, consider introducing a function to calculate the predicate.

Re: Still in love with Rust

#77
post #68

Earlier quoted context omitted.

Only as good as Rust allows you to be, which is fine for some until they stagnate or grow out of it; but far from the final answer to anything. I don't get at all how being forced to do anything could ever be a good thing. Smells like cognitive dissonance from here. I'm all for powerful tools that enables me to write better code faster; but being forced, really? That's the best thing about Rust? Ew.

> I don't get at all how being forced to do anything could ever be a good thing If you don't prefer tools that can automatically check if you were a good developer or not, it not only does not scale (to trust the software you build), it's that I wouldn't want to work with you as a teammate.

> If you don't prefer tools that can automatically check if you were a good developer or not

You are pretending there are no trade offs.

> it not only does not scale (to trust the software you build)

I think we should all be able to agree that empirically that is nonsense.

Re: Still in love with Rust

#78
post #7

Thank you for this piece. I am working on a game, that I am prototyping in Go. In my prototype, I have just entered the realm of multiple threads, and for this project to work out, it needs to handle quite a lot of threads working on the same resources. While 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 t…

There was a great talk recently about how to properly build an entity component framework in Rust if you haven't seen it yet. https://youtu.be/aKLntZcp27M

Thank you for that link. Very useful. It already highlighted a solution in Rust for a problem that I've run into with my Go prototype. And I appreciate there also was a blog post to read.[0] I personally prefer articles over videos.

[0] https://kyren.github.io/2018/09/14/rustconf-talk.html

Re: Still in love with Rust

#79

> Barriers to entry So far I had two faltering attempts to learn Rust but somehow I didn't find good enough material to get me hooked. I am looking for something similar to the Tour of Go[1], where you can interactively try the language by solving minimal tasks. Does someone know of such material? [1]: https://tour.golang.org

https://doc.rust-lang.org/rust-by-example/

Re: Still in love with Rust

#80

> Barriers to entry So far I had two faltering attempts to learn Rust but somehow I didn't find good enough material to get me hooked. I am looking for something similar to the Tour of Go[1], where you can interactively try the language by solving minimal tasks. Does someone know of such material? [1]: https://tour.golang.org

I found The Book [1] to be pretty good, but it suffers the same problem that I find infuriating about programming language books in general. They have to target one specific proficiency level, so someone less experienced is going to get left behind, and someone more experienced is going to get bored out of their mind.

As a somewhat experienced Rustacean, my biggest frustration as of now is the lack of a comprehensive reference where I can look up very specific things (e.g. the syntax for byte string literals, or an exact definition of how borrowing works in some particular edge case). There is [2] but as it says on the first page it's incomplete.

[1] https://doc.rust-lang.org/book/2018-edition/index.html

[2] https://doc.rust-lang.org/reference/introduction.html

Post reply on HN