6 ms·
Maybe it's just me, but faster compile times really isn't anywhere near the top of ask list. Mentally I just bucket compile times in seconds, minutes, hours. Al
by kenhwang 8y ago
Maybe it's just me, but faster compile times really isn't anywhere near the top of ask list. Mentally I just bucket compile times in seconds, minutes, hours. Almost nothing compiles in seconds, which I consider the minimum to be non-disruptive. Minutes is fine and pretty much the norm (especially in Scala land), I take that time to go to the bathroom, refill my coffee, browse around on HN; it's honestly not a big deal. When compile times start creeping into the hour mark, yeah, then I'm annoyed because it becomes a "once a day" build task.
Rust is still solidly in the "minutes" bucket for compile time. I don't see it ever breaking into the "seconds" bucket. That's fine. I'll take ergonomics improvements every time.
- leppr 8y agoYes, named parameters or anonymous structs please. I'll take human-brain parsing speed over compile speed any day.
- Thiez 8y agoSince Rust doesn't have `null`, how do you imagine named parameters would work? Likewise, which traits would you expect an anonymous struct to implement?
- wtetzner 8y agoNamed parameters doesn't necessarily mean optional parameters. However, if you did want optional parameters, you could potentially have them be `Option` types.
- Thiez 8y agoBut without optional parameters, what is the point of named parameters? Hopefully most functions have a limited number of parameters, with these parameters being in a somewhat logical order, and the names of the values passed to the functions hinting at their purpose. In addition, more and more IDEs have the ability to display the parameter names. Some display them at all times, other on mouse-over. I write a lot of C#, and find I only used named parameters when a function has default parameters. Even then I prefer to avoid writing such functions myself, and Microsoft seems to agree [1]. [1]: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1026-default-parameters-should-not-be-used?view=vs-2017 https://docs.microsoft.com/en-us/visualstudio/code-quality/c...
- wtetzner 8y ago> But without optional parameters, what is the point of named parameters? The point of named parameters is not having to remember the order parameters come in, especially in cases where the parameters are of the same type. Also, IDE's aren't the only places where you read code.
- simias 8y ago>Almost nothing compiles in seconds You just made me feel glad I'm mainly a C dev these days. Since you typically rebuild one C file at a time (unless you make changes to header files potentially) compilation times of a fraction of a second are the norm here. That being said I agree with you that between 1mn compile time and 1mn10s compile time it might not make all that much of a difference in practice. However one thing Rust does that mitigates these problems a little is that diagnostics and errors are typically generated early in the build process, so generally if you see that it started off well you can focus your attention elsewhere (or even interrupt the build early to start a new one if you make small, incremental changes). In this context I assume that the NLL checker added time to this early phase of the boot process and it might be worth optimizing that bit in particular. If you have a lifetime issue you don't want to wait 30s to have your build error.
- paavohtl 8y ago> However one thing Rust does that mitigates these problems a little is that diagnostics and errors are typically generated early in the build process, so generally if you see that it started off well you can focus your attention elsewhere (or even interrupt the build early to start a new one if you make small, incremental changes). You can also run the compiler with `cargo check` and it only does type- and borrow checking. I haven't worked on any huge Rust codebases, but in my experience it usually takes only a fraction of a second at best or a few seconds at worst.
- jblindsay 8y agoI have a large (~140k SLOC) geospatial analysis project written entirely in Rust, and I can confirm that it takes me about 3.5 min to cargo build --release on my Macbook pro and only about 12 s to cargo check. It is a life saver for productivity although I would still welcome a reduction in those compile times. The data sets that I use to test new tools are often so large that cargo build is not an option for testing. I have to use release mode. I have really enjoyed programming in Rust since starting the project a year and a half ago. If there is one thing I could change about the language it would be the compile times.
- icholy 8y ago>Almost nothing compiles in seconds Go does.