Skip to content

Latest commit

 

History

History
63 lines (52 loc) · 1.7 KB

INSTALL.md

File metadata and controls

63 lines (52 loc) · 1.7 KB

Installing Kiln

  1. Clone Kiln where ASDF can find it. (Usually ~/common-lisp or ~/quicklisp/local-projects.)

  2. Bootstrap the executable:

    • From a shell, run make in the Kiln directory.
    • OR, from a Lisp REPL, execute:
      > (asdf:make "kiln")

    This will generate an executable named kiln in the Kiln directory.

  3. Symlink (don’t copy!) the kiln executable into your PATH.

    # Assuming XDG-compliant Linux.
    $ ln -s $(pwd -P)/kiln ${HOME}/.local/bin/kiln
    

    On an XDG-compliant Linux, with ~/.local/bin on the PATH, you can install with Make:

    $ make test && make install
    
  4. Test Kiln is installed:

    $ kiln version
    

    If you want to make sure everything is working properly, you can tell Kiln to run a self-diagnostic:

    $ kiln self-test
    

You can now use Kiln for writing shebang scripts. The remaining steps are for writing package scripts.

  1. Create a local-scripts system where ASDF can find it. Make it a package-inferred system:
    ;; In file local-scripts.asd.
    (defsystem "local-scripts" :class :package-inferred-system)
  2. Write your first script as Lisp file in that directory. For example, write the following into local-scripts/hello:
    (defpackage :local-scripts/hello
      (:use :cl)
      (:documentation "Say hello"))
    (in-package :local-scripts/hello)
    
    ;; A Kiln script defines a single function named main
    ;; that takes a list of arguments.
    (defun main (args)
      (destructuring-bind (name) args
        (format t "Hello, ~a~%" name)))
  3. Run your script with Kiln:
    $ kiln hello $(whoami)
    Hello