cs315:fall2013:cs315_main

CS315 - Programming Languages, Spring 2013

Objective

The objective of this course is to learn programming language design. We will look at various aspects of programming languages and discuss alternative designs and their tradeoffs. We will also look at various examples from different programming languages and thus increase our familiarity with a wide range of programming languages and tools. Importantly, this course will also teach you how to specify the syntax of programming languages and how to use tools (such as lex and yacc) to build syntax checkers for a programming language. If you like this course, you should consider taking the CS 416 Compiler Design course as a follow up.

Location and Times

  • Location: EB-101 (Engineering Building)
  • Times:
    • Section I: Tue 15:40pm-17:30pm and Fri 14:40pm-15:30pm
    • Section II: Tue 10:30am-12:20pm and Fri 9:30am-10:20am
    • First hour on Friday is the spare hour.
  • Office Hour: 10:40am-12:00pm, Fri, EA501

Course Material

  • Main Book: Robert W. Sebesta, Concepts of Programming Languages, Pearson (Tenth Edition)
    • Book slides are here.
  • Supplementary Book: Programming Language Pragmatics, Morgan Kaufmann (Third Edition)
    • This book has advanced topics covered in a CD.

Grades

  • Quizzes: 15% - 5 quizes, 3% each (on Friday lectures)
  • Homeworks: 15% - 3 homeworks, 5% each
  • Project: 20% - 2 sub-projects, 10% each
  • Midterm: 20%
  • Final: 30% - There is a 30 limit on the final for passing the course

Note: The midterm is mandatory. Those who did not take the midterm and do not have a valid excuse (medical report or special permission) will get an FZ from the course. They can't take the final. There will be only one make-up exam, which can be taken only by those who have missed the midterm exam and have a valid excuse. There is no make-up for the final, as the final-retake can be used for that.

Homeworks

Important Dates

  • Project Groups: Sep 30th
  • Homework 1 - Announced Sep 28th, due Oct 30th
  • Project Part 1 - Announced Oct 12th, due Nov 30th
  • Homework 2
  • Midterm - Open books and notes
    • Nov 8th, during class time
      • Section II: 8:30am-10:20am
        • Location TBD
      • Section I: 13:40pm-15:30pm
        • Location TBD
    • Loaction
  • Project Part 2
  • Homework 3
  • Make-up - Open books and notes
  • Final - Open books and notes

Course Topics

  • Preliminaries, Syntax and Semantics
  • Describing Syntax and Semantics
  • Lexical and Syntax Analysis (Lex & Yacc, Antlr)
  • Names, Bindings, Type Checking, and Scopes
  • Data Types
  • Expressions and the Assignment Statement
  • Statement-Level Control Structures
  • Subprograms
  • Implementing Subprograms
  • Abstract Data Types
  • Support for Object-Oriented Programming
  • Concurrency
  • Exception Handling and Event Handling
  • Functional Programming Languages
  • Logic Programming Languages

Project

The project is done by groups of 3 students. The project has 2 sub-projects to it.

  • Part I: Language design and lexical analysis
  • Part II: Syntax analysis of the designed language

You can find your group number from here.

Course TAs and Graders

Syllabus

We will have 15 weeks of classes. Each week will have 2 lectures, where each lecture consists of 2x 50 minutes with a 10 minute break in between. One of the hours of the Friday lecture is our 'spare hour' and will be used rarely.

  • Week 1 (week of 16/09-20/09)
    • Preliminaries, syntax, semantics
    • Sebesta: Chapter 1
    • Scott: Chapter 1
  • Week 2 (week of 23/09-27/09)
    • Context-free grammars, BNF, parse trees
    • Ambiguity, precedence, associativity, EBNF
    • Sebesta: Chapter 3.1, 3.2
    • Scott: Chapter 2.1.1., 2.1.2, 2.1.3
  • Week 3 (week of 30/09-04/10)
  • Week 4 (week of 07/10-11/10)
    • Lex and Yacc, a tutorial, note: you can also look at GNU Flex and GNU bison pages
      • You may need to replace -ll in the Makefile with -lfl if you are running the examples on the dijkstra machine.
    • A simple calculator using yacc. This interactive calculator let's you evaluate arithmetic expressions involving integer literals and variables.
    • A regular expression parser using yacc. This interactive regular expression parser creates ASTs out of regular expressions, and prints them in hierarchical form. Type A+(B|C?D)* and press enter to see it in tree form.
    • Another calculator. This interactive calculator is similar to the earlier one, but supports floating point operations as well. It is implemented as a recursive decent parser, without using a parser generator, for didactic purposes. It uses the LL(1) grammar we have seen in class to parse an arithmetic expression, creates an AST, and performs evaluation by traversing the AST.
    • We'll have both hours on Friday
  • Week 5 (week of 14/10-18/10)
    • No classes
  • Week 6 (week of 21/10-25/10)
  • Week 7 (week of 28/10-01/11)
  • Week 8 (week of 04/11-08/11)
    • Statement-Level Control Structures (self-study)
    • Overview for Midterm
    • Midterm
  • Week 9 (week of 11/11-15/11)
  • Week 10 (week of 18/11-22/11)
    • Implementing subprograms
    • Abstract data types (self-study)
  • Week 11 (week of 25/11-29/11)
    • Object oriented programming
      • mostly implementation of late binding
  • Week 12 (week of 02/12-06/12)
    • Exceptions
  • Week 13 (week of 09/12-13/12)
    • Concurrency, Threads and mutual exclusion
    • Concurrency, Conditional variables
  • Week 14 (week of 16/12-20/12)
    • Functional programming
  • Week 15 (week of 23/12-27/12)
    • Logic programming
  • Week 15.5 (week of 30/12)
    • Recap
    • No classes on Friday

Languages

Some suggestions for programming languages to get familiar with:

  • C: A systems language
  • C++: A multi-paradigm language
  • Java: An object-oriented language
  • Matlab: A scientific computing language (note: GNU Octave is a Matlab clone)
  • Python: A general-purpose scripting language
  • bash: A Unix shell scripting language
  • Haskell: A purely functional language
  • Scala: An OO functional language that runs on the JVM

In my personal opinion, a CS student should be familiar with at least the following languages:

  • A statically typed general-purpose programming language, such as C, C++, Java, C#
  • A dynamically typed scripting language, such as Python, Perl, Ruby
  • A shell scripting language, such as bash, csh, sh, etc.

Functional programming languages, such as Scala, Haskell, Scheme, etc. are perhaps not as commonly used in the industry, but they would broaden your perspective. Scientific languages, such as Matlab and R, would prove useful for research work. For the latter, I would suggest you look at Python's SciPy scientific computing package as well.

My favorite language? That would be the much hated C++.

cs315/fall2013/cs315_main.txt · Last modified: 2013/10/14 14:39 by bgedik

Page Tools