Libraries


Exercism aims to teach fluency in the syntax, idioms, and the standard library of the language. This explicitly does not mention external (non built-in) libraries, as that falls under proficiency. Exercises must thus, with few exceptions, be solvable without using libraries.

Reasons to support libraries

There are couple of reasons why a track might still want to support libraries:

  1. The language has a (very) minimal standard library. An example of such a language is Rust.
  2. The library adds testing functionality. An example is a library that adds support for property-based testing.
  3. The exercise can only be solved using a library. An example of such an exercise is the lens-person exercise, which in most languages can only be solved using a library.

Supporting libraries in the test runner

As the test runner does not have access to the internet whilst running, it is not possible to download libraries at run time. The only solution to this problem is to install/download libraries at build time, where you do have access to the internet. In practice, this means you'll need to install/download libraries within the Dockerfile.

As an example, the Prolog test runner's Dockerfile installs the date_time library:

RUN swipl pack install date_time -y

Documentation

If your track supports libraries, this should be documented in a track doc. Please also link to this document (using its full URL) from the exercises/shared/.docs/help.md document.