by stephendause · 3y ago · 0 comments
This is an interesting suggestion to me. Honestly, I consider a lot of other things like type safety and ergonomics of the language before I think about compile speed if at all.
However, that's not to say it's irrelevant. Perhaps I should be thinking about it more. I did notice that they didn't suggest any particular language with this comment. Compile speed seems like a difficult thing to compare between languages in general, since it would be difficult to make a genuine apples to apples comparison.
I've worked on projects with slow and fast compiles, and man, it's a completely different world. The way you think about problems and approach them, the way you approach adding new code, it's just completely different.
Slow compile times makes the entire process of adding, changing, or debugging the code slower. It makes it painful, frustrating, and more confusing. It's nonlinear. Doubling the time to compile a project can quadruple the time to solve problems, in my experience.
My experience has been somewhat opposite.
Long compile times lead you to put more thought into your program, roughly (obviously I'm way over generalizing here, it's actually the language itself that causes this but I'm waving my hands and positing that there's a rough correlation between compile speeds and language formality). Slow compile times mean you're not thinking about how your problem is modeled formally and just kinda gluing things together and seeing what happens at runtime.
While quick compile times may get you a system that kinda works more quickly than a language with slow compile times, in my experience you have to iterate much much before the problem is truly solved. When I user slower languages I find myself iterating fewer times before the problem is usefully solved. Not to mention I spend far less time fixing bugs.
Maybe it's all a wash, but slow languages definitely do not result in a quadratic slowdown in productivity...
Quick compile times may in some circumstances enable a sort of mentality of trial-and-error that I think is relatively common, but I don't think is a good approach to software development.
On the other hand, I don't think slow compile times are necessary to prevent this. Slow builds arguably more often lead to frustration and context switching. That isn't good either.
I think the best option is to have fast builds but also have enough discipline to not write code by trial and error.
Most projects I’ve worked on though, especially in their first few 100k lines of code didn’t really know exactly what problem are they trying to solve. Having something that kinda works in front if stakeholders / customers has been invaluable in actually getting the feedback and not wasting dev cycles on features nobody actually wanted.
Though granted “going back and doing things properly” has been as hard to achieve as “have complete requirements upfront”, so what do I know :-D
I believe the good compile speed is hinting at having shorter feedback loops in your workflow, and how it can significantly boost your productivity
It's something you'll do often and can have hidden costs. Especially with cases when it takes half an hour to build a software.
I’ve also worked on Java / Spring Boot projects that seem to take 10s of seconds to compile, and even longer to start up.
And TypeScript too.
I suspect the latter two have simple options which could improve things significantly, but I haven’t dug in.
Vanilla Java can be very quick to start and build, especially if you do incremental builds.
In my search engine project which is ~50kloc I have incremental builds that can be as fast as 1-2 seconds including running all pertinent tests[1], and the start time for the stuff that doesn't like populate an 12 Gb hashmap in memory upon start-up is also single digit seconds.
[1] A clean rebuild is 37 seconds; 108 seconds with a full suite of tests. That's fairly tolerable IMO. I've horror stories of Java builds that have had compile times anywhere between 15 and 45 minutes.
This then kicks the can down the road to the linker, and there’s been some work in this area as well with projects like mold.
Your system can be as type safe as it wants. It will never be type safe when tied to the systems of other companies, no matter what they say, or how they say their apis are supposed to work (assuming you have documented apis at all).
Being able to iterate quickly and test those connections is far more valuable to most businesses. At a certain scale, it probably flips, but at that point you're a huge company.
Also: compiletimes are not a property of just languages. It also depends how you use them. And languages with few guards and guarantees (like Go) of course compile faster - but you pay the price later.
When I then compile, its okay if it takes 10 seconds or 10 minutes.
In its earlier days, changing a single character in a typescript codebase implied a trip to the kitchen.
Now TS compilation is decently fast but intellisense became the bottleneck.