Fall 2024 - CSCI 308: Notes

  1. Introduction

Fall 2024 - CSCI 308: Notes

  1. Paradigms & Compilers What you need to know:
    • Paradigms: Imperative, Object Oriented, Scripting, Declarative, Functional, Logical
    • Hallmarks of each paradigm
    • Compilations forms: compiler, interpreter, just-in-time (JIT)

Fall 2024 - CSCI 308: Notes

  1. Values & Types What you need to know:
    • What is primitive data types?
    • Implicit v.s. explicit type coercion
    • Six common type constructors (e.g. cartesian)
    • Implicit v.s. explicit variable declaration
    • Implicit v.s. explicit typed variables

Fall 2024 - CSCI 308: Notes

  1. Object Oriented Paradigm What you need to know:
    • Static v.s. dynamic method binding
    • How do typing and method binding interact?
    • Adhoc v.s. inclusion v.s. paremtric polymorphism
    • Multiple inheritance
    • Computational v.s. structural reflection

Fall 2024 - CSCI 308: Notes

  1. Type Checking What you need to know:
    • How to typecheck Java-light using correct function order checking, inference, equivalence, and coercion.

Fall 2024 - CSCI 308: Notes

  1. Scope and Enrivornment
    What you need to know:
    • Define identifier, environment, scope, attribute, binding
    • Dynamic v.s. static scope
    • Be able to fill in a chart showing the identifiers and their bound attributes as a program is compiled/runs
    • Be able to identify which scope (dynamic, static, or irrelevant) a language is using

Fall 2024 - CSCI 308: Notes

  1. Logic Paradigm What you need to know:
    • What is the logic paradigm used for?
    • Relations in logic languages v.s. functions in procedural languages
    • Identify four sorts of query in Prolog
    • Create Prolog programs using atoms, facts, rules, and lists
    • "=" v.s. "==" v.s. "is" in Prolog

Fall 2024 - CSCI 308: Notes

  1. Memory

Fall 2024 - CSCI 308: Notes

  1. Memory - What you need to know:
    • Memory diagrams for imperative languages
    • Stack v.s. Heap v.s. Data/Globals/Text segments
    • Draw diagrams of primitives, references, objects, and arrays, and stack frams for Java, C++, and Python
      • Able to draw a picture of memory that changes as the program runs
      • Label your memory picture with types, variable names, and values

Fall 2024 - CSCI 308: Notes

  1. Memory - What you need to know:
    • Modify diagrams to show changes in state for Java, C++, and Python
    • Know what is allocated in which segment
    • Know the name of the sort of allocation/deallocation
    • Know the choices a language could have for initial values
    • Define alias, side effect, dangling reference, and memory leak

Fall 2024 - CSCI 308: Notes

  1. Memory - What you need to know:
    • Explan how each hazards affects memory
    • Identify environmental hazards in code (mainly C, possibly C++, Java, and Python)
    • Be able to write a copy constructor in C++ and Java
    • Know the difference between deep and shallow copy and how they will affect a memory diagram

Fall 2024 - CSCI 308: Notes

  1. Scripting Paradigm What you need to know:
    • Hallmarks of scripting languages
    • Write regular expressions (basic, unix extras, and more)
    • Know the differences between first possible match, total first match, longest possible match, and greedy v.s. non-greedy search

Fall 2024 - CSCI 308: Notes

  1. Declarative Paradigm What you need to know:
    • Hallmarks of declarative languages
    • Create/drop databases and tables
    • Write SQL queries

Fall 2024 - CSCI 308: Notes

  1. Functional Paradigm

Fall 2024 - CSCI 308: Notes

  1. Functional Paradigm - What you need to know:
    • What this paradigm is good at doing
    • Disginguish between where and let
    • Pattern matching - what will match which given pattern
    • Type inference - what type will be inferred
    • Algebraic data type - list, tuple, enum, cartesian, recursive
    • Implement a given formal type in Haskell

Fall 2024 - CSCI 308: Notes

  1. Functional Paradigm - What you need to know:
    • Understand and use head and tail list access. i.e. using (h:t) pattern matching.
    • Anonymous function in Haskell
    • What currying means to a functional language
    • What higher order functions are
    • Write and use higher order functions - map, filter, fold
    • Use function composition in Haskell

Fall 2024 - CSCI 308: Notes

  1. Procedural Paradigm

Fall 2024 - CSCI 308: Notes

  1. Procedural Paradigm - What you need to know:
    • Define procedural paradigm (brings us functions)
    • Define terminology: side effect, expression, statement, return value, function, procedure, referential transparency, referential opacity, argument, parameter, operator, operand, subexpression, unary, binary, infix, prefix, postfix, mixfix
    • Recognize occurrences of terminology in code
    • Give examples of terminology in code

Fall 2024 - CSCI 308: Notes

  1. Procedural Paradigm - What you need to know:
    • Know how strict evaluation works with pass by value and pass by reference
    • Be able to state what happens/prints when a strict evaluation program with either pass by reference or value runs
    • Classify a language as strict eval and either pass by reference or value given some code and what it prints
    • Classify a language as strict or non-strict eval given some code and what it prints

Fall 2024 - CSCI 308: Notes

  1. Procedural Paradigm - What you need to know:
    • Know how non-strict evaluation works with call by name and call by need
    • Understand how passing a reference works
    • Be able to use side effects (printing, setting global variables or member data, doing slow operations) to tell strict and non-strict evaluation apart
    • Know how short circuit works
    • Be able to tell what prints w/ & w/o short circuit
    • Be able to test a language to see if it is using short circuit

Fall 2024 - CSCI 308: Notes

  1. Syntax & Semantics

Fall 2024 - CSCI 308: Notes

  1. Syntax & Semantics - What you need to know:
    • Know the difference between context free and regular or context sensitive grammars
    • Apply context free grammars to generate sequences
    • Know Backus-Naur format for grammars
    • Given a grammar, draw parse trees for statements, expressions, and programs
    • Define and identify ambiguous grammars
    • Explain precedence order and associativity
    • Know the difference between left and right associativity

Fall 2024 - CSCI 308: Notes

  1. Syntax & Semantics - What you need to know:
    • Create precedence order and associativity rules to eliminate ambiguity in grammars
    • Recognize when a language suffers from dangling else
    • if there is a dangling else problem, be able to state the solution (closest unmatched if, the un-named solution)
    • If there is not a dangling else problem, be able to show why there was no problem (forced indents, forced end-if, always else, must have braces)