|
| 1 | +# Libraries |
| 2 | + |
| 3 | +Exercism aims to teach [fluency](/docs/using/product/fluency) in the syntax, idioms, and the standard library of the language. |
| 4 | +This explicitly does _not_ mention external (non built-in) libraries, as that falls under _proficiency_. |
| 5 | +Exercises must thus, with few exceptions, be solvable without using libraries. |
| 6 | + |
| 7 | +## Reasons to support libraries |
| 8 | + |
| 9 | +There are couple of reasons why a track might still want to support libraries: |
| 10 | + |
| 11 | +1. The language has a (very) minimal standard library. |
| 12 | + An example of such a language is Rust. |
| 13 | +2. The library adds testing functionality. |
| 14 | + An example is a library that adds support for property-based testing. |
| 15 | +3. The exercise can only be solved using a library. |
| 16 | + An example of such an exercise is the [lens-person exercise](https://exercism.org/exercises/lens-person), which in most languages can only be solved using a library. |
| 17 | + |
| 18 | +## Supporting libraries in the test runner |
| 19 | + |
| 20 | +As the test runner does not have access to the internet whilst running, it is not possible to download libraries at run time. |
| 21 | +The **only** solution to this problem is to install/download libraries at build time, where you _do_ have access to the internet. |
| 22 | +In practice, this means you'll need to install/download libraries within the Dockerfile. |
| 23 | + |
| 24 | +As an example, the [Prolog test runner's Dockerfile](https://github.com/exercism/prolog-test-runner/blob/ed7447a7518ede6ee3405e649f50aaec828e318b/Dockerfile) installs the `date_time` library: |
| 25 | + |
| 26 | +```dockerfile |
| 27 | +RUN swipl pack install date_time -y |
| 28 | +``` |
| 29 | + |
| 30 | +## Documentation |
| 31 | + |
| 32 | +If your track supports libraries, this should be documented in a [track doc](/docs/building/tracks/docs). |
| 33 | +Please also link to this document (using its full URL) from the [`exercises/shared/.docs/help.md` document](/docs/building/tracks/shared-files#file-help-md). |
0 commit comments