McMaster University
CAS 706
Assignment 1
Generic Quicksort. Write 3 different versions of
quicksort (in each language), which explicitly:
- Sort a list of integers in ascending order
- Sorts a list of ``anything'' via an externally provided
comparison function.
- Sorts a list of ``anything'' via an externally provided
comparison function, and an externally provided partition
function (which itself uses the comparison function).
Your code should also contain executable test cases for
each version. Using a testing framework is preferable over
doing this "by hand".
Your deliverable should contain a README that tells me
how to run things. If possible, a Makefile, or some
similar method of automation would be best.
The languages are: D or Rust, TypeScript, OCaml, Prolog.
Bonus
- Also write this assignment in Agda or Coq or Lean or Isabelle.
(More bonus if you do 'and')
- Write a meta-program (in any language) which writes out your
solution. This should be a proper meta-program which expresses
quicksort in a DSL (that you invent) and then renders it in
the various languages. This bonus was a whole Master's thesis
some years ago.
Sept. 2017