Live data from Hacker News

Still in love with Rust

dpc.pw

131–140 of 186 posts

Re: Still in love with Rust

#131
post #62

Earlier quoted context omitted.

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 ]

Both of the examples you give are far less readable than an equivalent for loop with an if statement. Programmers use comprehensions because there is an understanding that they are more efficient and the compiler/interpreter can better optimize them.

They seem less readable to you because this is not what you're used to. While I agree that complex, one-line comprehensions, possibly with more comprehensions nested inside, can be quite unreadable even for experienced developers, I find that the given examples, with clearly separated expression-loop-condition structure, tend to be quite easy to read and understand, even for junior developers.

Re: Still in love with Rust

#132
post #129

Earlier quoted context omitted.

> Edit: This place is disappointingly childish... It does not reflect well on Rust, either. You're getting downvoted not because of the alleged childishness of this place, but because you're trying to win a discussion on a complex issue by scoring a simplistic "gotcha".

Hmm, my original comment was not a "gotcha" it is the simple truth. Anyone trying to sell you a tool by claiming that "it will make you a good whatever" is just trying it on. Yes, a good tool can help achieve better results but that's not the same at all. Then, all the replies I received were seemingly defiant but all in fact agreed to the point while trying to sound smart.

I was not trying to disagree with you. As you said, in some sense, I agree. The point is that it's not as simple as what you're saying. There is some truth to it, but it's not the whole story.

Re: Still in love with Rust

#133
post #48
post #44

Earlier quoted context omitted.

I don't know the demographics/targets, but I come to rust from ruby. So does Steve Kabnick, the author of the Rust book.

Cool! What kind of projects do you work on, and what made you switch?

Well, I have not "switched". For now I am just learning (at a very slow pace).

My current job is not in ruby any more, now I do Lua - I'm a core dev at Kong - https://konghq.com/ . It's much lower-level than ruby, but still not as low as you can go with rust.

Re: Still in love with Rust

#134
post #85

I was going to try out Rust, then I saw this on the download page curl https://sh.rustup.rs -sSf | sh Really?

Yes. The script is less than 400 lines, and is pretty easy to audit. We wrote it in such a way to prevent some issues like "if the download gets cut off only part of the script gets run." It's served over HTTPS. You can also probably get an install from whatever package manager you use, if you prefer that.

You can detect whether the script is being piped into sh, so downloading the script via for example FF might produce different results than piping it to shell, making audits useless.

Re: Still in love with Rust

#135

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.

For language server autocompletion, install coc.nvim - https://github.com/neoclide/coc.nvim

Then

  :CocInstall coc-rls
and should work out of the box.

I also use https://github.com/w0rp/ale to provide linting. Also works out of the box.

You can get these things running on vim8, but honestly it's easier to just use neovim.

If it's of any use, you can check out my full config at https://github.com/tom-james-watson/dotfiles.

Re: Still in love with Rust

#136

Can someone familiar with both Rust and F# (or OCaml) type systems write few words about the expressiveness aspect of the language? What would I miss in Rust if coming from the F# background?

Fun fact: Rust was originally implemented in OCaml, and takes a lot of inspiration from it. Rust was originally described to me by someone as "C meets OCaml." The biggest thing missing in Rust that are in both are higher kinded types. The biggest thing missing from OCaml is parameterized modules.

F# doesn't actually have HKTs either, unfortunately.

Re: Still in love with Rust

#137

Earlier quoted context omitted.

Fun fact: Rust was originally implemented in OCaml, and takes a lot of inspiration from it. Rust was originally described to me by someone as "C meets OCaml." The biggest thing missing in Rust that are in both are higher kinded types. The biggest thing missing from OCaml is parameterized modules.

F# doesn't actually have HKTs either, unfortunately.

I thought it did, my mistake!

Re: Still in love with Rust

#138
post #134

Earlier quoted context omitted.

Yes. The script is less than 400 lines, and is pretty easy to audit. We wrote it in such a way to prevent some issues like "if the download gets cut off only part of the script gets run." It's served over HTTPS. You can also probably get an install from whatever package manager you use, if you prefer that.

You can detect whether the script is being piped into sh, so downloading the script via for example FF might produce different results than piping it to shell, making audits useless.

Sure. If you're worried about that, it's easy enough to download it first, and then run it, without the pipe.

If you're auditing it, you've already downloaded it, so it's unclear to me why you'd re-download and pipe rather than just running it.

Re: Still in love with Rust

#139
post #129

Earlier quoted context omitted.

> Edit: This place is disappointingly childish... It does not reflect well on Rust, either. You're getting downvoted not because of the alleged childishness of this place, but because you're trying to win a discussion on a complex issue by scoring a simplistic "gotcha".

Hmm, my original comment was not a "gotcha" it is the simple truth. Anyone trying to sell you a tool by claiming that "it will make you a good whatever" is just trying it on. Yes, a good tool can help achieve better results but that's not the same at all. Then, all the replies I received were seemingly defiant but all in fact agreed to the point while trying to sound smart.

The issue with your comment is the dismissive and reductionist point of view, this place isn't childish, it's exactly the opposite: people here don't tolerate so much statements of absoluteness or broken analogies.

Re: Still in love with Rust

#140
Rust core development is working on many important features in parallel. The feature I have been most excited about, and wish was here already, is async/await. I wrote quite a bit of asyncio using futures and it was a bloody, exhausting experience. Lack of documentation or examples made the experience even more challenging. Much of what I wrote could be trivially refactored to async/await syntax, but I may keep some around to honor hard-earned gains. It's not clear to me yet whether the first stable release in Q1 2019 will allow me to port everything but I look forward to finding out.
Post reply on HN