Install Clash on Linux

1. Choose your platform


2. Setup Clash

Depending on your goals, you might want to simply run Clash on its own, or setup a proper project. The first one will get you up and running quickly and you won’t have to learn build tools. However, you won’t be able to use dependencies from Hackage and it is harder to get a consistent build environment.

Option A. Run Clash on its own

Either:

  • Install Clash using snap: see snapcraft.io/clash;
  • Run clash HelloWorld.hs --vhdl to compile HelloWorld.hs to VHDL.

..or:

  • Install Stack. Stack is a build tool for Haskell / Clash projects;
  • Run stack exec --package clash-ghc -- clash HelloWorld.hs --vhdl to compile HelloWorld.hs to VHDL.

Option B. Setup a project

To setup a new project, install Stack and run:

stack new my-clash-project clash-lang/simple

This will create a new project called my-clash-project in a folder named the same. The folder will contain a README.md to get you up and running. Alternatively, you can read it online. People familiar with the Haskell ecosystem might prefer to use Cabal instead. To do so, download the starter project as a zip and follow the instructions in README.md.