I tried Rust about a month ago. The language itself is amazing, the pattern matching is super expressive, the borrow checker is incredible in the kinds of errors it can pick up on, and rust-analyzer is leagues beyond where RLS was. But... the compile times are an absolute non-starter for me. I'm the kind of guy that likes to re-run his code continually to see if it validates to what I expect it to be doing. In Rust,…
Well, I like an instantaneous edit-compile loop too, bit I was never bothered by rust compile times. Once you get your cache warm, it's pretty much instant. If not, run `cargo check` instead of `cargo run`. You can also use rust-analyser for an in-editor <1s feedback loop.
Rust Is Surprisingly Good as a Server Language
71–80 of 352 posts
Re: Rust Is Surprisingly Good as a Server Language
#72Earlier quoted context omitted.
> I'm the kind of guy that likes to re-run his code continually to see if it validates to what I expect it to be doing. I used to be the same way, but the more I practiced holding the state in my head while I worked, the better I got at it. > One group loves fast compile times and quickly validating hypotheses. You just don't need it. As you make changes, the delta between expected behavior and actual behavior contin…
>I used to be the same way, but the more I practiced holding the state in my head while I worked, the better I got at it. Doesn't that partially defeat the point of having a powerful compiler? The more work the compiler does, the less we have to keep track of in our head (and conversely, much of the pain of coding in a language like Python is the amount of stuff we need to mentally keep track of).
There’s two sides to this: on the one hand, you don’t have to keep as much info in your head because the compiler will tell you if you ask it. On the other hand, when you do try to keep state in your head, the compiler is able to double-check that for you so that you don’t have to do it perfectly.
With a language like Python, you’re working without a safety net, so you make small, cautious, steps in order to not fall. A strongly-typed language like Rust enables you to make larger, bolder, changes in one go, confident that the little mistakes will get caught.
Re: Rust Is Surprisingly Good as a Server Language
#73There is an advocate on our team that wants to migrate our web service from Nodejs to Rust. While I am not a huge fan of Typescript, at least libraries are readily available and generally easy to use. On the other hand, being able to show that we are able to do monitoring, user auditing, ORM, opentracing, gRPC-web with Rust is non trivial. Now that I think of it, being able to do a "hello world" on any language is pr…
What does he think will improve? Migration for the sake of migration is a waste of everyone’s time.
Re: Rust Is Surprisingly Good as a Server Language
#74Earlier quoted context omitted.
> I'm the kind of guy that likes to re-run his code continually to see if it validates to what I expect it to be doing. I used to be the same way, but the more I practiced holding the state in my head while I worked, the better I got at it. > One group loves fast compile times and quickly validating hypotheses. You just don't need it. As you make changes, the delta between expected behavior and actual behavior contin…
>I used to be the same way, but the more I practiced holding the state in my head while I worked, the better I got at it. Doesn't that partially defeat the point of having a powerful compiler? The more work the compiler does, the less we have to keep track of in our head (and conversely, much of the pain of coding in a language like Python is the amount of stuff we need to mentally keep track of).
Unexpected behaviour and errors can be caught by means other than constant recompilation, and tools exists to do just that. In IDEs, these tools tend to become invisible, seamless, and can be relied upon without much configuration; for those accustomed to less integrated environments, the manual configuration required to get these tools up and running becomes a hassle.
I suppose using those tools efficiently and constant recompiling are different ways to solve the same problem, but I wouldn't say it's solely the compiler's job even in the latter case. For languages that aren't super-fast for compiling like Rust, Swift, etc. there may be much more reliance on those other tools.
Re: Rust Is Surprisingly Good as a Server Language
#75Earlier quoted context omitted.
That's really interesting. Compiling only a few times a day is mind boggling to me - in a normal day I'd probably average hundreds to a thousand compilation cycles! The main thing that I use compiling for is to validate little off-by-one things. Like, is substring() exclusive on the second parameter? What about range syntax and the slice operator? What if I wrote + 1 instead of - 1 somewhere, or did < instead of <=?…
> The main thing that I use compiling for is to validate little off-by-one things. Like, is substring() exclusive on the second parameter? What about range syntax and the slice operator? What if I wrote + 1 instead of - 1 somewhere, or did I'm a really big fan of reading the docs (or, where the docs are insufficient, the source), and will always have docs.rs open alongside my editor. While the examples you provide ar…
(OK, you could read preferences from a file, but then you'd have to optimistically write every value you'd ever want to recompile to a file. I've tried this, but it's far too much overhead.)
Re: Rust Is Surprisingly Good as a Server Language
#76I tried Rust about a month ago. The language itself is amazing, the pattern matching is super expressive, the borrow checker is incredible in the kinds of errors it can pick up on, and rust-analyzer is leagues beyond where RLS was. But... the compile times are an absolute non-starter for me. I'm the kind of guy that likes to re-run his code continually to see if it validates to what I expect it to be doing. In Rust,…
Re: Rust Is Surprisingly Good as a Server Language
#77Earlier quoted context omitted.
> I'm the kind of guy that likes to re-run his code continually to see if it validates to what I expect it to be doing This honestly is a bad habit. Thought it does depend quite a bit on the type of work you are doing. For some things it is necessary especially if it is inherently fibbly. Rust is a language to which the programmer must adapt his way of working and thinking. If the programmer is too set in his way, hi…
> This honestly is a bad habit. I'd like to hear some justification for this rather than a blanket assertion. Just because our work styles differ doesn't mean that my style is necessarily wrong. > Rust is a language to which the programmer must adapt his way of working and thinking. I mean, Rust is actively attempting to improve compile times. It's not like devs made them intentionally long to cultivate good programm…
Re: Rust Is Surprisingly Good as a Server Language
#78Re: Rust Is Surprisingly Good as a Server Language
#79Earlier quoted context omitted.
As a datapoint for your hypothesis, when working in a typed language I will build my code only a few times a day. I much prefer working from a logical and thoughtful approach rather than iteration. At the point where I start a build I am already reasonably confident that it will do what I want it to. There are some bugs where I will need to re-build several times consecutively but these are relatively rare for me (I…
That's really interesting. Compiling only a few times a day is mind boggling to me - in a normal day I'd probably average hundreds to a thousand compilation cycles! The main thing that I use compiling for is to validate little off-by-one things. Like, is substring() exclusive on the second parameter? What about range syntax and the slice operator? What if I wrote + 1 instead of - 1 somewhere, or did < instead of <=?…
Re: Rust Is Surprisingly Good as a Server Language
#80There is an advocate on our team that wants to migrate our web service from Nodejs to Rust. While I am not a huge fan of Typescript, at least libraries are readily available and generally easy to use. On the other hand, being able to show that we are able to do monitoring, user auditing, ORM, opentracing, gRPC-web with Rust is non trivial. Now that I think of it, being able to do a "hello world" on any language is pr…