2 #+author: Richard Westhaver
3 #+setupfile: ../../../clean.theme
4 =skel= is
/a hacker's project compiler and build tool/. It is an
5 extensible software library designed for managing
/projects/.
7 The
[[https://compiler.company/docs/core/app/skel.html][cli]] is the main entry point for typical users. This documentation
8 is for library developers and internal use.
11 This library started as a Rust crate but was re-written in Lisp as the
12 purpose of the library grew from managing a small collection of
13 user-space libraries (also written in Rust) to managing large
14 collections in many different langs.
16 It is obvious in hindsight, that this project needs Lisp. Today,
17 =skel= built on
[[https://en.wikipedia.org/wiki/Common_Lisp_Object_System][CLOS]] with classes and methods exposing the core API.
20 The library core is built on CLOS. Most important data structures are
21 represented with classes, slots, and methods such as the
~sk-project~ 22 class which has a slot named
~:components~ and a method specialized on
25 We make use of mixins defined within the library like
~sk-meta~ as
26 well as classes defined downstream - the
~sxp~ class for example
27 provides a default method for AST functions (
~load-ast~ ~build-ast~)
28 and is defined in the
~std/sxp~ package.
30 On top of the core we build our compilers or 'translators' which
31 convert core objects to a corresponding external representation. For
32 example the
~makefile~ and
~mk-*~ classes defined in
~skel/comp/make~ 33 can be built from a
~sk-project~ and
~sk-*~ instances. Once built, the
34 ~sk-compile~ method can be used to actually generate the GNU Make
35 output as a stream of bytes.
37 The remainder of the
~skel~ system is dedicated to extensions. These
38 are all optional. There are built-in extension called
~tools~ which
39 run within the
~skel~ system and external extensions (
~ext~) which
40 integrate with a particular external system.
42 The
~tools~ we provide are similar to Cargo's
[[https://doc.rust-lang.org/book/ch14-05-extending-cargo.html][custom commands]], but
43 they don't need to be a separate binary - they can be compiled into
44 the core image. The downside is that this requires re-compiling
~skel~ 45 every time you want to add a new tool. However since this is Lisp not
46 Rust, we can compile anywhere - including from within
~skel~ 49 ~ext~ contains extensions for external systems. These modules are the
50 'edges' of the system and provide support to programs which need to be
51 able to access
~skel~ data at runtime. These modules always compiled
52 separately and aren't built into the default core image.