Introduction to Programming Language Theory and System Design
using the Timber language
Review Questions - Theory
- Programming languages.
- What is a formal language?
- What is a programming language? Can any programming language be considered a formal language?
- Give an example of ambiguity in semantics of some programming language.
- Give examples of syntactically correct and syntactically incorrect terms; well-typed and not well-typed terms in some programming language.
- Give two examples of language features, libraries, and design patterns.
- What is the main idea of functional (imperative) approach to programming? Give an example of a typical functional (imperative) language construct.
- Lambda-calculus and operational semantics.
- What is lambda-calculus? What can it be used for?
- Give two examples of rules in operational semantics of lambda-calculus.
- What does it mean that an operational semantics for a language is deterministic?
- Can a non-deterministic operational semantics be unambiguous?
- What is the difference between call-by-value, call-by-name and call-by-need evaluation strategies? Illustrate on an example.
- 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)?
- Types.
- What is a type?
- What is a type system? Why are they used?
- Give an example of a typing rule.
- What is a type signature?
- Give examples of an untyped language; a language with explicit typing; a language with implicit typing.
- What is the difference between static and dynamic typing? Explain on an example.
- Explain (using examples) how static and dynamic type-checking is performed.
- What is type inference?
- Explain (using an example) how type inference is performed.
- Give an example of a recursive type.
- Give an example of a recursive data structure.
- What is subtyping?
- What is polymorphism? What are the advantages (and drawbacks) of writing polymorphic code?
- Object-oriented programming.
- Explain the main ideas of object-oriented programming (state encapsulation and multiple representation).
- What is an interface in OO design?
- What is a class in OO design?
- What is inheritance (subclassing)?
- What is shadowing of methods?
- Explain the notion of "open recursion" (late-binding of self) in some OO languages.
- Parallelsim and concurrency.
- How can system performance be defined?
- Define responsiveness.
- Define throughput.
- What is the difference between parallelism and concurrency?
- Explain the notion of task-level parallelsim.
- What is a thread of execution (notionally and implementation-wise)?
- Explain the notion of thread-level parallelism.
- Explain the notion of instruction-level parallelism.
- What are the difficulties with using threads that language designers try to overcome by introducing other language constructs?
- What is the difference between visible and transparent parallelism? Give examples.
- Software system design.
- What is a (software) system design methodology? Give examples of such methodologies.
- Explain the properties of correctness, relaiability, robustness, maintainability.
- Explain the notion of quality of service.
- What is a model of a system?
- How a model can be used in the process of system design?
- What is a modeling language?
- What is an interface description language? Give an example.
- Explain the main ideas of Design by Contract.
- What is a distributed system?
- Describe the goal of middleware such as CORBA and .NET.
- What is an embedded system?
- What is the main idea of platform-based design?
- What are the goals of component-based design?
- Give a definition of a software component.
Review Questions - Timber
- How objects are created in Timber?
- What is a state variable and where can it be accessed / updated in Timber?
- Give an example of a class expression.
- Give an example of a function in Timber. What is the difference between a function and a method (action, request) or a procedure?
- What is the difference between an expression and a command? Why are they separated in Timber?
- What is a binding?
- When can two methods execute concurrently?
- How is state protection guaranteed in Timber?
- Give an example of method invocation. Is there any limitation on where a method can be invoked?
- Give an example of method definition. Is there any limitation on where a method can be defined?
- Give an example of a procedure. Can a procedure return a value? Is there a limitation on where a procedure can be defined / invoked?
- What is the difference between a procedure and a method (action, request) in Timber?
- Describe syntax and give examples of if- and case-expressions; if- and case-commands. Where each of them can be used?
- Give examples of pattern matching in a function definition and in a case-expression or -command.
- Give examples of function definition with guards.
- What happens if none of the patterns in a function definition match? In a case-expression or -command?
- Give an example of a partial application of a function.
- How are the first objects created in a Timber program?
- How do we define which procedures, or methods of which objects are invoked in reaction to external events?
- What are the two sources of concurrency in Timber?
- Why do we call Timber a reactive programming language?
- What are the baseline and the deadline for an action? What is their significance for program execution? How are they set in the code?
- How do we define lists, tuples, arrays in Timber?
- How do we access / update elements of an array? Can an array value that is not a state variable be mutated (updated)?
- How do we define struct values and struct types in Timber?
- Explain the {..}-notation.
- Give an example of a recursive definition of a function; a recursive group of bindings.
- Give examples of primitive types, data types, and struct types in Timber.
- Give examples of type constructors in Timber.
- Explain why and how typeclasses are used in Timber.
- Give examples of how Timber can be used as a modeling language.
- How can periodic actions be specified in Timber?
- How can jitter in periodic actions be bounded in Timber?
Updated on May 28, 2010.