Needed for next version:

Short term things to do:

* If a module change doesn't change the contents of the .ki, don't
  rebuild dependencies.
* Reflection/reification library.
* More data structure libraries (further to Queue, e.g. Stack, binary
  search Tree, generic Tree, Heap, Set)
* Redo testing framework - several separate categories
  - successful compile, successful run (sufficient coverage for all
    RTS).
  - successful compile, run-time error (covering all ways of throwing
    exceptions due to RTS errors)
  - fail to compile (covering all possible compile-time errors).
  - library tests (covering all stdlib functions).
  - regression (all the old errors, so that they don't come back).
* Update the library so that type synonyms are used sensibly.
* Full pattern matching.
* Implementation of infix operators relies too much on C. Add
  specialised VM instructions instead.
* Add op= shorthand for more operators.
* Performance tuning for library functions (in C if necessary).
  especially: Array::unshift, Array::subarray, Array::remove, Array::take
* Rewrite of website to use Kaya for templating.

General optimisation ideas:

* Inlining of simple functions, especially constant functions
* Optimise for loops by not calling size() each time if the array is
  invariant over the loop (can take out the tmp hack in Array::elem then)
* Don't allocate more stack ints than necessary for a function
* Allow global variables to be initialised on declaration
* Make ADTs that are solely enums be internally represented as Ints

Long term ideas:

* Switch to a register based VM, rather than stack based. (????)
* Consider subtyping/overloading.
* Reorganise parser. Maybe use Parsec instead of happy for flexibility.
* Tidy up Raw/Expr data types (big, boring job, so unlikely to happen).
* Identify pure functions for:
  + Inlining (making macros like #defines).
  + Common subexpression elimination.
* User defined optimisations via rewrite rules.
* Documenting the typing rules would be nice, if boring and unlikely
  to be read.

Random thoughts

* Unit testing support/library.
* Dynamic linking support would be nice.
