-
Notifications
You must be signed in to change notification settings - Fork 12
Adds initial draft for separate compilation #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
92a9a34
c42254b
ba6de1b
d84acea
45635e0
1022ea2
96bb445
bf8faef
0b0d33a
25620d9
49f1a56
55ec0c2
b698abe
2e82bd9
4f6a10a
5125283
cea2214
a303097
f5f70a4
61c29b7
3a05bb1
996a433
0635d33
71a6612
7313ec4
03e04d5
b51b857
9cf7ca0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| ## Module name: Separate Compilation | ||
|
|
||
| _Skeleton descriptions are typeset in italic text,_ | ||
| _so please don't remove these descriptions when editing the topic._ | ||
|
|
||
| ### Overview | ||
|
|
||
| _Provides a short natural language abstract of the module’s contents._ | ||
| _Specifies the different levels of teaching._ | ||
|
|
||
| This module outlines the issues involved in using separate compilation on multiple program files. | ||
|
|
||
|
vulder marked this conversation as resolved.
Outdated
|
||
| ------------------------------------------------------------------------ | ||
| Level Objective | ||
| ----------------- ------------------------------------------------------ | ||
| Foundational: Awareness of the existence of separate compilation | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
| Main: Awareness of supporting mechanisms and tools | ||
|
|
||
| Advanced: Awareness of technicalities and tools | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ### Motivation | ||
|
|
||
| _Why is this important?_ | ||
| _Why do we want to learn/teach this topic?_ | ||
|
|
||
| Any non-trivial program will span more than one source file. This makes separate compilation necessary. Separate compilation also leads to quick build times in projects under development. | ||
|
|
||
| ### Topic introduction | ||
|
|
||
| _Very brief introduction to the topic._ | ||
|
|
||
| ### Foundational: Using | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
| #### Background/Required Knowledge | ||
|
|
||
| A student: | ||
|
|
||
| 1. needs to have the text editor skills to split a single-file program into multiple files. | ||
|
vulder marked this conversation as resolved.
Outdated
|
||
| 2. needs to be able to split function and classes into their declaration and definition. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| #### Student outcomes | ||
|
|
||
| _A list of things "a student should be able to" after the curriculum._ | ||
| _The next word should be an action word and testable in an exam._ | ||
| _Max 5 items._ | ||
|
|
||
| A student should be able to: | ||
|
|
||
| 1. Split a single file program into main, one or more auxiliaries, and header files (or modules), all in one directory | ||
| 2. Compile and link a program that is spread over multiple files (again, all in one directory), either on the commandline or with a build system. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
| 3. Describe the functions of the various files involved: source, object, executable. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| #### Points to cover | ||
|
VictorEijkhout marked this conversation as resolved.
|
||
|
|
||
| 1. Necessity of having function be declared at the locus of use | ||
| 2. Solving this by explicit declaration or by using header files. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
| #### Caveats | ||
|
|
||
| _This section mentions subtle points to understand, like anything resulting in | ||
| implementation-defined, unspecified, or undefined behavior._ | ||
|
|
||
| 1. Explain differences (including in desirability) between having explicit declarations of functions in the main program versus using header files or modules. | ||
| 2. Compilation on a single commandline versus multiple. Resolution order when linking. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
| 3. What needs to be recompiled if only a function is altered? Altered in use syntax versus altered only in semantics. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Main: implementing | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
| #### Background/Required Knowledge | ||
|
|
||
| * All of the above. | ||
|
|
||
| #### Student outcomes | ||
|
|
||
| A student should be able to: | ||
|
|
||
| 1. Use compile flags, including `-I` and `-L` search path flags. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
| 2. Make header files for their own code, including using header guards. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
| 3. Use include directives for the headers of external libraries. | ||
| 5. Be able to declare `extern` variables. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
| #### Caveats | ||
|
|
||
| 1. Build systems make things both easier and harder. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
| #### Points to cover | ||
|
|
||
| 1. Cover the mechanisms for include and library paths to your own code, as well as discovery mechanisms for external libraries. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From reading the ASBATs, we probably need more points to cover that contain the skills necessary to reach the ASBAT level.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed with the latest commit. |
||
| ### Advanced | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
|
|
||
| _These are important topics that are not expected to be covered but provide | ||
| guidance where one can continue to investigate this topic in more depth._ | ||
|
|
||
| 1. Language inter-operability: the `extern "C"` mechanism. | ||
| 2. Linker conventions including name mangling. | ||
| 3. The `nm` tool for inspection object files and libraries, including de-mangling. | ||
| 4. Understand the issues involved in deciding between include guards and `#pragma once`. | ||
|
VictorEijkhout marked this conversation as resolved.
Outdated
VictorEijkhout marked this conversation as resolved.
Outdated
|
||
Uh oh!
There was an error while loading. Please reload this page.