2 ms·
> since the language implementation requires that the notion of compilation configuration exists This is not true for most languages. I can use a build system
by PaulDavisThe1st 5y ago
> since the language implementation requires that the notion of compilation configuration exists
This is not true for most languages. I can use a build system that has its own options, and in the build specification I can say:
if (defined (build_option1)):
sources += source_file1
else
sources += source_file2
The compiler and linker have no idea that there is any choice between the two source files, or that the build time option exists.
The two files can each provide the same functionality (e.g. hand-coded SIMD asm, but for different target systems); nothing in the language knows anything about this.
- duped 5y agoThis is a rather outdated model for languages, for example the .NET CLR, Rust, Go, NodeJS, Python (and I believe the JVM?) all have module semantics or language specifications that describe how compilation units find each other, and the compiler () is responsible for mapping source files to import statements. The compiler is what is responsible for deciding which file is compiled and how it is configured to do so. () or de facto standard build tool like Cargo But that said the example is a little contrived since you wouldn't use a compile configuration to exclude a source file in most languages that have more flushed out module structures than C
- PaulDavisThe1st 5y agoI am not sure what interpreted languages would have to do with "compilation units", but perhaps I'm missing something. The example comes specifically from the build system for Ardour, where we have hand-written assembler and will incorporate different files into build depending on the target (SIMD) architecture and expected runtime environment. I would not call that contrived. I have no doubt at all that Cargo can handle many, even the majority, of projects of a certain scale. I have very strong doubts that a build system so centered on a particular language and with so many assumptions about how things are written and built can work for all projects. It's a problem when the build system falls down on the most demanding stuff, because it leads to people building "meta-build systems" around it, and we've seen how that turned out in the past.
- duped 5y agoInterpreted languages have compilers too, they just emit bytecode or an AST instead of object code. I think you're misunderstanding a lot of what I'm describing, it has nothing to do with Cargo or Rust but the fundamental limitations of C/C++ that explain why dependency management that involves either of them is extremely painful compared to any modern language.