This is the home page for Peter Chapin's CIS-3030 course notes for the Spring 2019 semester. Here you will find slides, homework assignments, program samples, and links to other references of interest.
The course syllabus gives an overview of the course and its content, lists course resources, and describes the grading policy and related issues.
The homework submission area and grade book are on Moodle but all other course resources are here.
I have a general help session on the Williston campus on Thursday afternoons in BLP-210 from 2:00 to 4:00. Jeremy Ouellette runs a help session specifically for this class on the Randolph campus on Monday afternoons in CON-104 from 2:00 to 2:50.
We will be studying Scala in this course as a vehical for exploring various programming language design issues.
We will start the course using the Scala REPL via the sbt
build tool. I
have prepared a document that describes how to get set
up.
In this class you will work on a project where you learn a new programming language of your choice. You may find a checklist of programming language features useful to guide your study. In what way does your new language support each of the features in the checklist? My Hello, World document describes a number of problems you can use to exercise your programming language (and your programming skills). The programming languages chosen by the students in the class are given in this list.
I prepared a summary of the core features of Scala that are important for this class.
As an extended example of functional programming, we will use the VuPP virtual machine simulator.
I prepared some notes about OOP related to the content of this course.
My home page contains other resources of potential interest.
All live lectures will be accessed from the following Zoom URL: https://zoom.us/j/856025200.
The list below are approximate lecture-by-lecture topics for this course. The topics with links to Zoom lectures are for this (Spring 2019) edition of the course. The topics without links are approximate and subject to change.
Set
and Map
.foldLeft
, and multiple parameter lists.Rational1.scala
sample shows an immutable
rational number class. The associated worksheet shows
how the class can be used. The file Rational.java
shows a Java class that implements approximately the same functionality. Compare the Scala
and Java versions to get insight on how the Scala code works.Tree.scala
and its associated ScalaIDE worksheet show a binary search tree
implementation in Scala.Rational2.scala
sample shows a variation on
the Rational number class that supports equals
, hashCode
, ordering, and
type classes. The associated worksheet how how the
class can be used.SuperCtor.scala
. This program shows how
Scala allows one to call methods on uninitialized objects under certain conditions.superctor.cpp
. This program shows how C++
turns off dynamic dispatching in constructors so as to avoid accidentally calling
methods on uninitialized objects.animals.ads
and animals.adb
show how Ada handles this
situation.Variance.scala
shows some interesting issues
related to variance.VarianceWorksheet.sc
is a ScalaIDE
worksheet tht demonstrates some issues in variance.VarianceOverriding.scala
shows the
interaction between function type variance rules and method overriding.FunctionSubtyping.scala
shows how
function subtyping works in Scala.ImplicitDemo.scala
shows how implicit
conversions can be used in Scala to augment an existing class with additional methods
without resorting to OOP-style extension.Generics.scala
. Demonstrates some issues
in generic programming in Scala.generics.cpp
. Demonstrates some issues in
generic programming in C++. Compare to Generics.scala above.generics.adb
. Demonstrates some issues in
generic programming Ada. Compare to Generics.scala and generics.cpp above.Rational.hpp
.
A C++ template for rational numbers where the underlying integer type is a template
parameter.VeryLong.hpp
.
This C++ class implements arbitrary precision integer math. It can be used as a type
parameter to the Rational
class above.VeryLong.cpp
.
The body of the class VeryLong
is here for interest. It is not important to the
way VeryLong
is used.spica-trees.ads
.
An Ada generic package that provides an interface to various kinds of trees.spica-binary_search_trees.ads
.
An Ada package specification for generic binary search trees that implement the generic
interface defined earlier.spica-binary_search_trees.adb
.
The body of the generic binary search tree package.searchers.ads
and searchers.adb
demonstrate the LSP as applied to
contracts in Ada 2012. The file main.adb
is a main program
that demonstrates the package.I have prepared a file of Scala bookmarks that may be of interest. If you find any other good Scala resources online let me know and I may add it to this file. The following are links to various virtual machine implementations.
Huffman coding is used in one of my class examples.
An abbreviated home page for the Fall 2013 edition of this course where Haskell was used as the focus language is also available.
Last Revised: 2019-05-19
© Copyright 2019 by Peter C. Chapin <pchapin@vtc.edu>