20-CS-4003-001 Organization of Programming Languages Fall 2018
Language Primer

Lambda calculus, Type theory, Formal semantics, Program analysis

All lectures

Description in Slides
    variables     How are variables stored in memory? What is a Stack? What is the Heap?
C and C++ code
    c.tar     Tar file containing all the code below (use: tar xf c.tar)
    makefile_c     Makefile for this section of c/c++ code (use: make -f makefile_c)
    pointers     Contents of pointer variables, dereferencing a pointer.
    classes-1     Redo the previous code except using classes.
    classes-2     What the Java code would look like translated to C++.
    dangling     Dangling pointers are possible in C++.
    f.cc     Problems trying to invoke the 'show' function for subclasses of 'top'
    top.h     Declaration of class 'top' used in f.cc
    list.cc     Used by f.cc
    list.h     Used by list.cc
    f_func.cc     fixes f.cc by holding a pointer to a ('show') function in 'top'
    top_func.h     Used by f_func.cc
    f_func_1.cc     fixes f.cc by tagging objects with pointer to 'show' functions
    top_func_1.h     Used by f_func_1.cc
    f_vir.cc : virtual     What virtual functions do - polymorphism.
    top_vir.h     Used by f_vir.cc
    list_vir.cc     Used by f_vir.cc
    function ptr     Pointers to functions support polymorphism in C (with void*).
    function ptr     As above but this time an array of pointers to objects is sorted.
    show stack     The stack can be displayed from code.
    buffer overflow     Buffer overflow can result in attacker opening a shell.
    return addr overwrite     Overwrite the return address on the stack to redirect control to malicious code.
Java Code
    classes-1     Contents of pointer variables, dereferencing a pointer (see classes-1 in C section).
    dangling     Protection against dangling pointers in Java (see dangling in C section).
    virtual     Virtual functions support polymorphism (see virtual in C section).
    library     The library used by the above code as a jar file.
    library     The source code for the above library.
    extension     The library works with a new, unanticipated type.
Make Executables
    Makefile     Makes all executables except the library.
        To make library from directory above virtest:
   javac virtest/*.java
   jar cfm virtest.jar .perms.txt virtest
where .perms.txt looks like this:
   Permissions: all-permissions