6 ECTS credits
150 h study time

Offer 1 with catalog number 1002198BNR for all students in the 1st semester at a (B) Bachelor - advanced level.

Semester
1st semester
Enrollment based on exam contract
Impossible
Grading method
Grading (scale from 0 to 20)
Can retake in second session
Yes
Enrollment Requirements
Students computer sciences must have followed 'Structure of Computer Programs I', before they can enroll for 'Structure of Computer Programs 2'. Bachelor students physics and astronomy must have followed 'Introduction to Computer Science', before they can enroll for Structure of Computer Programs 2.
Taught in
Dutch
Faculty
Faculty of Sciences and Bioengineering Sciences
Department
Computer Science
Educational team
Elisa Gonzalez Boix (course titular)
Activities and contact hours
26 contact hours Lecture
26 contact hours Seminar, Exercises or Practicals
Course Content

This course confronts the student with modern, low-level programming languages that are used in practice (in casu C and its descendants) and demonstrates how and to what extent the concepts and techniques introduced in an introductory programming course such as "Structure of Computer Programs I" exist in or can be transposed to such a language. In addition, students are introduced to concepts that are unique to low-level languages such as manual memory management and pointers. 

Topics to be discussed during class:

1) Basics on program organization and development environments

  • Compilation, linking, relocating
  • The C preprocessor, header files, inlining, macro's
  • Make, debugging

2/ Fundamental programming concepts of C 

  • Addresses and data objects
  • Variables, types, operators, expressions, typedefs
  • Conditional and iterative control structures, other control instructions
  • Function definition, declaration
  • Scope rules 

3/ Data structures and abstraction

  • Pointers, Addresses and data objects, 
  • Arrays, character arrays, arrays as syntactic sugar for pointers
  • Structures, bit fields, unions
  • Dynamic memory allocation, memory leaks
  • Dynamic data structures, lists, trees
  • Function pointers and higher-order functions, relation to nested scopes, jump tables
  • Classic abstract data types, stack, queue

4) Input and Output

  • Standard library, standard I/O, formatted I/O. line I/O
  • FILEs, error handling
  • Basics of the system interface for I/O

5) Execution model and difference to higher-level languages

  • Stack frames, stack and functions, cdecl

  • Different kinds of memory errors, stack overflows

  • Functions: Recursive vs iterative processes
  • Advanced Topics in Memory model: 
   
        •       - Structured control flow, setjmp/longjmp

        •       - Scoping: dynamic and static scope

6) Low-level programming with a memory safe language

  • Fundamental concepts in Rust
  • Type system and ownership, ownership rules,  references and borrowing
  • Data structures and abstraction in Rust

 

Course material
Digital course material (Required) : Cursusnota's en slides beschikbaar, Canvas
Handbook (Recommended) : The C programming language, Kernighan and Ritchie, Second Edition, Prentice Hall, 9780131103627, 1988
Handbook (Recommended) : Pointers on C, Kenneth Reek, First Edition, Pearson, 9780673999863, 1997
Additional info

During the classes, slides will be projected. These slides are made available ahead of time on Pointcarre. Additional course notes and sample programs shown during the classes are also made available on Pointcarré for further inspection and extensions during lab sessions where applicable. 


In addition, the following reference books are recommended:
- The C Programming Language (Kernighan and Ritchie)
Pointers on C (Kenneth Reek)

Learning Outcomes

General competences

This course is an introduction to low-level programming languages. There is a strong focus on the manner in which computer programs can be structured and developed in languages of which the execution no longer relies on a virtual machine or interpreter, and in which the developer has to manually manage resources such as memory. The course focuses on studying C  and a number of concepts from higher-level programming languages. It is primarily Scheme/Python and C that are compared, but other languages complete the comparison. Alternative solutions for low-level programming with a memory safe language are also discussed, zooming in Rust.

By the end of the course, the student masters common programming concepts, as incorporated in low-level languages such as the C language and its descendants. In particular, student has theoretical knowledge and insight in pointers, manual memory management, and stack-based runtimes. The student has also the necessary vocabulary to explain and compare these concepts in a discussion. The students will also able to apply such knowledge into practice and develop software using the compilers and debuggers offered by traditional Unix-based environments for the C language. The student is also able to bring the knowledge and insight into practice by completing programming assignments in this medium that satisfy a given set of objective quality criteria.

Students should be able to communicate clearly about the topics studied. This is done by asking students to submit a written report about their programming project. Students are also able to justify a design or made choice. This is done by asking them questions on their project during the oral defense.


After having completed the course, students should have acquired the necessary foundational knowledge for them to be able to go deep on topics which require low-level programming skills (e.g. systems programming, language implementation).

Grading

The final grade is composed based on the following categories:
Written Exam determines 50% of the final mark.
SELF Practical Assignment determines 50% of the final mark.

Within the Written Exam category, the following assignments need to be completed:

  • Written exam (closed book) with a relative weight of 1 which comprises 50% of the final mark.

    Note: Written exam (closed book)

Within the SELF Practical Assignment category, the following assignments need to be completed:

  • Individual programming project with a relative weight of 1 which comprises 50% of the final mark.

    Note: Individual programming project with oral defense

Additional info regarding evaluation

Students will be graded based on a written exam about the theory (50%) and a programming project that is to be completed and defended individually (50%). Students need to obtain at least 8/20 in each evaluating part to be able to get a score for the entire course. If the scores for all parts are not higher than 8, the lowest score is used for the final mark. Absence in one of the parts implies absence for the entire course. Partial marks for the exam or project, if the student obtains at least half of the score for this part, are transferred to the second session. Students may not relinquish partial marks.

The written exam is a closed book exam in which the knowledge and insight of the student is tested with respect to the topics discussed during the course (see table of contents). The student is expected to synthesize important aspects of a topic  as well as to complete short programming assignments; e.g., complete a program that satisfies a given set of objective quality requirements, analyse a piece of program with respect to well defined criteria, etc.

The programming project will be made known with specifications about the end product. The project will consist of different phases that will be specified beforehand in the assignment, i.e. starting from a given low-level application of which a template has been sketched, student needs to complete a program which represents a part of the overall end product. The student delivers the implementation of the project together with a report summarizing made choices. The project will be orally defended.


Allowed unsatisfactory mark
The supplementary Teaching and Examination Regulations of your faculty stipulate whether an allowed unsatisfactory mark for this programme unit is permitted.

Academic context

This offer is part of the following study plans:
Bachelor of Physics and Astronomy: Default track (only offered in Dutch)
Bachelor of Computer Science: Default track (only offered in Dutch)
Bachelor of Artificial Intelligence: Default track (only offered in Dutch)