This is the course repository for CAS CS 320 at Boston University during the Fall 2024 semester. We'll publish assignments, lecture materials and lab materials here.
Follow the instructions below for setting up your machine. If you are a Windows user, we generally recommend setting up a WSL development environment.
As a student, you'll mirror this repository and pull down assignments when they are made available. You'll also need to link this repository with Gradescope to submit assignments.
-
The following instructions assume that you are set up to connect to GitHub using SSH. See the tutorials in the GitHub docs for more information on how to do this. If you don't want to use SSH, then you'll have to replace each repository with its web url, e.g., you should replace
[email protected]:BU-CS320/cs320-fall-2024.git
with
https://github.com/BU-CS320/cs320-fall-2024.git
and
[email protected]:YOURNAME/cs320-fall-2024-private.git
with
https://github.com/YOURNAME/cs320-fall-2024-private.git
-
Clone this repository
git clone [email protected]:BU-CS320/cs320-fall-2024.git
-
Create a private repository called
cs320-fall-2024-private
on Github, e.g., https://github.com/nmmull/cs320-fall-2024-private -
Mirror-push this repository into your private repository
git -C ./cs320-fall-2024 push --mirror [email protected]:YOURNAME/cs320-fall-2024-private.git
-
Clone your private repository
git clone [email protected]:YOURNAME/cs320-fall-2024-private.git
-
Add this repository as a remote for your private repository
git -C ./cs320-fall-2024-private remote add upstream [email protected]:BU-CS320/cs320-fall-2024.git
Note. This was recently updated. If you set it up with the previous command, you should remove that remote and add this remote instead. This means running the following
cd cs320-fall-2024-private remote remove upstream git add remote upstream [email protected]:BU-CS320/cs320-fall-2024.git
-
Remove the clone of this repository
rm -rf cs320-fall-2024
You'll complete all the work for the course in your private repository.
When materials are added to the course repository, you'll need merge those changes into your private repository. You should get in the habit of doing this frequently.
From within the directory for your private repository, run the following commands (you should check that you don't have any uncommitted changes in your directory).
cd cs320-fall-2024-private
git fetch upstream
git merge upstream/main main
git push
This will merge the updates to the course repository into your private repository both locally and on Github.
You should commit your changes frequently in your private repository
(we'll assume familiarity with git
, see the git
tutorial for more information
if you are unfamiliar). Before you submit an assignment, make sure
that you've pushed all your changes using git push
. On
Gradescope, you'll be able to choose your private repository for
grading.
After you've mirrored the course repository, you'll set up your machine to be able to compile and run OCaml program.
-
Install opam. Follow all the associated instructions, e.g., make sure to run
opam init
. -
Create a local switch in the directory for your private repository
cd cs320-fall-2024-private opam switch create ./ 4.13.1 eval $(opam env)
-
Install the
dune
,utop
andounit2
, which we will use throughout the courseopam update opam install dune utop ounit2
-
Install the course standard library. We include documentation for this library on the course webpage. We'll grade assignments under the assumption that you only have access to this library (the dune projects we release for assignments assume this as well, so you don't need to do any additional setup).
opam install stdlib320/.
-
If you are using VSCode, install the OCaml language server protocol
opam install ocaml-lsp-server
and then install the OCaml Platform from the Visual Studio Marketplace
Once everything is set up, working on an assignment will go roughly as follows.
-
Sync with the course repository to get access to the assignment
-
Set the local switch to be the current active switch
eval $(opam env)
-
Fill in your solutions, make sure to commit your changes frequently. Note. You will have to create your own files which satisfy the specification of the assignment. You can verify that you've set everything up correctly if
dune build
doesn't show any errors when run inassigns/assignXX
-
From within the assignment
lib
directory, frequently rundune build
to type check your code -
As you get close to completing the assignment, from within the assignment directory, run
dune test
to test your code against a small OUnit test suite. This collection of tests will include some (but not all) tests used for grading. -
(Optional) Add your own OUnit tests to the
test
directory -
Push your work to your private repository and submit your assignment via Gradescope
On Gradescope, you should see a message which says that your assignment was accepted. You will not see any other information there.
Please make sure that your code and provided tests at least build
(via dune build
in the course repository) before submission.
This means that, even if you are only partially completing the
assignment, you may have to introduce skeleton code to the lib
directory.