CS 3120 Spring 2003 Home Page

CS 3120 - Programming Language Concepts - 4 Credits 

Instructor: David Yang (885-3449, e-mail dyang@csuhayward.edu)

What is the best programming language? Is Java better than C++? What about .NET? The truth is that there is no “best” language. Different problems are often better served by different languages, and almost any language has its merits. We will examine in more detail the choices that are made when designing a programming language and gain experience with styles of programming other than the object-oriented and procedural styles you've experienced so far. From the start, we will consider some problems that are not easily solved by C++/Java/Perl/etc. We will cover in more detail what actually happens when the computer runs your program. I hope that after this course you will feel more comfortable picking up new languages and in understanding and evaluating the design of a language.

This course also serves as a prerequisite for CS 4110 Compiler Design – in particular, the material should help you in understanding the parsing phase of a compiler as well as generating code, especially for function calls when recursion is supported. In addition, while not strictly a prerequisite for CS 4810 Artificial Intelligence, the languages we cover here will be useful for that course.

Prerequisites:
CS 2360 Programming Methods and Introduction to Software Engineering
CS 2430 Computer Organization and Assembly Language Programming

Text:
Michael L. Scott, Programming Language Pragmatics, 1st ed., 2000, Morgan Kaufmann, ISBN: 1558604421.

Programming Languages:

We will focus on Scheme (a dialect of Lisp) and Prolog, for which there are versions you can download by clicking on these links:

Dr. Scheme download site   Local copy

SWI-Prolog   Local copy

    Note that you are not in general allowed to download to the machines at Hayward for reasons related to security and resources (the more disk space available, the more data there is to store).

Calculation of your grade:

Component

Percentage (%)

Written assignments

20

Programming assignments

20

Midterm

20

Final

40

 Lateness: Assignments need to be submitted to me through Blackboard by the deadline. Exceptions will be made under extreme conditions, but this would mean something like school closing/power outage.

Final grades will be given according to the following scale: 

93-100 A, 90-92 A-, 87-89 B+, 83-86 B, 80-82 B-, 77-79 C+, 73-76 C, 70-72 C-, 

67-69 D+, 60-66 D, 0-59 F

Academic Honesty: This course will follow the University's standard policy on academic dishonesty. In particular, any cheating, or assisting another students cheating on any test, or the final exam will be penalized by either a zero on the test, or by failure of the course, at my discretion.

Finally, if you cheat (whether you do the copying or let someone copy) twice during this course, you will automatically fail the course. Remember that the University may inflict further penalties than listed here under the provisions of the published Academic Dishonesty Policy. 

Attendance: I will take attendance through the end of the add/drop period. Note that while I will be uploading lecture notes to Blackboard after the lecture, they sometimes include material not covered in the text, and they include thought questions for class discussion that won't always be answered within the notes.

Classrooms: 

Monday, Wednesday, Friday 10:40am-11:50am Science North 336

Office Hours: My office is in room 433 (South) of the Science Building. My schedule for office hours is: 

  • Monday noon-1pm
  • Monday, Wednesday, Friday 2:45pm-3:45pm

I will also be available at other times -- if I'm free, you should feel free to stop by with any questions you have. You can make an appointment to make sure I'm available and free at that time, but it's not a big deal. This is the only source of individualized attention you get, so use it.

Tentative Schedule All days in red are mandatory. Days in green are holidays

    Week  Monday  Wednesday  Fridays
    Week 1 03/31/2003 
    Cesar Chavez Day -- no classes
    04/02/2003 
    Introduction
    Introduction lecture notes in RTF format

    Reading:
    Scott, chapter 1

    04/04/2003 
    Not-so-object-oriented problems, compiler modules, interpreter modules
    Notes for non-object-oriented problems in RTF format (Note that you probably have to download the file to read it)
    Notes for Compiler steps in RTF format

    Readings:
    Scott, pp. 594-5

    Week 2 04/07/2003 
    Specifying syntax, binding time
    Notes on EBNF, regular expressions

    Reading:
    Scott, pp. 31-38, 105-108

    Written homework #1 due 4/16, 10:40am via Digital Drop box

    04/09/2003 
    Architecture Review, Object Lifetime and Storage Management, Static Scope

    Reading:
    Scott, pp. 108-118 (required), 5.1, 5.3, 5.4 (if needed)

    04/11/2003 
    Dynamic scope, "first-class" functions
    Notes:
    Architecture and Storage
    Example:
    Recursive multiplication code

    Reading:
    Scott, pp. 129-144, 596-7

    Week 3 04/14/2003 
    Control flow -- expressions, conditionals, sequencing, selection

    Reading:
    Scott, 6.1-6.4

    04/16/2003 
    Control flow -- iteration, recursion

    Reading:
    Scott, 6.5, 6.6, 6.8

    04/18/2003 
    Scheme

    Reading:
    Scott, 6.5, 6.6, 6.8

    Week 4 04/21/2003 
    More Scheme
    04/23/2003 
    Designing solutions for functional languages
    04/25/2003 
    Types

    Reading:
    Scott, pp. 319-334

    Week 5 04/28/2003 
    Type conversion, compatibility, coercion, inference

    Reading:
    Scott, pp. 334-351

    04/30/2003 
    Aggregate types:

    Reading:
    Scott, pp. 351-362

    05/02/2003 
    More on arrays, Strings

    Reading:
    Scott, pp. 365-381

    Week 6 05/05/2003 
    Pointers, lists

    Reading:
    Scott, pp. 382-403

    05/07/2003 
    Review
    05/09/2003 
    Midterm
    Week 7 05/12/2003 
    Prolog

    Reading:
    Scott, pp. 624-641

    05/14/2003 
    Prolog, continued
    05/16/2003 
    Designing solutions for logic programming
    Week 8 05/19/2003 
    Subroutines

    Reading:
    Scott, 8.1, 8.2

    Last day to withdraw

    05/21/2003 
    Parameters

    Reading:
    Scott, 8.3

    05/23/2003  
    Generic subroutines, exceptions

    Reading:
    Scott, 8.4, 8.5

    Week 9 05/26/2003 
    Object-oriented programming

    Reading:
    Scott, 10.1, 10.2

    05/28/2003 
    Initialization, Finalization

    Reading:
    Scott, 10.3

    05/30/2003 
    Dynamic Method Binding

    Reading:
    Scott, 10.4

    Week 10 06/02/2003 
    Modules

    Reading:
    Scott, pp. 122-129, 539-542

    06/04/2003 
    Knowledge representation using Scheme and Prolog
    06/06/2003  Review
    Week 11 06/09/2003 
    Final exam, 11 AM-12:50 PM
       

     
    This webpage's layout is originally from Bill Parkinson, who used to teach in the evening program at St. Joseph's University. Much of the content is lifted from Steve Cooper's version of this course -- in particular, the project documents were designed by him, though parts are adapted from elsewhere.