5 ms·
Perhaps a better question is, what are compiler authors optimizing for? A compiler that runs in 3 seconds that produces code that's half the speed as a compiler
by manfredo 6y ago
Perhaps a better question is, what are compiler authors optimizing for? A compiler that runs in 3 seconds that produces code that's half the speed as a compiler that runs in 3 minutes is a worse option than the latter in plenty of use cases. And if we really care about minimizing compile times (and if we're being a little pedantic) we can just use an interpreted language and achieve zero compile times, by virtue of not doing any compiling at all.
Rust and Pascal have different use cases in mind. I think a better question would be what are the different design philosophies between the two languages, and how this impacts compiler implementations.
- samatman 6y agoThere is an amount of time spent compiling which has a qualitative effect on my programming. I start to feel it around ten seconds, definitely by thirty; three minutes is way over the line. I start to be reluctant to make small tweaks. I want to program in 'blocks', time compiling with bathroom breaks. My frame is just wrecked, and I'm fairly convinced that code quality suffers from this. I like what Zig is doing, by taking such care to keep unoptimized builds as fast as possible. Release builds can run overnight for all I care, I'm fine with taking arbitrary amounts of time to get the fastest end product I can have. But I firmly believe that a language which can't give me a build in a handful of seconds is missing out, and it's a real pity Rust is in that category. It's possible that a language with type inference and a borrow checker simply must have slow compile times, that it's inherent. I doubt that somehow, though I concede that one-pass compiling a la Turbo Pascal is likely impossible.
- darksaints 6y agoAre those your compile times with incremental compilation?
- samatman 6y agoThose are real compile times I've experienced, the post is about what it feels like for compiling to take "too long" and approximately what "too long" is. Rather than what it's like to use a particular compiler on a specific project, at this moment in time.
- 082349872349872 6y agoPascal's original role was as a teaching language. Students will invariably compile multiple times making many errors along the way, but never run their final iteration in production. For those who don't remember "funny money" I'll point out that, not only did we wear onions on our belts, but CPU usage was charged back in the day. :beratna owte wameku ere nebula:
- chungy 6y ago> not only did we wear onions on our belts It was the style at the time.
- saagarjha 6y agoWell, ideally you have both! For what I’m working on right now, a plain debug compile takes an hour. Since I usually interact with a debug build for just a few minutes (if I’m not playing tricks) I would really like a “make this faster to compile but slower to run” option. (I doubt one could exist, but you never know.)
- pjmlp 6y agoExcept you are forgetting that with many native compilers, I can choose to wait 3 seconds or 3 minutes, I am not stuck with a frozen compile time, because their toolchains allow me to choose how long I am willing to wait, including the option to use binary libraries on their package managers. D, C++, Ada, Eiffel, Delphi,...