Encoding in F♭
Due on Thursday, October 9th at 11:59 PM. This is a team lab. You may work alone or you may work with a partner. If you’d like to work with a partner, make sure to indicate your preferred partner using Teammaker and be familiar with the Partner Etiquette guidelines. You may discuss the concepts of this lab with other classmates, but you may not share your code with anyone other than course staff and your lab partner(s). Do not look at solutions written by students other than your team. If your team needs help, please post on Courselore or contact the instructor. If you have any doubts about what is okay and what is not, it’s much safer to ask and learn than to guess!
Overview
In this lab, you will use the F♭ language to encode some language features that it does not include. You may use the F♭ interpreter you implemented in the previous assignment or you may use the provided reference implementation, depending upon your preference. As with the previous assignment, we will use Teammaker to form groups.
F♭ Programming
You will find that your repository contains a file called encodings.fb
. This file contains F♭ definitions in the form of a series of Let ... In ...
expressions. It also contains a number of comments directing you to write several definitions in F♭. Your task for this part of the assignment is to complete the work described by the encodings.fb
file by writing the definitions correctly. As with the last lab, the binaries/
directory contains a working F♭ interpreter. This means that you can work on encodings.fb
even if your own implementation of the F♭ interpreter is not yet functional.
Unlike OCaml, F♭ programs are just expressions; there is no way to write a series of top-level declarations separated by ;;
. After the last In
in the encodings.fb
file you will find the expression 0
. You may replace that expression with whatever test expression you like and then run the entire file by running e.g. ./binaries/fb.exe encodings.fb
from the command line. This provides you a means to test your various definitions without resorting to copying and pasting your code into the F♭ toploop. You will not be graded on anything that appears in that position of the file.
You are strongly encouraged to write and test your encodings.fb
definitions one at a time and to commit each definition once you have completed it. Since this is a single large file in a language for which we have poor development tools, finding e.g. a missing parenthesis could be extremely difficult. It’s much easier to find these sorts of problems when you’re making small changes and testing them one at a time.
Syntax Highlighting
As with the last lab, the syntax-highlighting
directory of your repository contains some small editor extensions to provide syntax highlighting for the F♭ language. The syntax highlighter for F♭ is likely to be much more useful in this assignment, as it may help you identify basic syntax errors more readily than the F♭ interpreter’s error messages will. To install a syntax highlighting package, follow the instructions in the README.md
file of the appropriate subdirectory for your editor.
Submitting
It is not enough to push your work. In your repository, you will find a Python script called submit.py
. In order to submit your lab assignment, it should be sufficient to run that script by typing python3 submit.py
in your terminal. For this script to work correctly, you must have committed all uncommitted files in your repository and pushed your work so that your repository is in sync with your GitHub remote repository.
The aforementioned Python script is designed to create a Git tag: a name for a specific commit in your repository. (The script also performs a series of checks to help ensure that the tag you create contains what you likely think it contains.) The tag will be named using the words “submission”, the name of your assignment, and a version number. Your instructor will know that you have submitted your work because this tag will appear in your repository. If you need to resubmit your work to correct changes after receiving a grade, you can simply create new commits and then create another tag (preferrably with submit.py). At any given time, only your most recent outstanding submission will be graded.
Lab Questionnaire
In addition to completing the lab itself, you’ll also need to complete a questionnaire describing your experience in the lab. Under most circumstances, this questionnaire will take only about a minute to complete and is part of your participation grade. Please make sure to do this; the information lets me know whether I’m asking for the right amount of work and helps to ensure that it’s a good use of your time.
If You Have Trouble…
…then please contact your instructor! Courselore is the preferred method, but you can reach out via e-mail as well. Good luck!