Installing Kitten
In the future, there will be prepackaged binary releases of the Kitten compiler. Until then, you must build it yourself. Kitten’s compiler is written in Haskell, and its build uses the Stack build tool.
You will need:
- Git
- Stack
Clone the Git repository:
git clone [email protected]:evincarofautumn/kitten.git
cd kitten
Set up Stack if you haven’t already done so:
stack setup
Build the compiler, and run its test suite if you like:
stack build
stack test
Now Kitten can be executed with stack exec kitten
.
If you want to install Kitten in a standard location outside the build directory, due to a deficiency in Stack’s support for Cabal’s data-files
feature, it is not recommended to use stack install
to install a copy of the executable, because this will not install the common vocabulary common.ktn
containing Kitten’s standard library.
There are two workarounds. One is to forgo Stack, and build and install Kitten using Cabal directly:
cabal sandbox init
cabal install --only-dependencies
cabal install --prefix="$HOME/.local"
This will correctly install the common vocab so that Kitten can find it. The preferred install location for Kitten is ~/.local
on Unix-like systems (so the executable resides at ~/.local/bin/kitten
) or %APPDATA%\local
on Windows (resp. %APPDATA%\local\bin\kitten.exe
).
The other option is to manually copy common.ktn
to the install directory:
stack install
cp common.ktn ~/.local/bin/
It’s also recommended to add the install directory (~/.local/bin
or %APPDATA\local\bin
) to your PATH
so that you can invoke kitten
directly without a path prefix.
These are the only files installed by Kitten, so to uninstall it, you only need to delete the compiler and common vocab from the install directory.