Guide to Programming for CIS 425


CIS 425 Home Page Last updated 2005/10/09 11:57:29

This page is a brief guide and quick reference for the various programming environments and languages we will use in CIS 425.

Java   |   C/C++   |   Scheme   |   ML

The author of the text book we are using also maintains a page of language resources.

Java

Compile: % javac "sourceFile"
Run: % java "classFile"

Notes:


C/C++

Compile C source: % cc -o "outputFile" "sourceFile" or % gcc -o "outputFile" "sourceFile"
Compile C++ source: % CC -o "outputFile" "sourceFile" or % g++ -o "outputFile" "sourceFile"
Run: "outputFile"

Notes:


Scheme

There are various versions of Scheme available that you can download to a PC for free. In particular, you can download a package with a graphical user interface as well as a command line interpreter from www.drscheme.org. It is easy to install under Windows, and has a GUI that makes it easy to use. You should set the language type to be standard Scheme to get the full features of the language.

Chez Scheme is installed on the department Solaris network under /local/apps/Lang/chez. The following instructions describe how to use the Chez Scheme command line interpreter in the department Solaris environment, but also apply to the command line interpreter under Windows. The Scheme code would be (nearly) the same in the GUI environment of DrScheme.

Start Scheme interpreter: /local/apps/Lang/chez/bin/scheme
Open Scheme source file for interpretation: First start the scheme interpreter, then type: (load "foo.scm") at the '>' prompt. (This assumes your source file is called foo.scm.)
To exit the interpreter, type in: (exit).

Notes:


ML

You can dowload an SML interpreter for Windows for free from /www.smlnj.org. This interpreter has a command line interface, so you will run it in a command window. SML is also installed on the department's Sun Solaris network in /local/bin. Since this directory is likely to be in your PATH, all you need to do is execute 'sml'.

The following instructions describe how to use the SML interpreter in the department Unix environment, but also apply to the interpreter under Windows.

Start ML interpreter: sml
Open ML source file for interpretation: First start the ML interpreter, then type: use "foo.sml"; at the '-' prompt, (assuming your source file is called foo.sml). To exit the interpreter, enter Control-D from the keyboard (end of input).

Notes: