changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / readme.org

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