Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While I can see compiler authors not wanting to have to turn the compiler into a build system, I'd really appreciate if they did do that. Having to create makefiles or other build artifacts is such a waste of energy for most applications.


Shifting more of this to the compiler is logical, because import rules are defined by the language, not by the build system. In fact, today build systems function by asking the compiler to output a list of transitive includes, so it knows which files to rebuild when someone touches a header.


Build systems are far more complex than anyone thinks. If your build system doesn't cover all the weird things we do it is not usable at all.


But oth, nothing is better at dealing with edge cases and weird things than writing your build scripts in an actual programming language. All that an integrated C++ build system would do is add a new std::build API, and for the compiler to discover a build.cpp file, compile and run that to perform the build. All the interesting "build system stuff" stuff would be implemented as regular stdlib code.

See Zig for a working example of that idea (which also turned out to be a viable cmake replacement for C and C++ projects)

It could even be reduced to compiler vendors agreeing on a convention to compile and run a build.cpp file. Everything else could live in 3rd party code shipped with a project.


Real build systems need to deal with any language. Cargo is a negative on large projects because it has opinions that make things easy for small rust only projects and falls flat on complex projects-

good build systems need to bea real programming language. The more declaritive the better - this is different from the project that often should be a different style


As long as the build system can run external programs, you're really not limited to a single language (or even compiling source code). In the end build systems are just fancy task runners, no matter if they are integrated with a language toolchain or separate products.


Sortof. If the build system doesn't understand the dependencies you have inefficient builds as it can't schedule all cores effectively at all times. On a large complex project this matters


You can just fall back to some other tool in a complex case. That's what people do with a number of other languages.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: