News for hackers. Stuff that matters.
Re:Rust Compile Times and Code Graphs by wredue on Saturday October 14, 2023 @11:55AM (#37881482)
2 minutes isn’t even really bad build times.

I think that part of “compile times suck” is that, when we are learning, we are building extremely small programs. Hundreds of lines at the very top end. During this phase of our personal development, we build a habit of writing a line of code, then compiling. Then changing an index, then compiling. Then realize we use a wrong variable, then compile. Then <some other minor thing> then compile.

Somewhere along the way, we get to needing to build thousands or hundreds of thousands of lines, and there’s very frequently no build up to this so our habit of making very minor change and then making the compiler tell us what’s wrong hurts.

Re:Rust Compile Times and Code Graphs by devjab on Saturday October 14, 2023 @12:11PM (#37881647)
I'm going to risk being a little nit picky here and I'm sure you mean it differently and just used some bad examples. You really shouldn't be relying on your compiler to tell you that you used the wrong variable, however, and if you are, then you would likely benefit immensely from getting some better tools. Some IDE's will help you a lot of the way, but great linting will frankly completely remove your "need" to check to see if your small changes actually work or not.
Re:Rust Compile Times and Code Graphs by mxz3000 on Saturday October 14, 2023 @12:06PM (#37881602)
if you have a reasonably good IDE you don't really need to explicitly compile the whole program outside of when you want to run it.
Re:Rust Compile Times and Code Graphs by pjmlp on Saturday October 14, 2023 @12:48PM (#37882040)
Which on any kind of graphical application is all the time.
Re:Rust Compile Times and Code Graphs by Nullabillity on Saturday October 14, 2023 @01:53PM (#37882625)
Because that IDE is compiling the code behind the scenes... (Usually somewhere on a spectrum between literally just using the real compiler, or failing spectacularly to match it.)
Re:Rust Compile Times and Code Graphs by pjmlp on Saturday October 14, 2023 @12:52PM (#37882077)
Which is exactly what we need when doing GUI and games in Rust.

If it can't compete with the compile times from. NET, Java, Dart, Typescript then it won't be used by most folks.

C++ already lost the GUI wars for a reason, now stuck being the low level implementation language for GUI frameworks, driven by other languages.

Re:Rust Compile Times and Code Graphs by bbatha on Saturday October 14, 2023 @12:58PM (#37882139)
IME Typescript generally has far worse compile times than rust especially if you need to start splitting into packages or do anything more complex than stripping type annotations.
Re:Rust Compile Times and Code Graphs by pjmlp on Saturday October 14, 2023 @02:34PM (#37882999)
It never took me 15 minutes, like on a Gtk+rs project I have.
Re:Rust Compile Times and Code Graphs by kamikaz1k on Sunday October 15, 2023 @12:06AM (#37886791)
Depends on what you're doing. If you're type checking, it's usually happening in the background via LSP. If you're "compiling" to JS, use esbuild and its instant.
Re:Rust Compile Times and Code Graphs by TinkersW on Saturday October 14, 2023 @01:22PM (#37882381)
Depends if that 2 minutes is full build or incremental..if incremental that is unacceptable, should be more like 2 seconds.

Compiling to see if you have syntax errors? What do you not have an editor?

Re:Rust Compile Times and Code Graphs by trealira on Saturday October 14, 2023 @04:01PM (#37883777)
Yeah, and cargo check exists for that very reason. It does type checking without actually compiling the code. Rust-analyzer, the LSP server for Rust, runs `cargo check` whenever the file is saved, IIRC, and then shows you what the compiler said.
Re:Rust Compile Times and Code Graphs by dist1ll on Sunday October 15, 2023 @06:51PM (#37894138)
Incremental type checking is still painfully slow on a large codebase.