Carp is mainly developed on macOS, but it also works fine on Linux. Windows is currently not supported - but please get in touch in case you want to help out with that!
Building the Carp executable from source
- Make sure you have Stack installed.
- Clone this repo to your machine.
stack buildin the root of the project directory.
stack installwill install the Carp command line tool for easy access on your system.
- Make sure that the directory where stack installs executables is on your PATH, i.e:
Setting the CARP_DIR
carp executable must know where to find its core libraries and other files.
Set the environment variable CARP_DIR so that it points to the root of the Carp repo.
For example, add this to your
.bashrc or similar:
You should now be able to start Carp from anywhere:
carp executable will emit a single file with C code,
main.c and try to compile it using an external C compiler.
On macOS and Linux it defaults to
clang, on Windows it's
You can configure the exact compiler command like so:
(Project.config "compiler" "gcc --important-flag")
SDL, GLFW, etc
The examples involving graphics/sound/interaction will require the following libraries installed on your system:
- SDL 2 (cross platform game/interactivity library)
- SDL_image 2 (image helpers)
- SDL_ttf 2 (font rendering
- SDL_mixer 2 (audio playback)
- glfw (Create a rendering context for OpenGL or Vulcan)
Please let us know if you have trouble getting these examples to work.