changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / readme.org

changeset 617: 6f10b3036123
parent: 74a55d5decce
child: b88bf15f60d0
author: Richard Westhaver <ellis@rwest.io>
date: Tue, 20 Aug 2024 21:05:08 -0400
permissions: -rwxr-xr-x
description: howd that get thur
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][Docs]]
8  - [[https://compiler.company/docs/core/install.html][Install]] :: Install Guide
9  - [[https://compiler.company/docs/core/tests.html][Tests]] :: Testing Guide
10  - [[https://compiler.company/docs/core/stats.html][Stats]] :: Project Statistics
11 
12 * Overview
13 This repository contains the monolothic core of [[comp:][The Compiler Company]].
14 
15 To bootstrap the core you will need recent versions of [[https://www.rust-lang.org/][Rust]], [[http://www.sbcl.org/][SBCL]], and
16 a C compiler (clang or gcc). Only Unix systems are explicitly
17 supported.
18 
19 Many parts of the core depend on additional libraries which may or may
20 not be provided by your system's package manager. See the dependency
21 matrix below for details.
22 
23 In any case, it is always preferred to make use of the [[https://vc.compiler.company/comp/infra][infra]] project
24 to reliably provision the host either from source or pre-built
25 platform-specific [[https://packy.compiler.company/dist][binary distributions]].
26 
27 #+NAME: Optional Dependencies
28 | dependency | dependents | src |
29 |-------------+------------------------+-----------------------------------------------|
30 | Blake3 | ffi/blake3 | https://vc.compiler.company/packy/blake3 |
31 | Tree-sitter | ffi/tree-sitter | https://vc.compiler.company/packy/tree-sitter |
32 | Uring | ffi/uring | https://vc.compiler.company/packy/uring |
33 | Btrfs | ffi/btrfs | https://vc.compiler.company/packy/btrfs |
34 | Ublksrv | ffi/ublk | https://vc.compiler.company/packy/ublksrv |
35 | OpenSSL | lib/net | [[https://vc.compiler.company/packy/openssl]] |
36 | RocksDB | ffi/rocksdb | https://vc.compiler.company/packy/rocksdb |
37 | Git | lib/vc/git | https://vc.compiler.company/packy/git |
38 | Hg | lib/vc/hg | https://vc.compiler.company/packy/hg |
39 | Zstd | ffi/zstd | https://vc.compiler.company/packy/zstd |
40 | Qemu | lib/box | https://vc.compiler.company/packy/qemu |
41 | Podman | lib/pod | https://vc.compiler.company/packy/podman |
42 | Emacs | emacs | https://vc.compiler.company/packy/emacs |
43 | StumpWM | lib/gui/wm/x11/stumpwm | https://vc.compiler.company/packy/stumpwm |
44 | Readline | ffi/readline | [[https://vc.compiler.company/packy/readline]] |
45 | Keyutils | ffi/keyutils | [[https://vc.compiler.company/packy/libkeyutils]] |
46 | Mpd | lib/aud/mpd | https://vc.compiler.company/packy/mpd |
47 
48 * Build
49 The Core consists of two major system: the *lisp* system and the
50 *rust* system. There is also an auxiliary *emacs* system containing a
51 complete Emacs IDE configuration which serves as the base for user
52 customizations.
53 
54 Building the core will produce its output to the =.stash= directory by
55 default. You can then test, run, and install the resulting files or
56 package them up to be shipped elsewhere.
57 
58 The core produces a collection of native program binaries, compiled
59 lisp modules in FASL format, as well as web distributions containing
60 the usual suspects (html, css, js) as well as wasm modules.
61 
62 ** From Source
63 *** Lisp
64 The Lisp Core can be found under the =lisp= directory. It is the
65 largest system, most actively developed, and is intended to cover the
66 complete surface of the user-facing APIs contained in the core.
67 
68 Starting from a standard Common Lisp environment with at least
69 [[https://www.quicklisp.org/beta/][Quicklisp]] installed, you can execute =./x.lisp build skel= to build
70 the project compiler and =./x.lisp run skel= to run it. This tool is a
71 convenience for building and testing different parts of the core from
72 a minimal dependency set.
73 
74 #+name: x-help
75 #+begin_src shell :exports both :results output
76 # bootstrap the core build tool
77 ./x.lisp --help
78 #+end_src
79 
80 #+RESULTS: x-help
81 #+begin_example
82 This is SBCL 2.4.7:76bbecb68, an implementation of ANSI Common Lisp.
83 More information about SBCL is available at <http://www.sbcl.org/>.
84 
85 SBCL is free software, provided as is, with absolutely no warranty.
86 It is mostly in the public domain; some portions are provided under
87 BSD-style licenses. See the CREDITS and COPYING files in the
88 distribution for more information.
89 To load "rt":
90  Load 1 ASDF system:
91  rt
92 ; Loading "rt"
93 
94 x.lisp --- core build tool
95 x.lisp [CMD]
96 CMDS:
97 test
98 compile
99 build
100 make
101 test
102 run
103 save
104 install
105 #+end_example
106 
107 To test the lisp standard library:
108 #+begin_src shell :results output :exports both
109 # test systems
110 ./x.lisp test std
111 #+end_src
112 
113 #+RESULTS:
114 #+begin_example
115 This is SBCL 2.4.7:dc890089a, an implementation of ANSI Common Lisp.
116 More information about SBCL is available at <http://www.sbcl.org/>.
117 
118 SBCL is free software, provided as is, with absolutely no warranty.
119 It is mostly in the public domain; some portions are provided under
120 BSD-style licenses. See the CREDITS and COPYING files in the
121 distribution for more information.
122 To load "rt":
123  Load 1 ASDF system:
124  rt
125 ; Loading "rt"
126 
127 To load "rt":
128  Load 1 ASDF system:
129  rt
130 ; Loading "rt"
131 
132 To load "std/tests":
133  Load 1 ASDF system:
134  std/tests
135 ; Loading "std/tests"
136 
137 in suite STD:
138 ; with 15 tests
139 #<PASS READTABLES>
140 #<PASS SYM>
141 #<PASS STRING>
142 #<PASS LIST>
143 #<PASS ERR>
144 #<PASS THREADS>
145 #<PASS TIMERS>
146 #<PASS FMT>
147 #<PASS ANA>
148 #<PASS PAN>
149 #<PASS ALIEN>
150 #<PASS CURRY>
151 #<PASS BITS>
152 #<PASS LEB128>
153 #<PASS TASKS>
154 No tests failed.
155 #+end_example
156 
157 To save the prelude to =.stash/prelude.core=:
158 #+begin_src shell :results output :noeval t
159 # save cores
160 ./x save prelude
161 #+end_src
162 
163 And to install binaries (defaults to =/usr/local/bin/=):
164 #+begin_src shell :results none :noeval t
165 # install binaries
166 sudo ./x install
167 #+end_src
168 
169 *** Rust
170 The Core Rust system can be found under the =rust= directory.
171 
172 A workspace is configured such that you can build all components with
173 the following command (~NOTE~ - takes a long time):
174 #+begin_src shell :exports both :results output
175  cd rust && cargo build --release
176 #+end_src
177 
178 *** Emacs
179 The core contains a collection of Emacs Lisp libraries under =emacs=
180 which may be installed for the current user using the corresponding
181 Makefile.
182 
183 ** TODO Bootstrap from packy :experimental:
184 The following can (maybe someday) be used to bootstrap the core without a full
185 lisp compiler.
186 #+begin_src shell :results output
187  curl --proto '=https' \
188  --tlsv1.3 \
189  -sSf \
190  https://packy.compiler.company/dist/x86_64-unknown-linux-gnu/bin/sk \
191  --output /tmp/sk
192  chmod +x /tmp/sk
193  /tmp/sk make skel
194 #+end_src
195 
196 #+RESULTS:
197 #+begin_example
198 This is SBCL 2.4.5, an implementation of ANSI Common Lisp.
199 More information about SBCL is available at <http://www.sbcl.org/>.
200 
201 SBCL is free software, provided as is, with absolutely no warranty.
202 It is mostly in the public domain; some portions are provided under
203 BSD-style licenses. See the CREDITS and COPYING files in the
204 distribution for more information.
205 To load "rt":
206  Load 1 ASDF system:
207  rt
208 ; Loading "rt"
209 
210 saving skel to: /home/ellis/comp/core/.stash/skel
211 To load "bin/skel":
212  Load 1 ASDF system:
213  bin/skel
214 ; Loading "bin/skel"
215 .........
216 [undoing binding stack and other enclosing state... done]
217 [performing final GC... done]
218 [saving current Lisp image into /home/ellis/comp/core/.stash/skel:
219 writing 15984 bytes from the static space at 0x50100000
220 writing 339476480 bytes from the dynamic space at 0x1000000000
221 writing 12498752 bytes from the read-only space at 0x74232dc00000
222 writing 0 bytes from the text space at (nil)
223 done]
224 #+end_example
225 
226 * Test
227 * Install
228 * Dist
229 * Programs
230 This section lists all program binaries provided by the core.
231 ** skel :lisp:
232 #+begin_src shell :results output :exports both
233  skel --help
234 #+end_src
235 
236 #+RESULTS:
237 #+begin_example
238 skel v0.1.1:ce91ffc6cc7a+ --- A hacker's project compiler.
239 
240  usage: skel [global] <command> [<arg>]
241 
242 options:
243  -h/--help* : print this message
244  -v/--version* : print version
245  -l/--level* : set log level (warn,info,debug,trace)
246  -c/--config* : set a custom skel user config
247  -i/--input* : input source
248  -o/--output* : output target
249 
250 commands:
251  init : initialize a skelfile in the current directory
252  -n/--name : project name
253  new : make a new skel project
254  -n/--name : project name
255  describe : describe a skelfile
256  show : show project slots
257  -f/--file : path to skelfile
258  -u/--user : print user configuration
259  -s/--system : print system configuration
260  vc : version control
261  -r/--root : repository path
262  id : print the project id
263  inspect : inspect the project skelfile
264  -f/--file : path to skelfile
265  make : build project targets
266  -t/--target : target to build
267  run : run a script or command
268  compile : compile source code
269  build : build programs and libraries
270  dist : distribute build artifacts
271  install : install stuff
272  pack : pack stuff
273  unpack : unpack stuff
274  bundle : bundle source code
275  unbundle : unbundle source code
276  clean : clean up the project
277  test : run tests
278  bench : run benchmark
279  status : print the vc status
280  push : push the current project upstream
281  pull : pull the current project from remote
282  clone : clone a remote project
283  commit : commit changes to the project vc
284  edit : edit a project file in emacs.
285  shell : open the sk-shell interpreter
286 
287 #+end_example
288 ** organ :lisp:
289 #+begin_src shell :results output :exports both
290 organ --help
291 #+end_src
292 
293 #+RESULTS:
294 #+begin_example
295 organ v0.0.1 --- org-mode toolbox
296 
297  usage: organ [global] <command> [<arg>]
298 
299 options:
300  -l/--level* : set the log level
301  -h/--help* : print help
302  -v/--version* : print version
303 
304 commands:
305  inspect : inspect an org file
306  show : display local org info
307  describe : describe local org info
308  parse
309 #+end_example
310 
311 ** packy :lisp:
312 #+begin_src shell :results output :exports both
313 packy --help
314 #+end_src
315 
316 #+RESULTS:
317 #+begin_example
318 packy v0.1.0 --- Universal Package Manager
319 
320  usage: packy [global] <command> [<arg>]
321 
322 options:
323  -l/--level* : set the log level
324  -h/--help* : print help
325  -v/--version* : print version
326 
327 commands:
328  show
329  -n/--name*
330  -t/--target
331  -t/--thunk*
332  -p/--pk-target*
333 #+end_example
334 
335 ** rdb :lisp:
336 #+begin_src shell :results output :exports both
337 rdb --help
338 #+end_src
339 
340 #+RESULTS:
341 
342 ** homer :lisp:
343 #+begin_src shell :results output :exports both
344 homer --help
345 #+end_src
346 
347 #+RESULTS:
348 #+begin_example
349 homer v0.1.0 --- user home manager
350 
351  usage: homer [global] <command> [<arg>]
352 
353 options:
354  -l/--level* : set the log level
355  -h/--help* : print help
356  -v/--version* : print version
357  -f/--force* : use force
358 
359 commands:
360  show
361  check
362  push
363  pull
364  install
365 #+end_example
366 
367 ** COMMENT alik :rust:
368 #+begin_src shell :results output :exports both
369 alik --help
370 #+end_src
371 
372 #+RESULTS:
373 
374 ** COMMENT krypt :lisp:
375 #+begin_src shell :results output :exports both
376 krypt --help
377 #+end_src
378 
379 #+RESULTS:
380 #+begin_example
381 Krypt CLI
382 
383 Usage: krypt [OPTIONS] [COMMAND]
384 
385 Commands:
386  check check service providers and config
387  show Show Krypt info
388  search Query the Krypt
389  help Print this message or the help of the given subcommand(s)
390 
391 Options:
392  -c, --cfg <CFG> Set the default config file [env: KRYPT_CONFIG_FILE=]
393  -u, --user <USER> Set a user for this command [env: USER=ellis]
394  -l, --level... Set log level
395  -h, --help Print help
396  -V, --version Print version
397 #+end_example
398 
399 ** mailman :rust:
400 #+begin_src shell :results output :exports both
401 mailman --help
402 #+end_src
403 
404 #+RESULTS:
405 #+begin_example
406 Mail client util
407 
408 Usage: mailman [OPTIONS] [COMMAND]
409 
410 Commands:
411  ping Ping the server
412  search Search for items
413  import Import an account
414  export Export an account
415  help Print this message or the help of the given subcommand(s)
416 
417 Options:
418  -c, --cfg <CFG> Set the default config file [env: MAILMAN_CONFIG_FILE=]
419  -u, --user <USER> Set a user for this command [env: USER=ellis]
420  -l, --level... Set log level
421  -h, --help Print help
422  -V, --version Print version
423 #+end_example
424