<commit_before><commit_msg>Create ws12.md<commit_after># WS12: Static and Dynamic Libraries (optional)
Static and dynamic linking collect and combine multiple object files in a single executable.  
Linking, performed by programs called linkers, can be performed at:
* **compile time**: the source code is translated into machine code (last step in compilation)
* **load/run time**: when the program is loaded into memory and executed by the loader

## Linking
Instead of a large application in a single source file, it is better to have smaller, more manageable, sources which may be compiled separately.

Static linking:
* All library routines used are copied in the executable.
* More space used on the disk and in memory.
* Faster and more portable (no dependencies).

Dynamic linking:
* Shareable library name is placed in the executable image and actual linking takes place at run time
* Sharing a single shareable library among multiple programs.
* Executables are smaller.

Missing function definitions:
* During compilation: compiler assumes that the function is defined in another file, and treats it as an external reference. The compiler does not look at more than one file at a time.
* During linking: linker may look at multiple files and seeks references for the modules that were not mentioned, complaining when they are not found.
{'fraction_non_alphanumeric': 0.045319465081723624, 'fraction_numerical': 0.0029717682020802376, 'mean_word_length': 4.882096069868996, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '753645', 'n_tokens_mistral': 315, 'n_tokens_neox': 297, 'n_words': 200}