%TOPIC%

From LRDE

Revision as of 14:11, 9 June 2014 by Cd (talk | contribs) (Ccmp logs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


This page contains the log of the topics of

for AppIng1 students of class EPITA 2014 (i.e., from January to June 2012). The topic was started with the Formal Languages Course (THL).


CMP 1

Lecture 1: 2012-01-05, 3 hours: Introduction to the Project (%roland%)

  1. The Tiger Project. See the lecture notes:

tiger-project-intro.pdf, tiger-project-intro-handout.pdf and tiger-project-intro-handout-4.pdf.

    1. Ressources (http://www.lrde.epita.fr/~akim/ccmp/).
      1. Assignments (http://www.lrde.epita.fr/~akim/ccmp/assignments.html).
      2. Appel's books.
      3. Tiger Compiler Reference Manual (http://www.lrde.epita.fr/~akim/ccmp/tiger.html).
      4. epita.cours.compile.
    2. Goals (C++, OO, DP, Management, Several Iterations, Testing, Documenting, Maintaining, Fixing, Understanding Computers, English).
    3. Non goals (Compiler Construction).
    4. Rules of the Game.
      1. No copy between groups.
      2. Tests are part of the project (test cases and frameworks should not be exchanged).
      3. Fixing mistakes earlier is better.
      4. Work between groups is encouraged as long as they don't cheat.
    5. Tests.
      1. Tests matter.
      2. Rules.
        1. A bug => a test.
        2. A suspicious behavior => one or several tests to isolate it.
        3. Don't throw away tests!
        4. Don't exchange tests! (bis repetita).
    6. C Compilation model (cpp, cc1, as, ld).
    7. Tiger Compiler pipeline (front end only)
    8. Compilers handling multiple input (sources languages) and multiple outputs (target assembly languages/processors).
      1. The case of GCC.
      2. Factoring the compiler components: intermediate representation(s).
      3. Front-end and back-ends.
    9. Other compilation strategies.
    10. The Tiger Compiler pipe (annotated with tools and steps).
      1. Front-end: TC-0 - TC-3 (mandatory part), TC-4 - TC-5 (optional part).
      2. Back-end: TC-6 - TC-9 (optional part).
    11. Misc: students should overcome Make, Makefiles and seperate compilation, etc.
  1. Development Tools, section 1 (tc Tasks). See the lecture notes:

dev-tools.pdf, dev-tools-handout.pdf and dev-tools-handout-4.pdf.

    1. tc architecture and tasks

Lecture 2: 2012-01-06, 3 hours: Development Tools (%roland%)

  1. Autoconf and Automake
    1. History: Unix, Unices, configuration systems (imake, configure), portability issues (broken tools, broken/missing functions, libraries, etc.).
    2. Generating configure with Autoconf
      1. The choice of (a subset of) the Bourne Shell for portability reasons.
      2. Generating to encapsulate tests, simplify, shorten and reuse shell script bits.
      3. Using the M4 macro language.
      4. Autotools Diagram: Autoconf.
    3. Generating Makefile (s) with Automake and configure.
      1. Generating to simplify and shorten portable Makefile bits.
      2. Substituting variables (@VAR@) in Makefile.in using configure (BTW: variables listed in configure --help).
      3. Completing the Autotools diagram: Automake.
      4. Developer side vs User side.
    4. A word on aclocal.
    5. Hands-on example.
      1. A simple program.
        1. Writing hello-world.cc.
        2. Adding Makefile.am.
        3. Running autoscan.
        4. Adjusting config.scan to create config.ac (initializing Automake, avoiding autoheader).
        5. Running alocal, automake -a -c (and installing helpers) and autoconf.
        6. Running ./configure.
        7. Running make.
        8. Running ./hello-world.
      2. Adding a (static) library.
        1. Writing the client (hello.cc) and the library (greet.hh and greet.cc).
        2. Adjusting Makefile.am (lib_LIBRARIES vs noinst_LIBRARIES), and configure.ac (AC_PROG_RANLIB).
        3. Updating by running make (and not the Autotools).
        4. Compiling the client (hello) by adjusting Makefile.am (in particular, link to libgreet.a using hello_LDADD).
        5. Running make again.
        6. Running ./hello.
      3. Adding tests.
        1. TESTS in Makefile.am and make check.
        2. Compiling test-only (not installed) programs: check_PROGRAMS.
      4. Distributing.
        1. make dist.
        2. make distcheck.
        3. Don't forget to adjust the arguments of AC_INIT in configure.ac.
      5. Installing.
        1. make install.
        2. configure --prefix, $prefix, $bindir, $libdir, etc. and bin_, lib_ prefixes of primaries (PROGRAMS, LIBRARIES, etc.).
        3. make uninstall (careful, very limited).
    6. Misc.
      1. Generating tests with configure (e.g. so that they can find $srcdir).
      2. Changing variables (e.g. CXXFLAGS) at the configuration step (=./configure CXXFLAGS...=; global) or at the build step (=make CXXFLAGS...=; local).
      3. autoheader and config.h: getting rid of limitations of using -D options to pass options to the compiler.
      4. Pros and cons of using multiple Makefile s in a multi-directory project.
      5. srcdir vs builddir, running configure from a directory other than the source dir.
  2. Development Tools, section 2 and 3. See the lecture notes:

dev-tools.pdf, dev-tools-handout.pdf and dev-tools-handout-4.pdf.

Lecture 3: 2012-02-09, 3 hours: Abstract Syntax (%roland%)

  1. Abstract Syntax. See the lecture notes,

ast.pdf, ast-handout.pdf and ast-handout-4.pdf (up to section 2.3, included (``Visitors)).

  1. New features from C++ 2011 used in the Tiger Project.
    1. nullptr.
    2. consecutive right angle brackets (>>).
    3. Range-based for loops.
    4. auto typed variables.

Lecture 4: 2012-02-16, 3 hours: Abstract Syntax, Names, Identifiers and Bindings (%roland%)

  1. Abstract Syntax, up to the end. See the lecture notes,

ast.pdf, ast-handout.pdf and ast-handout-4.pdf.

  1. Names, Identifiers and Bindings (except section 3.2, ``Non Local Variables). See the lecture notes,

names.pdf, names-handout.pdf and names-handout-4.pdf.

Lecture 5: 2012-03-01, 3 hours: Names, Identifiers and Bindings (%roland%)

  1. Names, Identifiers and Bindings, up to the end. See the lecture notes,

names.pdf, names-handout.pdf and names-handout-4.pdf.

  1. Misc. topics
    1. C++ mangling and extern "C" declarations.
    2. A word on the inlining optimization.
    3. Rapid description of the organization of "memories", from the fastest/smallest/most expensive to the slowest/largest/cheapest: CPU registers, L1 cache, L2 cache, main RAM (and also disks).
  2. Preparation to the exam: step-by-step walkthrough of previous year's exam. See

epita-apping-2013-cmp1.pdf and epita-apping-2013-cmp1-correction.pdf.


TYLA

Lecture 1: 2012-04-27, 3 hours: History of Computing, History of Programming Languages (%roland%)

Lecture 2: 2012-05-04, 3 hours: History of Programming Languages, Object Oriented History (%roland%)

Lecture 3: 2012-05-11, 3 hours: Object Oriented History, Subprograms, Some Traits of Functional Programming Languages (%roland%)

Lecture 4: 2012-05-25, 3 hours: Types, Generic Programming (%roland%)

  1. Types. See the lecture notes (sections 1 and 2),

type-checking.pdf, type-checking-handout.pdf and type-checking-handout-4.pdf.

  1. Generic Programming. See the lecture notes (up to section 4.1, excluded),

generic.pdf, generic-handout.pdf and generic-handout-4.pdf.

Lecture 5: 2012-06-01, 1,5 hours: the Standard Template Library (STL), Template Metaprogramming, Concepts (%roland%)

  1. Generic Programming. See the lecture notes (up to the end),

generic.pdf, generic-handout.pdf and generic-handout-4.pdf.

  1. More on GP, concepts and links between GP and OOP.
    • OOP vs OOP
      • OOP: two levels: Interfaces and classes (compile time), instances (run time).
      • GP: three levels: Concepts (documentation/design time), models/types (compile time) and instances (run time).
      • Constraint through interface inheritance (OOP) vs lack of explicit constraint (classic GP) or implicit/explicit concept checking (C++ concept proposal)
    • Some elements of the "Concepts" proposal for C++
      • Intent: make concepts part of the language.
      • Writing concepts with concept.
      • Enforcing concept constraints on templates (require).
      • Mapping models to concepts with concept_map.
      • Adapting models to concepts with concept_map.
      • Setting up implicit links based on structural conformance between models and concepts using auto concept.