About Clean
Clean is a general-purpose, pure and lazy functional programming language.
Clean is similar to Haskell and distinguishes itself through increased performance and relatively faster compilation times.
It was created by researchers at the Radboud University Nijmegen (then Katholieke Universiteit Nijmegen).
It comes with a package manager, nitrile.
Clean intends to:
- Encourage programmers to think about versioning and backwards compatibility.
- Make it easy to install different versions of Clean and libraries alongside each other.
- Have stable builds using the GitLab Continuous Integration infrastructure.
- Persist package versions decentrally in the GitLab package registries.
On this page:
- About this website and Nitrile
- How do I install Clean?
- What tools can I use to develop with Clean?
- Package search tricks
- How can I publish my own package to the registry?
- What are the conditions for contributing to the registry?
About this Website and Nitrile
This website aims to provide a basic Clean bundle as well as several libraries and a package manager, nitrile. These are collected in the central package registry (served by this website).
The Clean base
package contains (forked versions of) the Clean compiler, code generator, run-time system, build tools, and standard library.
Upstream changes are regularly cherry-picked into these projects.
Nitrile is a package manager and build tool for Clean. It is used to manage dependencies, interact with the package registry, and build applications.
How do I install Clean?
The installation script depends on curl
, jq
, and tar
.
Nitrile itself depends on curl
, gcc
, and tar
.
After installing these packages, run:
curl https://clean-lang.org/install.sh | /bin/sh
(To install a specific Nitrile version (e.g. 0.4.0), add -s 0.4.0
to the /bin/sh
arguments.)
Afterwards, be sure to add ~/.nitrile/bin
to your path.
You may now want to follow the Nitrile getting started guide.
Nitrile depends on Chocolatey. Make sure you install Chocolatey before installing Nitrile.
Now run the following in an administrative shell:
Set-ExecutionPolicy ByPass -Scope Process -Force; (New-Object System.Net.WebClient).DownloadString('https://clean-lang.org/install.ps1') | powershell -Command -
(To install a specific Nitrile version (e.g. 0.4.0), run $Env:NitrileVersion = '0.4.0'
beforehand.)
You may need to reboot for nitrile
to be available in your path.
You may now want to follow the Nitrile getting started guide.
Clean via Nitrile does not run natively on Mac (neither x64 nor ARM) but it is possible to use it via Docker (for example in a devcontainer).
The Docker image cleanlang/devcontainer:latest
contains all the tools to use Nitrile (including Nitrile itself).
For an in depth tutorial on how to set up a devcontainer, see the iTasks template repository.
You may now want to follow the Nitrile getting started guide.
Simply run:
nitrile update
nitrile global install nitrile
nitrile global remove nitrile OLD_NITRILE_VERSION
You can list all installed Nitrile versions with nitrile global list
.
What tools can I use to develop with Clean?
There are several dedicated editor plugins used to develop in Clean, the plugins below provide syntax highlighting and may provide several other features:
Actively Maintained:
Unmaintained:
There is a dedicated search engine for the entire nitrile registry:
- Cloogle: a search engine for Clean. It indexes the packages in the registry, and is updated nightly.
The following highlighters can be used:
Package search tricks
You can search in a package's title, description, readme, and changelog. The following tricks can be used:
- Wildcards:
foo*
to match words beginning withfoo
(also*oo
;f*o
) - Fields:
title:foo
,description:foo
,readme:foo
,changelog:foo
to limit a term to one field - Boosts:
foo^5 bar
to makefoo
5 times more important thanbar
- Forced inclusion and exclusion:
+foo bar -baz
must includefoo
and may not includebaz
See the lunr.js search guide for more details.
How can I publish my own package to the registry?
See the Nitrile instructions.
What are the conditions for contributing to the registry?
Contributions should be in line with the project goals describe above. The project maintainer retains the right to remove any package at any time without giving a reason.