Interpretation and Compilation of Programming Languages

Objectives

Knowledge

1.To know the architecture and techniques used in the design and implementation of interpreters, compilers and type systems

2.To know the essential components of the design of programming languages and corresponding semantics

3.To define programming languages by composition of base elements

Application

4.To define algorithms of the abstract representation of programs

5.To describe language semantics by interpreting, compiler and verification algorithms

6.To design and implement compiler procedures targeting concrete virtual machines

Soft-Skills

7.To reason about complex systems at different levels of abstraction

8.To design general purpose designs based on first principles

General characterization

Code

8152

Credits

6.0

Responsible teacher

Bernardo Parente Coutinho Fernandes Toninho, Carla Maria Gonçalves Ferreira

Hours

Weekly - 4

Total - 52

Teaching language

Inglês

Prerequisites

Kmowlede of advanced programming, data structures and algorithms

Bibliography

- “Concepts in Programming Languages”, John C. Mitchell, Cambridge University Press. ISBN 0 521 78098 5 - “Essentials of Programming Languages”, Daniel Friedman, Mitchell Wand, Christopher Haynes, MIT Press. -- “Modern Compiler Implementation in Java” Andrew W. Appel, Cambridge University Press - “The Study of Programming Languages”, Ryan Stansifer, Prentice Hall International Edition.

Teaching method

The lectures introduce the various central topics to the course such as definitional interpreters, compilation techniques, intermediate representations, parsing and lexing, semantic analyses.

The labs consist in the implementation of small interpreters and compilers that illustrate the key concepts in small languages, incrementally, culminating in a larger sized project.

Evaluation method

The grading is made up of two components: theoretical-practical and practical.

The theoretical-practical component weighs 70% of the final grade and has a minimum requirement of 9.5 points. The grade is made up of two tests of equal weight, or an exam. The tests and the exam are in-person. The tests and the exam are closed book.

The practical component weighs 30% of the final grade and a minimum requirement of 9.5 points. The practical component consists of a medium-sized interpreter and compiler implementation project for a language presented throughout the semester. The project should be completed in groups of two students and the grades may require an oral or written discussion. Discussions (to assess each student''s understanding of the delivered programming projects) are mandatory, in person, and individual. In general, the student''s grade in the project is the minimum between the grade of the delivered project (carried out in a team) and their grade in the discussion project (which is zero if the student was absent).

All grades will be rounded to one decimal place, except the final grade which will be rounded to the nearest integer value.

Fraud and Plagiarism

Issues of fraud and plagiarism will be dealt with in accordance with the FCT NOVA Knowledge Assessment Regulation.

Students are allowed to talk to their colleagues about the programming projects and discuss solutions, but they are prohibited from sharing code (even only "a few lines") under any circumstances, whether orally or in writing. Writing code must be an internal task within each team. For example, displaying code on the screen, dictating code, sending files with code, or placing them on sites accessible to third parties is not permitted. It is considered that:

  • a team that gives or receives code is committing fraud;
  • a team in which only one member is working is committing fraud;
  • students who collaborate in larger groups, sharing code, are committing fraud.

The use of AI tools (such as ChatGPT or Copilot) must be explicitly mentioned in the code. A team that uses these tools while carrying out a programming project and omits their usage is considered to be committing plagiarism.

Subject matter

A.Principles 1.Programming Language Syntax 2.Programming Language Semantics 3.Interpretation levels, Principles of Language Processing and Compilation. B.Program interpretation and Compilation 1.Expressions and values; Definitions and environments 2.State and references; memory-environment model 3.Functional abstraction; first-class and higher order functions 4.Recursive definitions 5.Structured values: records and recursive values 6.Objects and Classes: Objects represented with records and closures C.Type Systems 1.Principles, goals and limitations of static analysis methods 2.Simple type systems: functional types 3.Verification and inference algorithms D.Compilers and Runtime support systems 1.Compiler architecture 2.Runtime support systems 3.Syntax driven code transformation 4.Code generation to intermediate languages (CLR, Java Virtual Machine)

Programs

Programs where the course is taught: