changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / readme.org

changeset 649: 6e5006dfe7b8
parent: f901de70a80e
child: b499d4bcfc39
author: Richard Westhaver <ellis@rwest.io>
date: Thu, 12 Sep 2024 22:38:22 -0400
permissions: -rwxr-xr-x
description: clap parsing updates
1 #+title: core
2 #+description: The Compiler Company Core
3 #+author: Richard Westhaver
4 #+email: richard.westhaver@gmail.com
5 #+setupfile: https://cdn.compiler.company/org/clean.theme
6 #+property: header-args :eval no-export
7 - [[https://compiler.company/docs/core][Documentation]]
8 
9 This repository contains the monolothic core of [[comp:][The Compiler Company]].
10 
11 * Overview
12 The CC core is categorized into language-specific modules. Our
13 languages at time of writing are Common Lisp, Rust, and Emacs Lisp.
14 
15 The top-level modules are contained in the directories =lisp=, =rust=,
16 and =emacs= respectively. At the root directory you will also find a
17 =skelfile= and a =sk= file for each module. These files contain
18 project definitions which are used by our =skel= program to perform a
19 variety of actions on the core such as running tests and building
20 binaries.
21 
22 * Bootstrap
23 To bootstrap the core you will need recent versions of [[https://www.rust-lang.org/][Rust]], [[http://www.sbcl.org/][SBCL]], and
24 a C compiler (clang or gcc). Only Unix systems are explicitly
25 supported.
26 
27 Many parts of the core depend on additional libraries which may or may
28 not be provided by your system's package manager. See the dependency
29 matrix below for details.
30 
31 In any case, it is always preferred to make use of the [[https://vc.compiler.company/comp/infra][infra]] project
32 to reliably provision the host either from source or pre-built
33 platform-specific [[https://packy.compiler.company/dist][binary distributions]].
34 
35 #+NAME: Dependencies
36 | dependency | required by | src |
37 |-------------+------------------------+-----------------------------------------------|
38 | Blake3 | ffi/blake3 | https://vc.compiler.company/packy/blake3 |
39 | Tree-sitter | ffi/tree-sitter | https://vc.compiler.company/packy/tree-sitter |
40 | Uring | ffi/uring | https://vc.compiler.company/packy/uring |
41 | Btrfs | ffi/btrfs | https://vc.compiler.company/packy/btrfs |
42 | Ublksrv | ffi/ublk | https://vc.compiler.company/packy/ublksrv |
43 | OpenSSL | lib/net | [[https://vc.compiler.company/packy/openssl]] |
44 | RocksDB | ffi/rocksdb | https://vc.compiler.company/packy/rocksdb |
45 | Git | lib/vc/git | https://vc.compiler.company/packy/git |
46 | Hg | lib/vc/hg | https://vc.compiler.company/packy/hg |
47 | Zstd | ffi/zstd | https://vc.compiler.company/packy/zstd |
48 | Qemu | lib/box | https://vc.compiler.company/packy/qemu |
49 | Podman | lib/pod | https://vc.compiler.company/packy/podman |
50 | Emacs | emacs | https://vc.compiler.company/packy/emacs |
51 | StumpWM | lib/gui/wm/x11/stumpwm | https://vc.compiler.company/packy/stumpwm |
52 | Readline | ffi/readline | [[https://vc.compiler.company/packy/readline]] |
53 | Keyutils | ffi/keyutils | [[https://vc.compiler.company/packy/libkeyutils]] |
54 | Mpd | lib/aud/mpd | https://vc.compiler.company/packy/mpd |
55 
56 * Build
57 The Core consists of two major system: the *lisp* system and the
58 *rust* system. There is also an auxiliary *emacs* system containing a
59 complete Emacs IDE configuration which serves as the base for user
60 customizations.
61 
62 Building the core will produce its output to the =.stash= directory by
63 default. You can then test, run, and install the resulting files or
64 package them up to be shipped elsewhere.
65 
66 The core produces a collection of native program binaries, compiled
67 lisp modules in FASL format, as well as web distributions containing
68 the usual suspects (html, css, js) as well as wasm modules.
69 
70 ** From Source
71 *** Lisp
72 The Lisp Core can be found under the =lisp= directory. It is the
73 largest system, most actively developed, and is intended to cover the
74 complete surface of the user-facing APIs contained in the core.
75 
76 Starting from a standard Common Lisp environment with at least
77 [[https://www.quicklisp.org/beta/][Quicklisp]] installed, you can execute =./x.lisp build skel= to build
78 the project compiler and =./x.lisp run skel= to run it. This tool is a
79 convenience for building and testing different parts of the core from
80 a minimal dependency set.
81 
82 #+name: x-help
83 #+begin_src shell :exports both :results output
84 # bootstrap the core build tool
85 ./x.lisp --help
86 #+end_src
87 
88 #+RESULTS: x-help
89 #+begin_example
90 This is SBCL 2.4.7:76bbecb68, an implementation of ANSI Common Lisp.
91 More information about SBCL is available at <http://www.sbcl.org/>.
92 
93 SBCL is free software, provided as is, with absolutely no warranty.
94 It is mostly in the public domain; some portions are provided under
95 BSD-style licenses. See the CREDITS and COPYING files in the
96 distribution for more information.
97 To load "rt":
98  Load 1 ASDF system:
99  rt
100 ; Loading "rt"
101 
102 x.lisp --- core build tool
103 x.lisp [CMD]
104 CMDS:
105 test
106 compile
107 build
108 make
109 test
110 run
111 save
112 install
113 #+end_example
114 
115 To test the lisp standard library:
116 #+begin_src shell :results output :exports both
117 # test systems
118 ./x.lisp test std
119 #+end_src
120 
121 #+RESULTS:
122 #+begin_example
123 This is SBCL 2.4.7:dc890089a, an implementation of ANSI Common Lisp.
124 More information about SBCL is available at <http://www.sbcl.org/>.
125 
126 SBCL is free software, provided as is, with absolutely no warranty.
127 It is mostly in the public domain; some portions are provided under
128 BSD-style licenses. See the CREDITS and COPYING files in the
129 distribution for more information.
130 To load "rt":
131  Load 1 ASDF system:
132  rt
133 ; Loading "rt"
134 
135 To load "rt":
136  Load 1 ASDF system:
137  rt
138 ; Loading "rt"
139 
140 To load "std/tests":
141  Load 1 ASDF system:
142  std/tests
143 ; Loading "std/tests"
144 
145 in suite STD:
146 ; with 15 tests
147 #<PASS READTABLES>
148 #<PASS SYM>
149 #<PASS STRING>
150 #<PASS LIST>
151 #<PASS ERR>
152 #<PASS THREADS>
153 #<PASS TIMERS>
154 #<PASS FMT>
155 #<PASS ANA>
156 #<PASS PAN>
157 #<PASS ALIEN>
158 #<PASS CURRY>
159 #<PASS BITS>
160 #<PASS LEB128>
161 #<PASS TASKS>
162 No tests failed.
163 #+end_example
164 
165 To save the prelude to =.stash/prelude.core=:
166 #+begin_src shell :results output :noeval t
167 # save cores
168 ./x save prelude
169 #+end_src
170 
171 And to install binaries (defaults to =/usr/local/bin/=):
172 #+begin_src shell :results none :noeval t
173 # install binaries
174 sudo ./x install
175 #+end_src
176 
177 *** Rust
178 The Core Rust system can be found under the =rust= directory.
179 
180 A workspace is configured such that you can build all components with
181 the following command (~NOTE~ - takes a long time):
182 #+begin_src shell :exports both :results output
183  cd rust && cargo build --release
184 #+end_src
185 
186 *** Emacs
187 The core contains a collection of Emacs Lisp libraries under =emacs=
188 which may be installed for the current user using the corresponding
189 Makefile.