changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > docs / core/lib/skel.org

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