changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / readme.org

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