4 ms·
> very slow compilation times That isn't always the case. Slow compilations are usually because of procedural macros and/or heavy use of generics. And even the
by thayne 10mo ago
> very slow compilation times
That isn't always the case. Slow compilations are usually because of procedural macros and/or heavy use of generics. And even then compile times are often comparable to languages like typescript and scala.
- Yiin 10mo agotypescript transpilation to js is nearly instant, it's not comparable
- baq 10mo agoGood to know, my $DAYJOB project unfortunately isn’t as well informed and we have to use esbuild just to survive.
- thayne 10mo agoRust compilation is also almost instant, if you have a relatively small project. It's only when you get very large projects that compilation time becomes a problem. If typescript compilation speed wasn't a problem, then why would Microsoft put resources into rewriting the tyescript compiler in Go to make it faster[1]? [1]: https://github.com/microsoft/typescript-go https://github.com/microsoft/typescript-go
- timow1337 10mo agoCompared to C, rust compiles much slower. This might not matter on performant systems, but when resources are constrained you definitely notice it. And if the whole world is rewritten in Rust, this will have a non-significant impact on the total build time of a bunch of projects.
- gf000 10mo agoRuntime memory issues probably have a significantly higher total cost. But of course that doesn't negate this cost, but building can always be done on another machine as a way to circumvent the problem.
- dwattttt 10mo agoIt's been mentioned obliquely, but what's considered "part of the compilation process" is different between Rust and C. Most of the examples of "this is what makes Rust compilation slow" are code generation related; for example, a Rust proc_macro making compilation slow would be equivalent to C building a code generator (for schemas? IDLs?), running it, then compiling the output along with its user.