changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > notes / log.org

changeset 18: f52e43c891d7
parent: a63dfd1affed
child: 6fe19a3a492e
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 20 Sep 2024 20:00:07 -0400
permissions: -rw-r--r--
description: bump
1 #+title: log
2 #+author: Richard Westhaver
3 #+email: richard.westhaver@gmail.com
4 #+setupfile: ../clean.theme
5 * [2023-07-30 Sun]
6 :PROPERTIES:
7 :ID: 5a1f17a0-22bb-45bc-a313-ec2cb6c0bfd5
8 :END:
9 ** VC infrastructure
10 :PROPERTIES:
11 :ID: 9928339e-14d7-425d-a465-be87e2784590
12 :END:
13 In heptapod we have a root group named =comp=, containg a variety of
14 subgroups. Some of these groups should be public, while others are
15 internal to comp members exclusively. Within each subgroup, we should
16 have the root group members automatically granted privileged access to
17 projects. This is relevant for the =startup= subgroup in particular,
18 where each project is potentially maintained by multiple non-root
19 contributors.
20 
21 We also need to consider how we will manage subrepos across the
22 organization. It is about time we start integrating HG bundles and
23 potentially mirrors. For our core VC pipeline we should have no
24 reliance on Git, but this may be difficult. It depends on the behavior
25 of HG bundles.
26 
27 Bookmarks/tags should be used for milestones in the root group and are
28 infrequent. They are more frequent in projects with a regular release
29 life-cycle.
30 ** Approaching Webapps
31 :PROPERTIES:
32 :ID: bafaceb9-2798-484d-80b7-7ad5d84fff1a
33 :END:
34 I started poking around in the webapp space again so that I can launch
35 a landing page for NAS-T quickly. The Rust situation has improved
36 somewhat on the frontend side, and the axum backend stack is nice.
37 
38 This might seem like a lot of Rust and not a lot of Lisp, which it is,
39 but there's still room for Lisp wherever we need it. It mostly plays a
40 role in the backend, servicing the database and responding to requests
41 from the Rust edges. All of the important tests for the web APIs are
42 also written in Lisp. We will almost certainly use Lisp for all static
43 processing and HTML generation at compile-time.
44 
45 This I believe, is the appropriate way to integrate Lisp into a
46 cutting-edge web-app. You get the good parts of Lisp where you need
47 them (interactive debugging, dynamic language, REPL) and avoid the bad
48 parts (OOB optimization, RPS performance) in areas where the customer
49 would be impacted. In this domain, Lisp takes the form of a glue
50 rather than the bricks and mortar it sometimes appears to us as.
51 
52 * [2023-10-24 Tue]
53 :PROPERTIES:
54 :ID: 7bd213b5-9a4b-4490-b0b8-8a0a9b42a9c6
55 :END:
56 ** virt
57 :PROPERTIES:
58 :ID: 07c7016f-c653-4d69-9ca0-366a7584a212
59 :END:
60 *** QEMU
61 :PROPERTIES:
62 :ID: f53afecb-561e-4545-a6d0-dbf6d9504ec4
63 :END:
64 *** KVM
65 :PROPERTIES:
66 :ID: df9e07cd-986f-45a7-b9f7-ea88313c92ee
67 :END:
68 *** Hyper-V
69 :PROPERTIES:
70 :ID: 87b019ff-7f05-496d-b7bb-153fea7f8595
71 :END:
72 *** Firecracker
73 :PROPERTIES:
74 :ID: b1c52088-4244-4342-b884-c551ce43cc9c
75 :END:
76 *** Docker
77 :PROPERTIES:
78 :ID: d1969d15-8dc0-4499-bddb-f92fa19aec13
79 :END:
80 *** Vagrant
81 :PROPERTIES:
82 :ID: dd6e8169-fba6-45af-aaef-6acd9dbd7b3f
83 :END:
84 *** LXC
85 :PROPERTIES:
86 :ID: bd393c26-6014-42bb-a425-b9f72e5cee8b
87 :END:
88 *** LXD
89 :PROPERTIES:
90 :ID: 800ee282-7b5c-465f-a372-344079f9d875
91 :END:
92 *** containerd
93 :PROPERTIES:
94 :ID: 7f34835c-9135-4015-bdbd-99d28d7b40bb
95 :END:
96 *** systemd-nspawn
97 :PROPERTIES:
98 :ID: 9fef114a-e2f3-40b4-bddb-9948b47b441f
99 :END:
100 *** VirtualBox
101 :PROPERTIES:
102 :ID: 04594cbd-5847-434d-aaf6-a7e23058d980
103 :END:
104 
105 ** Concatenative
106 :PROPERTIES:
107 :ID: ad2041de-3915-48f9-950c-03b01968952d
108 :END:
109 *** Factor :factor:
110 :PROPERTIES:
111 :ID: edb7e4a8-d07d-4953-9b64-decdca1dd76f
112 :END:
113 - [2023-07-04 Tue]
114  Factor is a cool concatenative lang but unfortunately the C interface
115  (vm/master.h) no longer exists on the master branch.
116 *** Joy :joy:
117 :PROPERTIES:
118 :ID: 257365d1-1b2e-4abd-a2e3-5d1705e41bcf
119 :END:
120 
121 **** https://hypercubed.github.io/joy/html/j02maf.html
122 :PROPERTIES:
123 :ID: a685ec2b-fbdc-4724-ab22-12d8a4498f81
124 :END:
125 
126 **** [[https://builds.openlogicproject.org/content/incompleteness/arithmetization-syntax/arithmetization-syntax.pdf][arithmetization of syntax]]
127 :PROPERTIES:
128 :ID: 895a803a-63d5-4dfb-8ceb-c20627d97b02
129 :END:
130 ** Lisp :lisp:
131 :PROPERTIES:
132 :ID: 8109c42f-ccbb-4a08-ab99-1dced8b22a9f
133 :END:
134 These notes pertain to Lisp. More specifically, ANSI Common Lisp in
135 most places.
136 
137 - https://github.com/lispnik/iup/ - doesn't support MacOS yet, looks
138  cool though
139  - what we really need is wasm compiler.. TBD
140 ** Rust
141 :PROPERTIES:
142 :ID: 94a9a2b7-3559-476c-9edf-66b3b0c8cbb0
143 :END:
144 *** Serde
145 :PROPERTIES:
146 :ID: ffb4e87c-e265-4549-91f9-093e714708c0
147 :END:
148 - [2023-07-05 Wed] \\
149  important part of the Rust ecosystem, another dtolnay
150  contribution. If you want to program a /data/ format in the Rust
151  ecosystem, this is how you do it.
152 
153  The way it works is that you define some special structs, a
154  Serializer and a Deserializer which implement the Serialize and
155  Deserialize traits provided by serde, respectively.
156 
157  You can use these structs to provide your public API. The
158  conventional choice is public top-level functions like from-str
159  and to-string. That's it, your serialization library can now read and
160  write your data format as Rust data types.
161 
162  [[https://serde.rs/enum-representations.html][enum-representations]]
163  - the default behavior is an externally tagged representation (verbose)
164 
165  The docs use strings as core IO when implementing a custom format,
166  but the convention is to implement for T where T is bound by std::io
167  Read or Write trait. Then you can provide a more robust public API
168  (from_bytes, from_writer, etc).
169 ** C
170 :PROPERTIES:
171 :ID: 05a7192a-4c05-44d9-b859-e2a0cff53d86
172 :END:
173 ** CPP
174 :PROPERTIES:
175 :ID: 6800e89d-f49e-4ffe-bbab-ed10fec43174
176 :END:
177 ** Nu
178 :PROPERTIES:
179 :ID: b4048114-ec39-4e53-816f-2f1319d404ee
180 :END:
181 [[https://www.nushell.sh/][~]]
182 [[https://www.nushell.sh/cookbook/][cookbook]]
183 [[https://github.com/nushell/nu_scripts][nu_scripts]]
184 * [2023-11-01 Wed]
185 :PROPERTIES:
186 :ID: 6d461ba3-f8cb-4a69-b172-038efcca923a
187 :END:
188 ** AWS usage
189 :PROPERTIES:
190 :ID: a14a7916-6743-45e5-8711-ecded8092131
191 :END:
192 We're leveraging AWS for some of our public web servers for now. It's
193 really not realistic to expect that my home desktop and spotty Comcast
194 internet can serve any production workflow. What it /is/ capable of is
195 a private VPN, which can communicate with AWS and other cloud VPN
196 depots via WireGuard ([[https://dev.to/gabrieltetzner/setting-up-a-vpn-with-wireguard-server-on-aws-ec2-4a49][article]]).
197 
198 I currently use Google Domains for nas-t.net, otom8.dev, and
199 rwest.io - but that business is now owned by squarespace, so I would
200 rather move it to Route53.
201 
202 We have archlinux ec2 image builds [[https://wiki.archlinux.org/title/Arch_Linux_AMIs_for_Amazon_Web_Services][here]] and [[https://gitlab.com/anemos-io/archlinux-ec2][here]] - only half work and not
203 maintained, but it's a start. I'm not even sure if I should stick with
204 arch or cave and use Ubuntu or AWS Linux. We can serve the static
205 services with little cost, the only big spender will be the heptapod
206 instance which requires a larger instance and some workers.
207 
208 We'll try to keep the cost at or around $30/month.
209 * [2023-11-02 Thu]
210 :PROPERTIES:
211 :ID: b74a60a5-fdc1-4ef2-ac74-7ff5c1395d0c
212 :END:
213 ** IDEAS
214 :PROPERTIES:
215 :ID: a0d84027-06ea-4080-a40c-8fa86ed7ee7a
216 :END:
217 *** shed
218 :PROPERTIES:
219 :ID: 9fd5e6e1-bb06-4204-a5ed-01afb5d45379
220 :END:
221 :LOGBOOK:
222 - State "TODO" from [2023-04-07 Fri 23:24]
223 :END:
224 rlib
225 > ulib
226 > ulib
227 > ulib
228 > ulib
229 
230 **** sh* tools
231 :PROPERTIES:
232 :ID: 3daae7ec-4d0a-4f3e-bd5a-5202707fa614
233 :END:
234 :LOGBOOK:
235 - State "TODO" from "TODO" [2023-04-07 Fri 23:22]
236 :END:
237 shc,shx,etc
238 *** packy
239 :PROPERTIES:
240 :ID: 6b2b99d7-9d45-49fc-bff2-463a82c45f90
241 :END:
242 :LOGBOOK:
243 - State "TODO" from [2023-04-07 Fri 23:33]
244 :END:
245 **** rust
246 :PROPERTIES:
247 :ID: 0fbbf620-c3b7-4aa8-8a79-b25beca802d0
248 :END:
249 **** common-lisp
250 :PROPERTIES:
251 :ID: 7fd63e2e-532b-4742-9d25-6cacbfbf2ca0
252 :END:
253 **** emacs-lisp
254 :PROPERTIES:
255 :ID: 2e6a146a-9a81-4b49-9127-646838f5e137
256 :END:
257 **** python
258 :PROPERTIES:
259 :ID: 2d634517-84dc-4cf4-a95a-02ae2fe3c2cd
260 :END:
261 **** julia
262 :PROPERTIES:
263 :ID: 3d75df13-227c-4aee-a046-1443acdcf619
264 :END:
265 **** C
266 :PROPERTIES:
267 :ID: 8d44b6f9-e628-4983-aaa9-fea25117a303
268 :END:
269 **** C++
270 :PROPERTIES:
271 :ID: 7c0febaa-468c-4835-83ac-8280faa067b9
272 :END:
273 *** tenex
274 :PROPERTIES:
275 :ID: 4e5e71e4-be74-44d0-9221-74de37f11096
276 :END:
277 :LOGBOOK:
278 - State "TODO" from [2023-04-07 Fri 23:52]
279 :END:
280 *** mpk
281 :PROPERTIES:
282 :ID: f9200923-f406-4104-9efe-33efab186f90
283 :END:
284 :LOGBOOK:
285 - State "TODO" from [2023-04-07 Fri 23:52]
286 :END:
287 *** cfg
288 :PROPERTIES:
289 :ID: 57a76ed9-76b9-442e-9a8e-3a7deb63dec4
290 :END:
291 :LOGBOOK:
292 - State "TODO" from [2023-04-07 Fri 23:34]
293 :END:
294 *** obj
295 :PROPERTIES:
296 :ID: ce1ef5c1-61e0-4bed-84ff-bdf05d1cb379
297 :END:
298 :LOGBOOK:
299 - State "TODO" from [2023-04-07 Fri 23:51]
300 :END:
301 split out from rlib to separate package
302 - a purely OOP class library
303 *** lab
304 :PROPERTIES:
305 :ID: a9401df7-b77e-4648-bdcf-bc9f8d267faf
306 :END:
307 :LOGBOOK:
308 - State "TODO" from [2023-04-07 Fri 23:34]
309 :END:
310 *** source categories
311 :PROPERTIES:
312 :ID: bdfaf877-a8a8-47c0-83b2-7ae3d18fcb8c
313 :END:
314 - need a way of extracting metadata from a repo
315 - need ability to search and query libs/packages
316 - separate modules based on where they belong in our stack?
317  - app
318  - lib
319  - script?
320  - dist
321  - software distros
322 *** generic query language
323 :PROPERTIES:
324 :ID: 4cbbb5bd-6fb0-4249-bce3-c60137a0545d
325 :END:
326 from obj protocol?
327 sql compatibility?
328 
329 /check out kdb/
330 *** bbdb
331 :PROPERTIES:
332 :ID: 2ef1a2d7-19f5-4d65-a4aa-2f6abf07a202
333 :END:
334 :LOGBOOK:
335 - Note taken on [2023-10-24 Tue 22:16] \\
336  graph database, build on rocksdb
337 :END:
338 insidious Big Brother database.
339 - an application built with obj
340 - sql
341 
342 *** NAS-TV :nas:t:
343 :PROPERTIES:
344 :ID: 416d5836-fd77-4f7f-ad5c-831f20802a14
345 :END:
346 :LOGBOOK:
347 - State "NOTE" from "TODO" [2024-08-18 Sun 18:46]
348 :END:
349 - media streaming
350 - gstreamer backend
351 - audio/video
352 * [2023-11-05 Sun]
353 :PROPERTIES:
354 :ID: 195067ad-1c7b-498a-9a90-8c9abba192f5
355 :END:
356 ** DRAFT dylib-skel-1
357 :PROPERTIES:
358 :ID: 55fc90c8-4261-4fd2-b991-280e76f0e59c
359 :END:
360 - State "DRAFT" from [2023-11-05 Sun 22:23]
361 *** Overview
362 :PROPERTIES:
363 :ID: bd3b748b-e792-40b3-abb0-02c274038539
364 :END:
365 Our core languages are [[https://www.rust-lang.org/][Rust]] and [[https://lisp-lang.org/][Lisp]] - this is the killer combo which will allow NAS-T
366 to rapidly develop high-quality software. As such, it's crucial that these two very
367 different languages (i.e. compilers) are able to interoperate seamlessly.
368 
369 Some interop methods are easy to accomodate via the OS - such as IPC or data sharing,
370 but others are a bit more difficult.
371 
372 In this 2-part series we'll build a FFI bridge between Rust and Lisp, which is something
373 that /can/ be difficult, due to some complications with Rust and because this is not the
374 most popular software stack (yet ;). This is an experiment and may not make it to our
375 code-base, but it's definitely something worth adding to the toolbox in case we need it.
376 
377 *** FFI
378 :PROPERTIES:
379 :ID: c2ccef54-e93d-406a-af1d-ebb7ad1a935b
380 :END:
381 The level of interop we're after in this case is [[https://en.wikipedia.org/wiki/Foreign_function_interface][FFI]].
382 
383 Basically, calling Rust code from Lisp and vice-versa. There's an article about calling
384 Rust from Common Lisp [[https://dev.to/veer66/calling-rust-from-common-lisp-45c5][here]] which shows the basics and serves as a great starting point
385 for those interested.
386 **** Rust != C
387 :PROPERTIES:
388 :ID: bb68152d-1794-47d8-86c0-03eb7f9256d7
389 :END:
390 The complication(s) with Rust I mentioned early is really just that /it is not C/. =C=
391 is old, i.e. well-supported with a stable ABI, making the process of creating bindings
392 for a C library a breeze in many languages.
393 
394 For a Rust library we need to first appease the compiler, as explained in [[https://doc.rust-lang.org/nomicon/ffi.html#calling-rust-code-from-c][this section]]
395 of the Rustonomicon. Among other things it involves changing the calling-convention of
396 functions with a type signature and editing the Cargo.toml file to produce a
397 C-compatible ABI binary. The Rust default ABI is unstable and can't reliably be used
398 like the C ABI can.
399 
400 **** Overhead
401 :PROPERTIES:
402 :ID: f74790d6-8fa9-4e76-8362-71f074058947
403 :END:
404 Using FFI involves some overhead. Check [[https://github.com/dyu/ffi-overhead][here]] for an example benchmark across a few
405 languages. While building the NAS-T core, I'm very much aware of this, and will need a
406 few sanity benchmarks to make sure the cost doesn't outweigh the benefit. In particular,
407 I'm concerned about crossing multiple language barriers (Rust<->C<->Lisp).
408 
409 *** Rust -> C -> Lisp
410 :PROPERTIES:
411 :ID: 3d8e8664-337b-4bf1-832d-bc29e9761d56
412 :END:
413 **** Setup
414 :PROPERTIES:
415 :ID: 7c1a259a-8bc1-4a42-abb7-8d61d0a1c22d
416 :END:
417 For starters, I'm going to assume we all have Rust (via =rustup=) and Lisp (=sbcl= only)
418 installed on our GNU/Linux system (some tweaks needed for Darwin/Windows, not covered in
419 this post).
420 ***** Cargo
421 :PROPERTIES:
422 :ID: 21b8d6b0-27fd-460d-b584-55765c5f7761
423 :END:
424 Create a new library crate. For this example we're focusing on a 'skeleton' for
425 /dynamic/ libraries only, so our experiment will be called =dylib-skel= or *dysk* for
426 short.
427 src_sh[:exports code]{cargo init dysk --lib && cd dysk}
428 
429 A =src/lib.rs= will be generated for you. Go ahead and delete that. We're going to be
430 making our own =lib.rs= file directly in the root directory (just to be cool).
431 
432 The next step is to edit your =Cargo.toml= file. Add these lines after the =[package]=
433 section and before =[dependencies]=:
434 #+begin_src conf-toml
435 [lib]
436 crate-type = ["cdylib","rlib"]
437 path = "lib.rs"
438 [[bin]]
439 name="dysk-test"
440 path="test.rs"
441 #+end_src
442 
443 This tells Rust to generate a shared C-compatible object with a =.so= extension which we
444 can open using [[https://man.archlinux.org/man/dlopen.3.en][dlopen]].
445 ***** cbindgen
446 :PROPERTIES:
447 :ID: 45c0e1cd-a441-4877-8b64-d30bc0381da2
448 :END:
449 ****** install
450 :PROPERTIES:
451 :ID: d11805bf-1238-4359-ab52-6e6d1b74dc33
452 :END:
453 Next, we want the =cbindgen= program which we'll use to generate header files for
454 C/C++. This step isn't necessary at all, we just want it for further experimentation.
455 
456 src_sh[:exports code]{cargo install --force cbindgen}
457 
458 We append the =cbindgen= crate as a /build dependency/ to our =Cargo.toml= like so:
459 #+begin_src conf-toml
460 [build-dependencies]
461 cbindgen = "0.24"
462 #+end_src
463 ****** cbindgen.toml
464 :PROPERTIES:
465 :ID: e33424c1-a328-4e86-b817-86e171584944
466 :END:
467 #+begin_src conf-toml :tangle cbindgen.toml
468 language = "C"
469 autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
470 include_version = true
471 namespace = "dysk"
472 cpp_compat = true
473 after_includes = "#define DYSK_VERSION \"0.1.0\""
474 line_length = 88
475 tab_width = 2
476 documentation = true
477 documentation_style = "c99"
478 usize_is_size_t = true
479 [cython]
480 header = '"dysk.h"'
481 #+end_src
482 ****** build.rs
483 :PROPERTIES:
484 :ID: 0e465a4e-6709-4920-bb8a-514189f36f84
485 :END:
486 #+begin_src rust :tangle build.rs
487 fn main() -> Result<(), cbindgen::Error> {
488  if let Ok(b) = cbindgen::generate(std::env::var("CARGO_MANIFEST_DIR").unwrap()) {
489  b.write_to_file("dysk.h"); Ok(())}
490  else { panic!("failed to generate dysk.h from cbindgen.toml") } }
491 #+end_src
492 **** lib.rs
493 :PROPERTIES:
494 :ID: 884ae229-0b41-4de3-880b-fb31058dc00a
495 :END:
496 #+begin_src rust :tangle lib.rs
497 //! lib.rs --- dysk library
498 use std::ffi::{c_char, c_int, CString};
499 #[no_mangle]
500 pub extern "C" fn dysk_hello() -> *const c_char {
501  CString::new("hello from rust").unwrap().into_raw()}
502 #[no_mangle]
503 pub extern "C" fn dysk_plus(a:c_int,b:c_int) -> c_int {a+b}
504 #[no_mangle]
505 pub extern "C" fn dysk_plus1(n:c_int) -> c_int {n+1}
506 #+end_src
507 **** test.rs
508 :PROPERTIES:
509 :ID: b8b27643-3c41-412c-afb7-12e980ffffb3
510 :END:
511 #+begin_src rust :tangle test.rs
512 //! test.rs --- dysk test
513 fn main() { let mut i = 0u32; while i < 500000000 {i+=1; dysk::dysk_plus1(2 as core::ffi::c_int);}}
514 #+end_src
515 **** compile
516 :PROPERTIES:
517 :ID: 4d429e91-1b3b-40eb-86c0-b4896e277423
518 :END:
519 #+begin_src sh
520 cargo build --release
521 #+end_src
522 **** load from SBCL
523 :PROPERTIES:
524 :ID: 9db4d715-421c-4a06-ad25-68aa79396d3a
525 :END:
526 #+begin_src lisp :tangle dysk.lisp
527 (load-shared-object #P"target/release/libdysk.so")
528 (define-alien-routine dysk-hello c-string)
529 (define-alien-routine dysk-plus int (a int) (b int))
530 (define-alien-routine dysk-plus1 int (n int))
531 (dysk-hello) ;; => "hello from rust"
532 #+end_src
533 **** benchmark
534 :PROPERTIES:
535 :ID: 88cd9e83-64da-4aa4-ab12-125b127bca06
536 :END:
537 #+begin_src shell
538 time target/release/dysk-test
539 #+end_src
540 #+begin_src lisp :tangle test.lisp
541 (time (dotimes (_ 500000000) (dysk-plus1 2)))
542 #+end_src
543 * [2023-11-24 Fri]
544 :PROPERTIES:
545 :ID: 509a06ab-1a3d-4d5c-92e1-6fc50e8d1c00
546 :END:
547 ** cl-dot examples
548 :PROPERTIES:
549 :ID: df12c00f-0264-4f08-bff6-a327c7089b4c
550 :END:
551 #+begin_src lisp
552 (defmethod cl-dot:graph-object-node ((graph (eql 'example)) (object cons))
553  (make-instance 'cl-dot:node
554  :attributes '(:label "cell \\N"
555  :shape :box)))
556 (defmethod cl-dot:graph-object-points-to ((graph (eql 'example)) (object cons))
557  (list (car object)
558  (make-instance 'cl-dot:attributed
559  :object (cdr object)
560  :attributes '(:weight 3))))
561 ;; Symbols
562 (defmethod cl-dot:graph-object-node ((graph (eql 'example)) (object symbol))
563  (make-instance 'cl-dot:node
564  :attributes `(:label ,object
565  :shape :hexagon
566  :style :filled
567  :color :black
568  :fillcolor "#ccccff")))
569 (let* ((data '(a b c #1=(b z) c d #1#))
570  (dgraph (cl-dot:generate-graph-from-roots 'example (list data)
571  '(:rankdir "LR" :layout "twopi" :labelloc "t"))))
572  (cl-dot:dot-graph dgraph "test-lr.svg" :format #+nil :x11 :svg))
573 #+end_src
574 
575 #+RESULTS:
576 
577 #+begin_src lisp
578 (let* ((data '(a b))
579  (dgraph (cl-dot:generate-graph-from-roots 'example (list data)
580  '(:rankdir "LR"))))
581  (cl-dot:print-graph dgraph))
582 #+end_src
583 
584 * [2023-12-05 Tue]
585 :PROPERTIES:
586 :ID: 4f1d099a-2f9a-40c3-8cf7-57df6e660455
587 :END:
588 ** global refs
589 :PROPERTIES:
590 :ID: a05618ad-ada2-44be-9260-8acc0cf30d4d
591 :END:
592 need a way of indexing, referring to, and annotating objects such as
593 URLs, docs, articles, source files, etc.
594 
595 What is the best way to get this done?
596 * [2023-12-09 Sat]
597 :PROPERTIES:
598 :ID: e304a97e-49fe-4fde-a273-7d3f78231033
599 :END:
600 ** doc best practices
601 :PROPERTIES:
602 :ID: ea2f3f8e-1c8c-4c05-b16c-fb197d346409
603 :END:
604 https://rust-lang.github.io/api-guidelines/documentation.html
605 
606 also: https://lisp-lang.org/style-guide/
607 * [2023-12-12 Tue]
608 :PROPERTIES:
609 :ID: eff3b823-6ffd-4355-b289-bdcd7b31ee54
610 :END:
611 ** On Computers
612 :PROPERTIES:
613 :ID: 11bd7a7c-4d0c-4d7f-a487-dc59052da2b3
614 :END:
615 If you've met me in the past decade, you probably know that I am
616 extremely passionate about computers. Let me first explain why.
617 
618 On the most basic level computers are little (or big) machines that
619 can be programmed to do things, or /compute/ if we're being
620 technical.[fn:1]
621 
622 They host and provide access to the Internet, which is a pretty big
623 thing, but they do little things too like unlock your car door and
624 tell your microwave to beep at you. They solve problems. Big or small.
625 
626 They're also /everywhere/ - which can be scary to think about, but
627 ultimately helps propel us into the future.
628 
629 There's something pretty cool about that - when you look at the
630 essence of computation. There are endless quantities of these machines
631 which follow the same basic rules and can be used to solve /real/
632 problems.
633 
634 *** The Programmer
635 :PROPERTIES:
636 :ID: f75f9b5b-ec2b-4f62-9fee-1ed3cef4ac50
637 :END:
638 Now, let us consider the /programmer/. They have power. /real/
639 power. They understand the language of computers, can whisper to them
640 in various dialects. It can be intimidating to witness until you
641 realize how often the programmer says the wrong thing - a bug.
642 
643 In reality, the programmer has a symbiotic relationship with
644 computers. Good programmers understand this relationship well.
645 
646 #+begin_annecdote
647 One day after I got my first job at a software company, I remember
648 being on an all-hands meeting due to a client service outage. We had
649 some management, our lead devs, product team, and one curious looking
650 man who happened to be our lead IT consultant who had just joined. He
651 was sitting up on a hotel bed, shirtless, vaping an e-cig, typing
652 away in what I can only imagine was a shell prompt.
653 
654 After several minutes he took a swig from a bottle of Coke and said
655 "Node 6 is sick." then a few seconds later our services were
656 restored. For the next hour on the call he explained what happened and
657 why, but that particular phrase always stuck with me. He didn't say
658 Node 6 was down, or had an expired cert - his diagnosis was that /it/
659 was /sick/.
660 #+end_annecdote
661 
662 The more you work closely with computers, the more you start to think
663 of them this way. You don't start screaming when the computer does the
664 wrong thing, you figure out what's wrong and learn from it. With
665 experience, you start to understand the different behaviors of the
666 machines you work with. I like to call this /Machine Empathy/.
667 
668 *** Programs
669 :PROPERTIES:
670 :ID: b1187fd8-4d19-4566-827c-5594fbf90df7
671 :END:
672 I already mentioned bugs - I write plenty of those, but usually I try
673 to write /programs/. Programs to me are like poetry. I like to think
674 they are for the computer too.
675 
676 Just like computers, /computer programs/ come in different shapes and
677 sizes but in basic terms they are sets of instructions used to control
678 a computer.
679 
680 You can write programs to do anything - when I first started, my
681 programs made music. The program was a means to an end. Over time, I
682 started to see the program as something much more. I saw it as the
683 music itself.
684 
685 [fn:1] ... perform computations
686 
687 ** On Infra
688 :PROPERTIES:
689 :ID: 332145f8-50b4-46d1-8368-ddaf097c875f
690 :END:
691 Something that is missing from many organizations big or large, is an
692 effective way to store and access information, even about their own
693 org.
694 
695 It can be difficult problem to solve - usually there's the official
696 one, say Microsoft Sharepoint and then the list of unofficial sources
697 which becomes tribal corporate hacker knowledge. Maybe the unofficial
698 ones are more current, or are annotated nicely, but their very
699 existence breaks the system. There's no longer a single source of
700 truth.
701 
702 My priority in this department is writing services which process and
703 store information from a variety of sources in a distributed knowledge
704 graph. The graph can later be queried to access information on-demand.
705 
706 My idea of infrastructure is in fact to build my own Cloud. Needless
707 to say I don't have an O365 subscription, and wherever possible I'll
708 be relying on hardware I have physical access to. I'm not opposed to
709 cloud services at large but based on principle I like to think we
710 shouldn't be built on them.
711 * [2023-12-23 Sat]
712 :PROPERTIES:
713 :ID: 67b51ca5-909b-495f-b263-5979efe36448
714 :END:
715 ** https://cal-coop.gitlab.io/utena/utena-specification/main.pdf
716 :PROPERTIES:
717 :ID: 03b3d70c-5ab6-4be8-b811-a7ba7f84be8f
718 :END:
719 from the author of cl-decentralise2. draft specification of a
720 /Maximalist/ Computing System.
721 * [2023-12-24 Sun]
722 :PROPERTIES:
723 :ID: bcc178c2-6a96-4ad9-98db-4ddf045e6371
724 :END:
725 ** public datasets
726 :PROPERTIES:
727 :ID: 59e3ba53-3f40-47db-929c-acc998f9092d
728 :END:
729 https://github.com/awesomedata/awesome-public-datasets
730 https://docs.openml.org/Datasets/
731 https://wiki.pathmind.com/open-datasets
732 * [2023-12-28 Thu]
733 :PROPERTIES:
734 :ID: db3d353b-8f1c-4645-a4ad-459d36392b22
735 :END:
736 ** useful internals
737 :PROPERTIES:
738 :ID: a8ee911d-6d19-452b-b03a-249a446c1b20
739 :END:
740 #+begin_src lisp
741  sb-sys:*runtime-dlhandle*
742  sb-fasl:+fasl-file-version+
743  sb-fasl:+backend-fasl-file-implementation+
744  sb-debug:print-backtrace
745  sb-debug:map-backtrace
746  sb-pretty:pprint-dispatch-table
747  sb-lockless:
748  sb-ext:simd-pack
749  sb-walker:define-walker-template
750  sb-walker:macroexpand-all
751  sb-walker:walk-form
752  sb-kernel:empty-type
753  sb-kernel:*eval-calls*
754  sb-kernel:*gc-pin-code-pages*
755  sb-kernel:*restart-clusters*
756  sb-kernel:*save-lisp-clobbered-globals*
757  sb-kernel:*top-level-form-p*
758  sb-kernel:*universal-fun-type*
759  sb-kernel:*universal-type*
760  sb-kernel:*wild-type*
761  sb-kernel:+simd-pack-element-types+
762  (sb-vm:memory-usage)
763  (sb-vm:boxed-context-register)
764  (sb-vm:c-find-heap->arena)
765  (sb-vm:copy-number-to-heap)
766  (sb-vm:dump-arena-objects)
767  (sb-vm:fixnumize)
768  (sb-vm:rewind-arena)
769  (sb-vm:show-heap->arena)
770  (sb-vm:with/without-arena)
771  (sb-cltl2:{augment-environment,compiler-let,define-declaration,parse-macro})
772  (sb-cltl2:{declaration-information, variable-information, function-information})
773  sb-di:
774  sb-assem:
775  sb-md5:
776  sb-regalloc:
777  sb-disassem:
778 #+end_src
779 * [2024-01-03 Wed]
780 :PROPERTIES:
781 :ID: b83e3b40-17cc-4fc0-a412-d8b3f8733354
782 :END:
783 ** [[https://github.com/sigmf/SigMF][SigMF]]
784 :PROPERTIES:
785 :ID: 82a9833e-39f8-434f-94b4-4f34ce2fef25
786 :END:
787 #+begin_quote
788 Sharing sets of recorded signal data is an important part of science
789 and engineering. It enables multiple parties to collaborate, is often
790 a necessary part of reproducing scientific results (a requirement of
791 scientific rigor), and enables sharing data with those who do not have
792 direct access to the equipment required to capture it.
793 
794 Unfortunately, these datasets have historically not been very
795 portable, and there is not an agreed upon method of sharing metadata
796 descriptions of the recorded data itself. This is the problem that
797 SigMF solves.
798 
799 By providing a standard way to describe data recordings, SigMF
800 facilitates the sharing of data, prevents the "bitrot" of datasets
801 wherein details of the capture are lost over time, and makes it
802 possible for different tools to operate on the same dataset, thus
803 enabling data portability between tools and workflows.
804 #+end_quote
805 
806 the-spec: https://github.com/sigmf/SigMF/blob/sigmf-v1.x/sigmf-spec.md
807 ** [[https://www.libvolk.org/][LibVOLK]]
808 :PROPERTIES:
809 :ID: af88cd62-2610-4ba7-a5f4-d98c942c81dc
810 :END:
811 Vector-Optimized Library of Kernels (simd)
812 ** [[https://docs.kernel.org/fb/framebuffer.html][/dev/fb*]]
813 :PROPERTIES:
814 :ID: b866d034-2d59-4e1e-934f-02903b3de8e7
815 :END:
816 framebuffers, used by fbgrab/fbcat program
817 ** [[https://docs.kernel.org/block/ublk.html][ublk]]
818 :PROPERTIES:
819 :ID: d58cb494-ce43-49cc-859b-aa6a518ac314
820 :END:
821 https://github.com/ming1/ubdsrv
822 * [2024-01-04 Thu]
823 :PROPERTIES:
824 :ID: 86fdf7a7-9d26-4ce5-95a2-484db1843fb3
825 :END:
826 goals:
827 make problems smaller.
828 
829 sections:
830 why lisp?
831 - doesn't need mentioning more and more
832 * [2024-01-20 Sat]
833 :PROPERTIES:
834 :ID: e8015df1-c8f3-4766-9cda-e4bb87c9aa62
835 :END:
836 ** TODO taobench demo
837 :PROPERTIES:
838 :ID: 72d7e1cf-79a4-4f30-88da-bb0c13551b1f
839 :END:
840 :LOGBOOK:
841 - State "TODO" from [2024-01-21 Sun 00:32]
842 :END:
843 https://github.com/audreyccheng/taobench - shouldn't have missed this :)
844 obviously we need to implement this using core -- in demo/bench/tao?
845 ** TODO clap completion for nushell
846 :PROPERTIES:
847 :ID: 91d3f9ba-92ab-43c7-ac0f-5fab172b7ba1
848 :END:
849 :LOGBOOK:
850 - State "TODO" from [2024-01-20 Sat 23:23]
851 :END:
852 https://github.com/clap-rs/clap/tree/master/clap_complete_nushell
853 ** Dataframe scripting
854 :PROPERTIES:
855 :ID: 23ba507b-8d56-4e1c-bbd6-0d2f5983e792
856 :END:
857 https://studioterabyte.nl/en/blog/polars-vs-pandas
858 nushell supports DFs, polars underneath?
859 https://www.nushell.sh/book/cheat_sheet.html
860 
861 #+begin_src nushell
862 
863 #+end_src
864 ** Cloud Squatting
865 :PROPERTIES:
866 :ID: 31263e62-7de6-425a-8b3e-0522b4222322
867 :END:
868 *** Google
869 :PROPERTIES:
870 :ID: e9724ccb-f4f6-4f75-816e-34887e2fd776
871 :END:
872 - [[https://cloud.google.com/free/docs/free-cloud-features][Free Cloud Features]]
873  + 90-day $300 credits
874  + e2-micro - free hours worth 1 instance/month
875  +
876 *** Amazon
877 :PROPERTIES:
878 :ID: 048a6b82-2a8f-480b-a892-b8c80f97a13c
879 :END:
880 - AWS Free Tier
881 *** Akamai
882 :PROPERTIES:
883 :ID: af1dbf25-4b58-4a89-a968-9a8f24499419
884 :END:
885 - Linode Free Trial
886 *** Oracle
887 :PROPERTIES:
888 :ID: d2316ff4-4448-4209-87ca-22572def8125
889 :END:
890 - [[https://www.oracle.com/cloud/free/?intcmp=ohp052322ocift][OCI Free Tier]]
891  + always free: 2 x oracle autonomous DB
892  + 2 x AMD Compute VMs
893  + up to 4 x ARM Ampere A1 with 3k/cpu/hr and 18k/gb/h per month
894  + block/object/archive storage
895  + 30-day $300 credits
896 * [2024-01-29 Mon]
897 :PROPERTIES:
898 :ID: 9bad5422-eea9-4328-a68e-fd2180da2df1
899 :END:
900 ** trash as block device
901 :PROPERTIES:
902 :ID: cdf84840-46dd-42f3-82df-f5b57c908118
903 :END:
904 :LOGBOOK:
905 - State "NOTE" from [2024-01-29 Mon 20:53]
906 - State "NOTE" from [2024-01-29 Mon 20:53]
907 :END:
908 in nushell there is option for rm command to always use 'trash' -
909 AFAIK the current approach is via a service (trashd).
910 
911 An interesting experiment would be to designate a block device as
912 'trash' - may be possible to remove reliance on a service
913 
914 may be an opportunity for ublk driver to shine - instead of /dev/null
915 piping we need a driver for streaming a file to /dev/trash
916 ** compute power
917 :PROPERTIES:
918 :ID: fdc5a933-6792-40e0-914e-49629a4d7332
919 :END:
920 :LOGBOOK:
921 - State "NOTE" from [2024-01-29 Mon 16:28]
922 :END:
923 - mostly x86_64 machines - currently 2 AWS EC2 instances, some podman containers, and our home beowulf server:
924 - beowulf:
925  - Zor
926  - mid-size tower enclosed (Linux/Windows)
927  - CPU
928  - Intel Core i7-6700K
929  - 4 @ 4.0
930  - GPU
931  - NVIDIA GeForce GTX 1060
932  - 6GB
933  - Storage
934  - Samsung SSD 850: 232.9GB
935  - Samsung SSD 850: 465.76GB
936  - ST2000DM001-1ER1: 1.82TB
937  - WDC WD80EAZZ-00B: 7.28TB
938  - PSSD T7 Shield: 3.64TB
939  - My Passport 0820: 1.36TB
940  - RAM
941  - 16GB (2*8) [64GB max]
942  - DDR4
943  - Jekyll
944  - MacBook Pro 2019 (MacOS/Darwin)
945  - CPU
946  - Intel
947  - 8 @
948  - RAM
949  - 32G DDR4
950  - Hyde
951  - Thinkpad
952  - CPU
953  - Intel
954  - 4 @
955  - RAM
956  - 24G DDR3
957  - Boris
958  - Pinephone Pro
959  - CPU
960  - 64-bit 6-core 4x ARM Cortex A53 + 2x ARM Cortex A72
961  - GPU
962  - Mali T860MP4
963  - RAM
964  - 4GB LPDDR4
965  - pi
966  - Raspberry Pi 4 Model B
967  - CPU
968  - Cortex-A72 (ARM v8) 64-bit SoC
969  - 4 @ 1.8GHz
970  - RAM
971  - 8 GB
972  - DDR4 4200
973 * [2024-02-10 Sat]
974 :PROPERTIES:
975 :ID: d05fd1f5-2f85-485f-8963-11a1cd2322fc
976 :END:
977 ** BigBenches
978 :PROPERTIES:
979 :ID: d7e1885d-fb19-448c-beb6-0ed0bd701cec
980 :END:
981 #+name: 1trc-nu
982 #+begin_src nushell
983  let ms = '1trc/measurements-0.parquet'
984  dfr open $ms
985  | dfr group-by station
986  | dfr agg [
987  (dfr col measure | dfr min | dfr as "min")
988  (dfr col measure | dfr max | dfr as "max")
989  (dfr col measure | dfr sum | dfr as "sum")
990  (dfr col measure | dfr count | dfr as "count")
991  ]
992 #+end_src
993 * [2024-02-18 Sun]
994 :PROPERTIES:
995 :ID: 908fd9e6-6307-402c-ba76-813e82839f53
996 :END:
997 ** WL vs X
998 :PROPERTIES:
999 :ID: 9a398886-858a-450b-9029-2339cc551bc3
1000 :END:
1001 :LOGBOOK:
1002 - State "NOTE" from [2024-02-18 Sun 11:55]
1003 :END:
1004 In the past few months there has been drama regarding Wayland vs X. It
1005 seems to be on everyone's minds after Artem's freakout issue and the
1006 follow up YT vids/comments.
1007 
1008 I admit that it made me reconsider the fitness of WL as a whole -
1009 there was a github gist that made some scathing arguments against it.
1010 
1011 It's an odd debate though. I think there are many misunderstandings.
1012 
1013 So first off, if we look at the homepage
1014 https://wayland.freedesktop.org/, Wayland claims it is a replacement
1015 for X11. It now has /manifest destiny/, which in my opinion is a great
1016 shame.
1017 
1018 X-pros seem to agree that Wayland has /manifest destiny/ - like if you
1019 are building softwares that look remotely like a window system, it's a
1020 successor to X. That's the model of doing things and there's no way
1021 around it.
1022 
1023 The disagreement starts with how this destiny - of an X2 - should be
1024 fulfilled. X-pros want a fork of X, but it's too late for
1025 that. WL-pros want X to run on top of Wayland compositor:
1026 https://wayland.freedesktop.org/xserver.html.
1027 
1028 Xwayland is a problem for me. From the project description: 'if we're
1029 migrating away from X, it makes sense to have a good backwards
1030 compatibility story.' Full disclosure: I have never done significant
1031 work on Xwayland, so perhaps my opinion is unwarranted. But I have no
1032 intention of attempting to maintain a computer system that uses
1033 Wayland and X clients at the same time.
1034 
1035 To me, X is ol' reliable. Every distro has first-class X support, and
1036 it runs on most systems with very little user intervention. Where it
1037 doesn't, there is 20+ years of dev history and battle-tested
1038 workarounds for you to find your solution in.
1039 
1040 Wayland is the new kid on the block, born just in 2008. It's a fresh
1041 start to one of the most difficult challenges in software - window
1042 systems. A re-write would be pointless though, and so the real
1043 value-add is in design. Wayland is designed as a protocol and
1044 collection of libraries which are implemented in your own
1045 compositor. Coming from Lisp - with ANSI Common Lisp and SRFIs, this
1046 feels right even if the implementation is something very different
1047 (compositor vs compiler).
1048 
1049 With X, it is assumed to be much harder to write an equivalent
1050 'compositor'. Here's the thing though - with a significantly complex X
1051 client implementation, it is /impossible/ to replicate in WL. This is
1052 really the crux of Artemi's argument in his issue. He asked for a 1:1
1053 equivalent X/WL comparison when no such thing exists, and in my
1054 opinion it is a waste of time.
1055 
1056 The WL core team is fully aware of this dichotomy, but also that this
1057 is in no way a problem or weakness in either system. It means they're
1058 different systems, goddammit.
1059 
1060 If it was up to me, Xwayland wouldn't exist. I understand why it does,
1061 and that it does make things easier for developers who need to support
1062 both, and users who have multiple apps with multiple windowing
1063 requirements. It's a bandaid though, and one that is particularly
1064 dangerous because it re-enforces the idea that Wayland is just X2 and
1065 that they're fully compatible.
1066 
1067 What interests me in the Wayland world right now is the idea of a
1068 small, modular, full-stack Wayland compositor API. There are several
1069 'kiosk' based compositors for single applications (cage), but these
1070 aren't complete solutions. It is possible to get much closer to the
1071 metal, and that's where I want to be so that I can build my own APIs
1072 on top - I don't want to live on top of X, and I certainly don't want
1073 to live on top of X on top of WL. I want a /pure/ solution that hides
1074 as little as possible, exposing the interesting bits.
1075 * [2024-03-01 Fri]
1076 :PROPERTIES:
1077 :ID: 5d5159dd-5887-4823-81c6-1624f8cc4fd4
1078 :END:
1079 ** TODO collect more data
1080 :PROPERTIES:
1081 :ID: 9e0339dd-17a8-436c-afd4-245437fe2fea
1082 :END:
1083 :LOGBOOK:
1084 - State "TODO" from [2024-03-01 Fri 15:27]
1085 :END:
1086 https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/
1087 weather - music - etc
1088 * [2024-03-02 Sat]
1089 :PROPERTIES:
1090 :ID: 148d3b53-be56-4c34-9313-cac26c57300e
1091 :END:
1092 ** On blocks and devices
1093 :PROPERTIES:
1094 :ID: 242a2380-3d87-403d-b529-0245e77ed1f0
1095 :END:
1096 :LOGBOOK:
1097 - State "NOTE" from [2024-03-02 Sat 21:30]
1098 :END:
1099 [[https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/dev.html][/dev]]
1100 In Linux, everything is a file.
1101 
1102 /dev/ contains special device files - usually block or character
1103 device.
1104 
1105 major, minor = category, device
1106 0, 5
1107 
1108 mknod - create special device files
1109 
1110 [[https://www.redhat.com/en/blog/linux-block-devices-hints-debugging-and-new-developments][redhat hints]]
1111 
1112 #+begin_src shell
1113  dd if=/dev/zero of=myfile bs=1M count=32
1114  losetup --show -f myfile
1115  ls -al /dev/loop0
1116  losetup -d /dev/loop0 #teardown
1117 #+end_src
1118 
1119 #+begin_src shell
1120  echo "sup dude" > /dev/loop0
1121  dd if=/dev/loop0 -bs=1
1122  dd if=/dev/nvme0 of=/dev/null progress=true
1123  #pacman -S hdparm
1124  hdparm -T /dev/nvme0
1125 #+end_src
1126 
1127 #+begin_src shell
1128 modprobe scsi_debug add_host=5 max_luns=10 num_tgts=2 dev_size_mb=16
1129 #+end_src
1130 
1131 sparsefiles: create with C, dd, or truncate
1132 
1133 #+begin_src shell :results output
1134 truncate --help
1135 #+end_src
1136 
1137 #+RESULTS:
1138 #+begin_example
1139 Usage: truncate OPTION... FILE...
1140 Shrink or extend the size of each FILE to the specified size
1141 
1142 A FILE argument that does not exist is created.
1143 
1144 If a FILE is larger than the specified size, the extra data is lost.
1145 If a FILE is shorter, it is extended and the sparse extended part (hole)
1146 reads as zero bytes.
1147 
1148 Mandatory arguments to long options are mandatory for short options too.
1149  -c, --no-create do not create any files
1150  -o, --io-blocks treat SIZE as number of IO blocks instead of bytes
1151  -r, --reference=RFILE base size on RFILE
1152  -s, --size=SIZE set or adjust the file size by SIZE bytes
1153  --help display this help and exit
1154  --version output version information and exit
1155 
1156 The SIZE argument is an integer and optional unit (example: 10K is 10*1024).
1157 Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,... (powers of 1000).
1158 Binary prefixes can be used, too: KiB=K, MiB=M, and so on.
1159 
1160 SIZE may also be prefixed by one of the following modifying characters:
1161 '+' extend by, '-' reduce by, '<' at most, '>' at least,
1162 '/' round down to multiple of, '%' round up to multiple of.
1163 
1164 GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
1165 Full documentation <https://www.gnu.org/software/coreutils/truncate>
1166 or available locally via: info '(coreutils) truncate invocation'
1167 #+end_example
1168 
1169 test mkfs.btrfs on 10T dummy block device
1170 #+begin_src shell
1171  dd if=/dev/zero of=/tmp/bb1 bs=1 count=1 seek=10T
1172  du -sh /tmp/bb1
1173  losetup --show -f /tmp/bb1
1174  mkfs.btrfs /dev/loop0
1175 #+end_src
1176 
1177 diagnostics
1178 #+begin_src shell
1179  iostat # pacman -S sysstat
1180  blktrace # paru -S blktrace
1181  iotop # pacman -S iotop
1182 #+end_src
1183 
1184 bcc/ trace: Who/which process is executing specific functions against
1185 block devices?
1186 
1187 bcc/biosnoop: Which process is accessing the block device, how many
1188 bytes are accessed, which latency for answering the requests?
1189 
1190 at the kernel level besides BPF we got kmods and DKMS,
1191 
1192 compression/de-duplication can be done via VDO kernel mod
1193 
1194 https://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support
1195 
1196 ** save-lisp-and-respawn
1197 :PROPERTIES:
1198 :ID: bef3c7e0-c929-434a-9118-cca57fcb5bd3
1199 :END:
1200 :LOGBOOK:
1201 - State "NOTE" from [2024-03-02 Sat 22:57]
1202 :END:
1203 #+begin_src lisp
1204  sb-ext:*save-hooks*
1205 #+end_src
1206 
1207 ** syslog for log
1208 :PROPERTIES:
1209 :ID: 570a1587-486c-49c0-bca4-9cbcfcd3013e
1210 :END:
1211 :LOGBOOK:
1212 - State "NOTE" from [2024-03-03 Sun 16:35]
1213 :END:
1214 sb-posix:
1215 - openlog syslog closelog
1216 - levels: emerg alert crit err warning notice info debug
1217 - setlogmask
1218 * [2024-03-13 Wed]
1219 :PROPERTIES:
1220 :ID: f2293a24-442b-458e-99c8-6488b85cb3c2
1221 :END:
1222 ** RESEARCH [[https://github.com/guicho271828/sbcl-wiki/wiki/][sbcl-wiki]]
1223 :PROPERTIES:
1224 :ID: 9a507eb4-2153-4abd-9be3-3b38b4989e8c
1225 :END:
1226 :LOGBOOK:
1227 - State "RESEARCH" from [2024-03-13 Wed 21:49]
1228 :END:
1229 ** IR1
1230 :PROPERTIES:
1231 :ID: ca497ebc-b3b0-419e-aa59-a082c96d61f6
1232 :END:
1233 ** IR2
1234 :PROPERTIES:
1235 :ID: c5d40dfe-b059-44f4-8d42-78f61f6e9a95
1236 :END:
1237 * [2024-03-17 Sun]
1238 :PROPERTIES:
1239 :ID: b9961009-0a47-4122-a5d7-a6e72e4b5f92
1240 :END:
1241 ** DB Benchmarking
1242 :PROPERTIES:
1243 :ID: 78f5150b-4ccb-4682-bf9c-60ed1649905d
1244 :END:
1245 :LOGBOOK:
1246 - State "NOTE" from [2024-02-04 Sun 20:40]
1247 :END:
1248 [[https://github.com/facebook/rocksdb/wiki/Benchmarking-tools][RocksDB benchmarking tools]]
1249 
1250 ** packy design
1251 :PROPERTIES:
1252 :ID: 1eae39fb-ccb4-419e-857a-cc357e1d3eda
1253 :END:
1254 :LOGBOOK:
1255 - State "NOTE" from [2024-01-25 Thu 22:39]
1256 :END:
1257 - API root: https://packy.compiler.company
1258 - source packs: https://vc.compiler.company/packy
1259 *** Lib
1260 :PROPERTIES:
1261 :ID: 3863c9f9-89d9-4233-b6e4-5c5bc0178e02
1262 :END:
1263 **** Types
1264 :PROPERTIES:
1265 :ID: 010cb138-70c4-4d2d-ba7b-ad423d861690
1266 :END:
1267 ***** Pack
1268 :PROPERTIES:
1269 :ID: b2bbc87a-dc55-4df8-81d1-a9de8429dad0
1270 :END:
1271 Primary data type of the library - typically represents a compressed
1272 archive, metadata, and ops.
1273 ***** Bundle
1274 :PROPERTIES:
1275 :ID: 432f7779-a93b-48f1-a095-25482c8d3702
1276 :END:
1277 Collection data type, usually contains a set of packs with metadata.
1278 ***** PackyEndpoint
1279 :PROPERTIES:
1280 :ID: c3c21988-8bb2-448a-a98a-f26cc862c2f3
1281 :END:
1282 Represents a Packy instance bound to a UDP socket
1283 ***** PackyEndpointConfig
1284 :PROPERTIES:
1285 :ID: f732c36f-6e55-4c44-a2fb-6514706ec326
1286 :END:
1287 Global endpoint configuration object
1288 ***** PackyClientConfig
1289 :PROPERTIES:
1290 :ID: 794952de-a5c5-4031-a1e1-0b1e0325584a
1291 :END:
1292 Configuration for outgoing packy connections on an endpoint
1293 ***** PackyServerConfig
1294 :PROPERTIES:
1295 :ID: b65636cc-0523-4a1b-992d-6aff66cbab5d
1296 :END:
1297 Configuration for incoming packy connection son an endpoint
1298 ***** PackyConnection
1299 :PROPERTIES:
1300 :ID: 74646244-ee39-4ef8-8193-d5484438b81b
1301 :END:
1302 Packy connection object
1303 **** Traits
1304 :PROPERTIES:
1305 :ID: dfe9d569-f951-4485-9b72-055e77404281
1306 :END:
1307 ***** PackyClient
1308 :PROPERTIES:
1309 :ID: 71d4af37-6e24-48ef-a49e-683ee41ce5d2
1310 :END:
1311 ****** query
1312 :PROPERTIES:
1313 :ID: 47424475-837c-4996-a1b9-3eb6599105d6
1314 :END:
1315 ****** install
1316 :PROPERTIES:
1317 :ID: e80b3402-6afd-4ad7-a800-790994867479
1318 :END:
1319 ****** update
1320 :PROPERTIES:
1321 :ID: f4801fb0-bace-48ae-ab63-1a5cac3ea98f
1322 :END:
1323 ****** login
1324 :PROPERTIES:
1325 :ID: 1f24bd33-1e00-4dc2-bc6c-fac8374e14f0
1326 :END:
1327 ****** logout
1328 :PROPERTIES:
1329 :ID: b1f91455-68bc-4cc6-94c7-5fb3544e7539
1330 :END:
1331 ****** pull
1332 :PROPERTIES:
1333 :ID: b718721a-3f22-4eb6-80bf-5e7d5def1346
1334 :END:
1335 ****** push
1336 :PROPERTIES:
1337 :ID: 7781e76b-51a4-42fd-929a-a1ff08ccb95b
1338 :END:
1339 ***** PackyServer
1340 :PROPERTIES:
1341 :ID: af8409ec-9865-46d3-a593-df109b45cdff
1342 :END:
1343 ****** start_packy_server
1344 :PROPERTIES:
1345 :ID: 13e65c38-9591-484d-be1d-3d4b98f95f41
1346 :END:
1347 ****** stop_packy_server
1348 :PROPERTIES:
1349 :ID: 3cae6660-755c-4242-ac4f-eccb7188c6b5
1350 :END:
1351 ****** start_packy_registry
1352 :PROPERTIES:
1353 :ID: 6ca2bd7d-9c1a-4790-a3a0-08bda811318b
1354 :END:
1355 ***** PackyRegistry
1356 :PROPERTIES:
1357 :ID: 1d2ad8dc-6aef-48fa-b079-71d8bb88832f
1358 :END:
1359 ****** register_pack
1360 :PROPERTIES:
1361 :ID: 43221579-6f71-42aa-8332-96af33531015
1362 :END:
1363 ****** register_user
1364 :PROPERTIES:
1365 :ID: 3c6034fa-d543-47cd-ae35-bcfd3f2b8150
1366 :END:
1367 ****** register_bundle
1368 :PROPERTIES:
1369 :ID: 1b041060-7f5e-48fe-8566-e4781a597686
1370 :END:
1371 * [2024-03-25 Mon]
1372 :PROPERTIES:
1373 :ID: c6e0fb44-21ba-4a94-bd04-e7528dc46dba
1374 :END:
1375 ** TBD investigate alieneval for phash opps
1376 :PROPERTIES:
1377 :ID: 18989904-85ad-403b-8195-5ba7f643437f
1378 :END:
1379 :LOGBOOK:
1380 - State "TBD" from [2024-03-25 Mon 18:56]
1381 :END:
1382 * [2024-04-19 Fri]
1383 :PROPERTIES:
1384 :ID: 8ffd1283-5a63-4fe3-868f-57a4f9f09f74
1385 :END:
1386 ** How it works
1387 :PROPERTIES:
1388 :ID: 1b26fcd9-8d32-4031-a0cc-7ed2e26a75d0
1389 :END:
1390 The backend services are written in Rust and controlled by a simple
1391 messaging protocol. Services provide common runtime capabilities known
1392 as the /service protocol/ but are specialized on a unique /service
1393 type/ which may in turn register their own /custom protocols/ (via
1394 core).
1395 
1396 Services are capable of dispatching data directly to clients, or
1397 storing data in the /database/ (sqlite, postgres, mysql).
1398 
1399 The frontend clients are pre-dominantly written in Common Lisp and
1400 come in many shapes and sizes. There is a cli-client, web-client
1401 (CLOG), docker-client (archlinux, stumpwm, McCLIM), and native-client
1402 which also compiles to WASM (slint-rs).
1403 
1404 ** Guide
1405 :PROPERTIES:
1406 :ID: 90772707-ee13-463a-b0b2-7884745ec640
1407 :END:
1408 *** Build
1409 :PROPERTIES:
1410 :ID: a2f7f5f5-0cbd-4aa4-b80e-afa1d86990cd
1411 :END:
1412 - *install dependencies*
1413  #+begin_src bash
1414  ./tools/deps.sh
1415  #+end_src
1416 - *make executables* \\
1417  Simply run =make build=. Read the ~makefile~ and change the options
1418  as needed.
1419 - MODE :: Mode (debug, release)
1420 - LISP :: Lisp (sbcl, cmucl, ccl)
1421 - CFG :: Config (default.cfg)
1422 *** Run
1423 :PROPERTIES:
1424 :ID: 572b1b68-f099-4bdb-9a06-9aa2186c17cc
1425 :END:
1426 #+begin_src shell
1427  ./demo -i
1428 #+end_src
1429 *** Config
1430 :PROPERTIES:
1431 :ID: cadb26fe-5fc1-4639-9bb1-abeb490e91af
1432 :END:
1433 Configs can be specified in JSON, TOML, RON, or of course SEXP. See
1434 =default.cfg= for an example.
1435 *** Play
1436 :PROPERTIES:
1437 :ID: a8296224-60bc-46e7-9fa0-9a600e9f869e
1438 :END:
1439 The high-level user interface is presented as a multi-modal GUI
1440 application which adapts to the specific application /instances/
1441 below.
1442 **** Weather
1443 :PROPERTIES:
1444 :ID: ec07eb9b-3f83-4ff7-9809-b8190572e821
1445 :END:
1446 This backend retrieves weather data using the NWS API.
1447 **** Stocks
1448 :PROPERTIES:
1449 :ID: a61d9eff-ffc9-42a4-a5ac-16d4a0cbd24e
1450 :END:
1451 The 'Stocks' backend features a stock ticker with real-time analysis
1452 capabilities.
1453 **** Bench
1454 :PROPERTIES:
1455 :ID: a23c7805-2b48-4910-9231-96a90a0467f2
1456 :END:
1457 This is a benchmark backend for testing the capabilities of our
1458 demo. It spins up some mock services and allows fine-grained control
1459 of input/throughput.
1460 ** tasks
1461 :PROPERTIES:
1462 :ID: ba4bdf0d-c29f-4643-af33-09de5e5d1d45
1463 :END:
1464 *** TODO DSLs
1465 :PROPERTIES:
1466 :ID: 4d7b2ef7-569a-40bf-b37d-d2e1d4dc01e2
1467 :END:
1468 - consider tree-sitter parsing layout, use as a guide for developing a
1469  single syntax which expands to Rust or C.
1470 - with-rs
1471 - with-c
1472 - with-rs/c
1473 - with-cargo
1474 - compile-rs/c
1475 **** TODO rs-macroexpand
1476 :PROPERTIES:
1477 :ID: ab16b2fb-ec87-4c0e-b0be-185a4ae93537
1478 :END:
1479 - rs-gen-file
1480 - rs-defmacro
1481 - rs-macros
1482 - rs-macroexpand
1483 - rs-macroexpand-1
1484 **** TODO c-macroexpand
1485 :PROPERTIES:
1486 :ID: 6e97665d-3e29-4c3a-8040-0a15eeb4bf0a
1487 :END:
1488 - c-gen-file h/c
1489 - c-defmacro
1490 - c-macros
1491 - c-macroexpand
1492 - c-macroexpand-1
1493 **** TODO slint-macroexpand
1494 :PROPERTIES:
1495 :ID: 629303bb-ab04-4840-8264-18f1b43fa748
1496 :END:
1497 - slint-gen-file
1498 - slint-defmacro
1499 - slint-macros
1500 - slint-macroexpand
1501 - slint-macroexpand-1
1502 **** TODO html (using who)
1503 :PROPERTIES:
1504 :ID: 09eb1d3a-4f73-4a29-95cf-92d589f7fec9
1505 :END:
1506 *** TODO web templates
1507 :PROPERTIES:
1508 :ID: 6c70f44f-4d03-4663-92c8-e4a5b8fedfc1
1509 :END:
1510 create a basic static page in CL which will be used to host Slint UIs
1511 and other WASM doo-dads in a browser.
1512 *** TODO CLI
1513 :PROPERTIES:
1514 :ID: bd213f5b-1abf-450f-b3f3-6093dd050ea8
1515 :END:
1516 using clingon, decide on generic options and write it up
1517 *** TODO docs
1518 :PROPERTIES:
1519 :ID: d5d980f2-c032-4e15-a1e6-067fee7197fc
1520 :END:
1521 work on doc generation -- Rust and CL should be accounted for.
1522 *** TODO tests
1523 :PROPERTIES:
1524 :ID: 92d6ff4d-a643-4f75-89cf-e19b0e2e0d9a
1525 :END:
1526 We have none! need to make it more comfy - set up testing in all Rust
1527 crates and for the lisp systems.
1528 * [2024-04-25 Thu]
1529 :PROPERTIES:
1530 :ID: ab37ae2a-b168-455e-a4f5-c8c1baada2be
1531 :END:
1532 ** https://docs.gitlab.com/ee/administration/backup_restore/migrate_to_new_server.html
1533 :PROPERTIES:
1534 :ID: d18c642a-b8f9-40ff-9f99-df4e9764bbd5
1535 :END:
1536 * [2024-07-31 Wed]
1537 :PROPERTIES:
1538 :ID: 4b9ab3c7-5ea3-4f1e-9e0e-db4be8548de4
1539 :END:
1540 ** alpine builders
1541 :PROPERTIES:
1542 :ID: ab5c8dc6-6941-4b5d-b624-8b232385ebf1
1543 :END:
1544 - make sure to apk add:
1545  - git, hg
1546  - clang
1547  - make
1548  - linux-headers
1549  - zstd-dev
1550  - libc-dev?
1551 * [2024-08-04 Sun]
1552 :PROPERTIES:
1553 :ID: cb3f0071-a1b9-4ef4-897a-c5edd3435a5e
1554 :END:
1555 ** bookmarks
1556 :PROPERTIES:
1557 :ID: 2a650229-df59-46b9-bd92-f5cdd9eab4d2
1558 :END:
1559 - How should such objects be represented within CORE?
1560 - skel/homer mostly
1561  - already have alias
1562 - not sure about obj/otherwise, prob not
1563 * [2024-08-08 Thu]
1564 :PROPERTIES:
1565 :ID: 298b1333-c6f7-45d3-9829-c4c831e84707
1566 :END:
1567 ** Intelligent Design in Software
1568 :PROPERTIES:
1569 :ID: c2e682b3-d72a-41b3-b093-16614e7852ff
1570 :END:
1571 - starting from a space where there are no external influences - a biome
1572 - answer questions regarding the nature of the software and its capabilities
1573 - incrementally adjust inter-dependencies
1574 - optimize
1575 - protect the biome at all costs
1576 - focus on composition
1577 - build applications
1578 - re-integrate lessons learned
1579 * [2024-08-16 Fri]
1580 :PROPERTIES:
1581 :ID: 2877ab07-156b-4b00-97fa-9b12952f0ac1
1582 :END:
1583 ** keys.compiler.company
1584 :PROPERTIES:
1585 :ID: 26922400-2249-4e1d-a2ed-8014df5ad341
1586 :END:
1587 :LOGBOOK:
1588 - State "NOTE" from [2024-08-16 Fri 22:00]
1589 :END:
1590 - public openpgp server
1591 - [[https://keys.compiler.company][keys.compiler.company]]
1592 - https://keys.openpgp.org/
1593 - [[vc:packy/hagrid/][packy/hagrid]]