3 ms·
bit off-topic, but why is it called a linker? I would have thought a more relevant name like optimiser or pruner or something.
by test1235 8y ago
bit off-topic, but why is it called a linker? I would have thought a more relevant name like optimiser or pruner or something.
- chrisseaton 8y agoThis is a common usage of the term. See the JVM linker for example, which performs similar tasks. A linker historically took multiple machine code files and produced an executable, possibly arranging it in a certain way following some directives, and checking connectivity. The .NET is a virtual machine, so this applies that same concept on top of that abstraction, taking intermediate representation files for that virtual machine and producing more intermediate representation, possibly re-arranged. Removing unused parts is a kind of re-arranging and checking connectivity. You could perhaps call it a 'tree-shaker' if you wanted, but the name 'linker' isn't any kind of ignorance or pretence.
- porpoisely 8y agoBecause it's part of the linking process. The linking process brings together dependencies to produce the final product ( an assembly in the .net world ). The .NET IL linker may "link" the bare minimum resources necessary, but it still links the bare minimum resources. Also optimization, pruning, etc can happen in every stage of the building process. Preprocessing, compiling, assembly, linking, etc can have optimization. In .NET optimization and pruning can occur post build. The JIT can optimize, prune, etc. Even the native code can be optimized by the runtime. Even hardware like the CPU can perform optimization on your executable. So optimizer or pruner would be an even more confusing name.