Software Setup
This course will depend on the DrScheme implementation of Scheme. Even if you have used other Scheme systems before, you will have to use this one here.
Running DrScheme Inside the Department
To run DrScheme on the CS Linux machines use the following command:
/course/cs173/bin/drscheme
DrScheme is also installed on the Windows machines in the MS Lab on the first floor of the CIT. DrScheme is not available on any other departmentally-managed Windows machine.
The first time you run DrScheme, it will ask you to select a language. Choose “PLAI - Advanced Student” from the “Programming Languages: Application and Interpretation” subheading.
- If DrScheme does not ask you to select a language, choose Choose Language… from the Language menu and select the language mentioned above. More about the language level.
- If “Programming Languages: Application and Interpretation” is not an option, you need to install the PLAI package.
Running DrScheme From Home
- Download DrScheme v208 from www.drscheme.org.
- Install the PLT Scheme 208 patch
- Install the PLAI package.
- Restart DrScheme.
- Choose the correct language level.
Installing the PLAI Package
You will need to do this if you are running DrScheme at home, and you may need to do it if you are running DrScheme on a Windows computer in the department.
In DrScheme, go to File >
Install .plt file... and enter the following URL: http://www.cs.brown.edu/courses/cs173/2004/plai.plt
Then, restart DrScheme.
Language Selection
When working in DrScheme, be sure that you always use one of the PLAI languages so that all the useful constructs shown in class will be available. These languages are under the “Programming Languages: Application and Interpretation” option in the languages list. While you’re getting started with Scheme, try using “PLAI - Beginning Student,” but you will need to switch to “PLAI - Advanced Student” before working on the assignments. To change the current language, select the Language > Choose Language... menu in DrScheme and pick the correct item from the resulting dialog box.
To verify the language is set correctly, click the Run toolbar button. You should see “Language: PLAI - Advanced Student” in the lower pane of the DrScheme window. We strongly recommend that you use PLAI - Advanced Student for your assignments because it will give you better error messages.
If, while working in DrScheme, you begin to get random syntax errors on the predefined constructs, make sure to double check the language (since this is a common cause of errors) before spending a lot of time searching for a bug or contacting the staff.
Troubleshooting
You can get documentation for the special CS 173 language constructs by searching for “cs173” in DrScheme’s Help Desk. The Help Desk is available from the Help menu.
If you are unsure of the correctness of your home installation of the plai.plt file, the following instructions will allow you verify that the setup completed correctly.
- If you have DrScheme running, shut it down and restart it.
- In DrScheme, go to the Languages menu. Select "Choose Language...".
- In the resulting window, do you see an option that reads
Programming Languages: Application and Interpretation PLAI - Beginning Student PLAI - Intermediate Student with lambda PLAI - Advanced Student PLAI - Pretty Big
If so, then you’re done with the installation process. - At this point, select the PLAI - Beginning Student language. This is the language you want to program in for the first few weeks.
Running Haskell
We will also be spending some time working with the Haskell programming language, using an implementation called Helium. You may opt to either download your own copy of Helium from its download page, or work with the version installed on the CS department's Linux machines.
For helium to run properly, several environment variables must be set.- PATH must include
/course/cs173/bin/
- TEMP must be set to some directory in which temporary files can be stored. /tmp/ works fine.
- LVMPATH must be a list of directories where Helium can find Haskell source
files and modules, separated by semicolons in Windows, or colons in Linux. One
of these should be Helium's
/lib
directory. For the department's machines,.:/course/cs173/helium/lib/
is a good value to use.
Once these are set, you may run helium either
- In text mode, by running
texthint
- In the graphical interpreter, by running
java -DLVMPATH=$LVMPATH -jar /course/cs173/helium/Hint-1.2.jar