changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / readme.org

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