4 ms·
The fastest I've ever seen clang compiled, with ccache and in memory fs, was 7 minutes - which is a long time for a syntax check. Just browse any buildbot dash
by woodman 10y ago
The fastest I've ever seen clang compiled, with ccache and in memory fs, was 7 minutes - which is a long time for a syntax check. Just browse any buildbot dashboard. You could use libclang for interactive evaluation - but boy does it suck when the file that you're working on pulls in a page of headers. What you're suggesting is fine for anything that results in an executable named a.out, but it doesn't work for non-trivial software projects.
- nv-vn 10y agoMisspelling the keyword happens relatively early in the compiler pipeline (during parsing). If your build hasn't changed very significantly (i.e. something along the magnitude of <1000 lines changed that aren't scattered across tons of files) it should warn you within a few seconds. Anything else is a failure in the design of the compiler or build system. (In fact, outside of C or C++ compilation is usually much, much faster than what you cite). Non-trivial projects in better-designed languages can easily take a tiny fraction of that time.
- woodman 10y ago> If your build hasn't changed very significantly... Change one character in one file that gets linked at the end of the build, the syntax check would go from 7 minutes to 3.5 on average - still too slow. You're also overlooking conditional compilation, your change might break the build on another platform - the syntax won't be checked until it hits the buildbot that flips the right flags. > Non-trivial projects in better-designed languages... Ah, the lets redo-everything-in-x school of thought - good luck with that.