CCOM 4087 - Compiler Design - Spring 2020

University of Puerto Rico
Rio Piedras Campus
College of Natural Sciences
Department of Computer Science

Professor

Field Value
Name Humberto Ortiz-Zuazaga
Office NCL A-159
Laboratory NCL A-158
Telephone 787-764-0000 x88363
email humberto.ortiz@upr.edu
Web page https://ccom.uprrp.edu/~humberto/
Office hours Monday, Wednesday 10:00 AM - 12:00 PM
or by appointment

Credits

3 credits

Description

Introduction to compiling, structure of simple one-step compilers: syntax and lexical analysis, parsing, introduction to type checking, intermediate code generation, introduction to code generation and optimization. Discussion about tools for compilers design (e.g. Lex and Yacc).

Pre-requisites

  • High Level Programming Languages (CCOM 4029)
  • Computer Architecture (CCOM 4086)
  • Operating Systems (CCOM 4017)

Content

  • Introduction to compiling

  • Simple one pass compilers

  • Lexical analysis

  • Symbol tables

  • Parsing

  • Syntax directed translation

  • Introduction to type checking and run time environment

  • Intermediate code generation

  • Introduction to code generation and code optimization

  • Discussion of tools in compiler design

Objectives

  1. Understand how the design of a compiler requires most of the knowledge acquired during their study

  2. Develop a firm and enlightened grasp of concepts learned earlier in their study like higher level programming, assemblers, automata theory, and formal languages, languages, languages specifications, data structure and algorithms, operating systems and computer architecture.

  3. Develop an in–depth knowledge of major topics in compiler design.

  4. Develop a fundamental understanding of various stages of compiling.

  5. Apply the ideas, the techniques, and the knowledge acquired for the purpose of other software design

  6. Develop fundamental knowledge of language specifications using context free grammars (CFG).

Course Schedule

Class will meet Tuesday and Thursday from 10:00 to 11:20 AM in NCL A-143. In UPR-RP attendance is compulsory.

Calendar

Rio Piedras delayed the start of classes until January 27, 2020 due to the earthquakes.

Date Topic Reading Assignment
Jan 28-30 Introduction to OCaml Learn OCaml in Y minutes
Feb 4 Introduction Lecture 1 depython
Feb 6 Toy compiler Lecture 2
Feb 11-13 Lexing and Parsing Real World OCaml Parsing parser
Feb 18-20 "variables" and stacks Lecture 3 let compiler
Feb 25-27 Conditional expressions Lecture 4 if compiler
Mar 3-5 Types Lecture 5
Mar 10-12 Function calls Lecture 6
Mar 17-19 Function definitions Lecture 7 function compiler
Mar 24-26 Type checking and inference Lecture 10 and Lecture 11
Mar 31 - Apr 2 Pairs and the heap Lecture 12
Apr 7 Mutable tuples Lecture 13
Apr 9-11 Spring break
Apr 14-16 First class functions Lecture 14
Apr 21-23 Objects Lecture 15
Apr 28-30 Optimization
May Advanced topics

Alternative Teaching Methods

Certification No. 112 (2014-2015) of the Governing Board defines a classroom course as a course in which 75% or more of the hours of instruction require the physical presence of the students and the teacher in the classroom. This means that 25% of a classroom course could be offered without requiring the physical presence of the students and the teacher in the classroom. If necessary, this course will be able to complete up to 25% of the contact hours (11.25 hours) on a non-face-to-face basis by alternative methods such as: videoconferences, instructional modules, discussion forums and others. If so, the calendar/agenda will be modified to include the topics that will be covered by alternative methods.

Instructional strategies

The professor will discuss each topic, students will complete a practical excercise for each compiler technique discussed in class.

Instructional resources

The course will be hosted on the UPRRP Moodle. Register and stay tuned for our polls and forum postings.

Textbook

The text for the course will be Ben Lerner's Spring 2020 Compiler lecture notes.

Students with no functional programming experience will probably need an additional text on OCaml. I can suggest the free textbook by Jason Hickey Introduction to Objective Caml. Or the textbook by Michael R. Clarkson Functional Programming in OCaml.

Software

We will be writing our compiler in the functional programming language Objective Caml. See the website for instructions to download ocaml and opam.

Evaluation

Students work will be evaluated on a 100% basis with the standard curve.

  • Participation in course forums (online, classroom), 25% final grade
  • Homework, 25% final grade
  • Quizzes, 25% final grade
  • Compiler project, 25% final grade

REGULATION ON DISCRIMINATION BY SEX AND GENDER IN THE FORM OF SEXUAL VIOLENCE

The University of Puerto Rico prohibits discrimination based on sex, sexual orientation, and gender identity in any of its forms, including that of sexual harassment. According to the Institutional Policy Against Sexual Harassment at the University of Puerto Rico, Certification Num. 130, 2014-2015 from the Board of Governors, any student subjected to acts constituting sexual harassment, must tum to the Office of the Student Ombudsperson, the Office of the Dean of Students, and/or the Coordinator of the Office of Compliance with Title IX for an orientation and/or a formal complaint.

REASONABLE ACCOMMODATION

The University of Puerto Rico complies with all state and federal laws and regulations related to discrimination, including “The American Disabilities Act” (ADA law) and Law #51 from the Puerto Rico Commonwealth (Estado Libre Asociado de Puerto Rico). Every student has the right to request and receive reasonable accommodation and Vocational Rehabilitation Services (VRS). Those students with special needs that require some type of particular assistance or accommodation shall explicitly communicate it directly to the professor. Students who are receiving VRS services shall communicate it to the professor at the beginning of the semester so that appropriate planning and the necessary equipment may be requested according to the Disabilities Persons Affairs Office (Oficina de Servicios a Estudiantes con Impedimentos –OSEI) from the Students’ Deanship office. Any other student requiring assistance or special accommodation shall also communicate directly with the professor. Reasonable accommodations requests or services DO NOT exempt the student from complying and fulfilling academic and course related requirements and responsibilities.

ACADEMIC INTEGRITY

The University of Puerto Rico promotes the highest standards of academic and scientific integrity. Article 6.2 of the UPR Students General Bylaws (Board of Trustees Certification 13, 2009-2010) states that academic dishonesty includes, but is not limited to: fraudulent actions; obtaining grades or academic degrees by false or fraudulent simulations; copying the whole or part of the academic work of another person; plagiarizing totally or partially the work of another person; copying all or part of another person answers to the questions of an oral or written exam by taking or getting someone else to take the exam on his/her behalf; as well as enabling and facilitating another person to perform the aforementioned behavior. Any of these behaviors will be subject to disciplinary action in accordance with the disciplinary procedure laid down in the UPR Students General Bylaws.

To ensure user data integrity and security, hybrid and distance education courses are offered through the institutional learning management system, which employs secure connection and authentication protocols. The system authenticates the users’ identity with the username and password of their institutional accounts. Users are responsible for keeping their password secure and not sharing with others.

References

  1. Andrew W. Appel. (1998) Modern Compiler Implementation in ML. Cambridge University Press. ISBN 0-521-60764-7.

  2. Fischer, C. N., Cytron, R. K., & LeBlanc, R. J. (2009). Crafting a compiler. Addison-Wesley Publishing Company. ISBN 0136067050 9780136067054