3 ms·
A lot of us realized over the years that compilation time was a productivity killer. The workflow can be adapted to slow compilation, obviously, with some disc
by stephc_int13 3y ago
A lot of us realized over the years that compilation time was a productivity killer.
The workflow can be adapted to slow compilation, obviously, with some discipline and a less iterative process.
But the ideal "flow" for many coders is attained with zero interruptions and being able to write-compile-test in a seamless fashion.
I think that the success of interpreters in many fields is related to this.
Modern compilers should maybe be split in two, a fast compile/slowish code/loose tests version and a "checks+release" one.
We have incredibly fast computers, instant compilation is feasible.
- amenghra 3y agoWe could do day-to-day Rust/C++/any compiled language related development with an interpreter/JIT and then compile the code once a PR is ready and the code hits CI/CD or gets deployed. The "instant" runtime doesn't even need to have the exact same behavior -- it can be 99% accurate and still be very useful.
- rewmie 3y agoWhy would anyone subject himself to that? All mainstream build systems already support incremental builds, and in some cases it's even possible to leverage compiler cache to further shave down the time it takes to rebuild a project. Breaking down a monolithic project into submodules is all it takes to shave off a big chunk of time from a build.
- amenghra 3y agoImagine being able to set a breakpoint in a function, change something and ask the debugger to “travel” back in time and pretend the code was always what it’s been changed to. It’s something some languages give you but I’m not sure an incremental compiler is sufficient? These kinds of few seconds/minutes shaved add up and can impact one’s productivity.
- tomjakubowski 3y agofor that kind of thing I would imagine more late binding in the language is helpful at the level Rust works, late binding is hard to do but I don't think it's impossible. Name mangling and calling conventions are a couple big obstacles.
- silverwind 3y ago> Modern compilers should maybe be split in two, a fast compile/slowish code/loose tests version and a "checks+release" one. That's exactly what Vite is doing for JS. Nearly instantaneous dev build, and slow but thorough prod build which does all the expensive optimizations. It seems odd that compiled languages have not picked this up yet.
- paulddraper 3y agoTypeScript is a perfect example. It can compile with typechecking, or, due to the design of the language, without any consideration of types at all. This later mode is extremely fast, particularly with per file incrementality. (Unfortunately for reasons I cannot fathom, this is not part of tsc CLI. You have to use something like Babel that uses the TS compiler API.)