Introduction to Programming Language Theory and System Design

using the Timber language


Review Questions - Theory

  1. Programming languages.
    1. What is a formal language?
    2. What is a programming language? Can any programming language be considered a formal language?
    3. Give an example of ambiguity in semantics of some programming language.
    4. Give examples of syntactically correct and syntactically incorrect terms; well-typed and not well-typed terms in some programming language.
    5. Give two examples of language features, libraries, and design patterns.
    6. What is the main idea of functional (imperative) approach to programming? Give an example of a typical functional (imperative) language construct.
  2. Lambda-calculus and operational semantics.
    1. What is lambda-calculus? What can it be used for?
    2. Give two examples of rules in operational semantics of lambda-calculus.
    3. What does it mean that an operational semantics for a language is deterministic?
    4. Can a non-deterministic operational semantics be unambiguous?
    5. What is the difference between call-by-value, call-by-name and call-by-need evaluation strategies? Illustrate on an example.
    6. What is the difference between strict and lazy evaluation of function arguments; of an if-statement? How is strictness / laziness of evaluation connected to call-by-value and call-by-name evaluation strategies? Why is this important (e.g. in a language with side-effects)?
  3. Types.
    1. What is a type?
    2. What is a type system? Why are they used?
    3. Give an example of a typing rule.
    4. What is a type signature?
    5. Give examples of an untyped language; a language with explicit typing; a language with implicit typing.
    6. What is the difference between static and dynamic typing? Explain on an example.
    7. Explain (using examples) how static and dynamic type-checking is performed.
    8. What is type inference?
    9. Explain (using an example) how type inference is performed.
    10. Give an example of a recursive type.
    11. Give an example of a recursive data structure.
    12. What is subtyping?
    13. What is polymorphism? What are the advantages (and drawbacks) of writing polymorphic code?
  4. Object-oriented programming.
    1. Explain the main ideas of object-oriented programming (state encapsulation and multiple representation).
    2. What is an interface in OO design?
    3. What is a class in OO design?
    4. What is inheritance (subclassing)?
    5. What is shadowing of methods?
    6. Explain the notion of "open recursion" (late-binding of self) in some OO languages.
  5. Parallelsim and concurrency.
    1. How can system performance be defined?
    2. Define responsiveness.
    3. Define throughput.
    4. What is the difference between parallelism and concurrency?
    5. Explain the notion of task-level parallelsim.
    6. What is a thread of execution (notionally and implementation-wise)?
    7. Explain the notion of thread-level parallelism.
    8. Explain the notion of instruction-level parallelism.
    9. What are the difficulties with using threads that language designers try to overcome by introducing other language constructs?
    10. What is the difference between visible and transparent parallelism? Give examples.
  6. Software system design.
    1. What is a (software) system design methodology? Give examples of such methodologies.
    2. Explain the properties of correctness, relaiability, robustness, maintainability.
    3. Explain the notion of quality of service.
    4. What is a model of a system?
    5. How a model can be used in the process of system design?
    6. What is a modeling language?
    7. What is an interface description language? Give an example.
    8. Explain the main ideas of Design by Contract.
    9. What is a distributed system?
    10. Describe the goal of middleware such as CORBA and .NET.
    11. What is an embedded system?
    12. What is the main idea of platform-based design?
    13. What are the goals of component-based design?
    14. Give a definition of a software component.

Review Questions - Timber

  1. How objects are created in Timber?
  2. What is a state variable and where can it be accessed / updated in Timber?
  3. Give an example of a class expression.

  4. Give an example of a function in Timber. What is the difference between a function and a method (action, request) or a procedure?
  5. What is the difference between an expression and a command? Why are they separated in Timber?

  6. What is a binding?

  7. When can two methods execute concurrently?
  8. How is state protection guaranteed in Timber?
  9. Give an example of method invocation. Is there any limitation on where a method can be invoked?
  10. Give an example of method definition. Is there any limitation on where a method can be defined?
  11. Give an example of a procedure. Can a procedure return a value? Is there a limitation on where a procedure can be defined / invoked?
  12. What is the difference between a procedure and a method (action, request) in Timber?

  13. Describe syntax and give examples of if- and case-expressions; if- and case-commands. Where each of them can be used?
  14. Give examples of pattern matching in a function definition and in a case-expression or -command.
  15. Give examples of function definition with guards.
  16. What happens if none of the patterns in a function definition match? In a case-expression or -command?
  17. Give an example of a partial application of a function.

  18. How are the first objects created in a Timber program?
  19. How do we define which procedures, or methods of which objects are invoked in reaction to external events?
  20. What are the two sources of concurrency in Timber?
  21. Why do we call Timber a reactive programming language?
  22. What are the baseline and the deadline for an action? What is their significance for program execution? How are they set in the code?

  23. How do we define lists, tuples, arrays in Timber?
  24. How do we access / update elements of an array? Can an array value that is not a state variable be mutated (updated)?
  25. How do we define struct values and struct types in Timber?
  26. Explain the {..}-notation.

  27. Give an example of a recursive definition of a function; a recursive group of bindings.
  28. Give examples of primitive types, data types, and struct types in Timber.
  29. Give examples of type constructors in Timber.
  30. Explain why and how typeclasses are used in Timber.

  31. Give examples of how Timber can be used as a modeling language.

  32. How can periodic actions be specified in Timber?
  33. How can jitter in periodic actions be bounded in Timber?

Updated on May 28, 2010.