# HG changeset patch # User Richard Westhaver # Date 1724033772 14400 # Node ID 6d54ccb29de49b69efad01615504eb7f00a88c3c # Parent db5ece2206cf159fe0a66862700ac3e52ab57ca8 weekend warrior diff -r db5ece2206cf -r 6d54ccb29de4 draft/a-bit-of-risc.org --- a/draft/a-bit-of-risc.org Mon Aug 12 18:31:37 2024 -0400 +++ b/draft/a-bit-of-risc.org Sun Aug 18 22:16:12 2024 -0400 @@ -1,6 +1,7 @@ #+title: A Bit of RISC #+date: [2024-03-11 Mon] #+setupfile: ../../clean.theme +#+property: header-args :eval no-export I recently picked up [[https://dl.acm.org/doi/10.5555/2462741][Hacker's Delight]] and having a lot of fun with it. It's a collection of bit-manipulation tricks collected by hackers over many years. You can flip open pretty much anywhere in the book @@ -21,7 +22,13 @@ You can find most of the code from the book [[https://github.com/hcs0/Hackers-Delight][here]]. * Design +:PROPERTIES: +:ID: c030566f-1ede-4edc-b393-d2c6c1c2d19f +:END: ** Data Representation +:PROPERTIES: +:ID: 6d93e084-1047-4a33-adb3-5c90af96ead0 +:END: We'll be sticking with a 32-bit word length as recommended in the Preface. We will also represent registers as integers whenever possible, instead of say a bit-vector. Without going into too much @@ -36,6 +43,9 @@ Floating-point support and special purpose registers are not required. ** Instructions +:PROPERTIES: +:ID: fb86a212-b49a-44ff-b30b-32c789ca55e2 +:END: The Hacker's Delight RISC architecture is described in two tables, denoted =basic RISC= and =full RISC= respectively. @@ -103,6 +113,9 @@ instructions directly to Lisp functions using macros. ** Execution Model +:PROPERTIES: +:ID: f84fcd3d-86ad-4b9b-a330-4572d6120559 +:END: We'll build this machine in Lisp and use plenty intrinsics from SBCL. As a starting point I followed Paul Khuong's excellent blog post: [[https://pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/][SBCL: The ultimate assembly code breadboard]]. @@ -116,6 +129,7 @@ * The HAKMEM VM :properties: :header-args: :session t :results none :noeval t +:ID: 43484c58-ab29-481c-b2b9-17ab4d91e22f :end: #+name: defpackage #+begin_src lisp diff -r db5ece2206cf -r 6d54ccb29de4 draft/a-lispy-database.org --- a/draft/a-lispy-database.org Mon Aug 12 18:31:37 2024 -0400 +++ b/draft/a-lispy-database.org Sun Aug 18 22:16:12 2024 -0400 @@ -1,11 +1,14 @@ #+title: A Lispy Database #+options: toc:t h:1 #+setupfile: ../../clean.theme - +#+property: header-args :eval no-export One of the key features missing in the Compiler Company [[https://vc.compiler.company/comp/core][core]] is a reliable [[https://en.wikipedia.org/wiki/Category:Database_management_systems][DBMS]]. It's something that I've worked towards in Rust, and now in Common Lisp, but haven't gotten to a production-ready state. * SQL +:PROPERTIES: +:ID: 2c0c63ba-93f4-4642-9eb3-76bfe6a786d0 +:END: [[cdn:media/img/sql-architecture.jpg]] @@ -27,19 +30,34 @@ and that is where it should remain according to the CC. * Prolog +:PROPERTIES: +:ID: a9fa63a6-7427-4f59-8bee-326f74f9a247 +:END: #+ATTR_HTML: :width 50% [[cdn:media/img/wam.webp]] * Key-Value Stores +:PROPERTIES: +:ID: 95bef557-d894-4b9e-ab80-c47cd4d9fa2e +:END: ** RocksDB +:PROPERTIES: +:ID: d4d3ad7f-8bd1-4471-b82b-f7a26d7ac050 +:END: [[cdn:media/img/rocksdb.png]] ** Blobs +:PROPERTIES: +:ID: 5d0c299e-3efe-4d87-a897-153760fe31f4 +:END: #+ATTR_HTML: :width 50% [[cdn:media/img/blob.jpg]] * Objects +:PROPERTIES: +:ID: b98858f9-66bb-4e41-bd84-23e6579fde7b +:END: https://courses.cs.northwestern.edu/325/readings/clos.html diff -r db5ece2206cf -r 6d54ccb29de4 draft/dylib-skel.org --- a/draft/dylib-skel.org Mon Aug 12 18:31:37 2024 -0400 +++ b/draft/dylib-skel.org Sun Aug 18 22:16:12 2024 -0400 @@ -1,6 +1,7 @@ #+title: Shared Library Skeletons #+setupfile: ../../clean.theme #+header-args: :eval never +#+property: header-args :eval no-export * Overview :PROPERTIES: :ID: 748ba6e4-60db-4ff7-9d78-12c3f67644d8 diff -r db5ece2206cf -r 6d54ccb29de4 draft/hello-world.org --- a/draft/hello-world.org Mon Aug 12 18:31:37 2024 -0400 +++ b/draft/hello-world.org Sun Aug 18 22:16:12 2024 -0400 @@ -1,7 +1,11 @@ #+title: (hello world) #+options: toc:t h:1 #+setupfile: ../../clean.theme +#+property: header-args :eval no-export * COMMENT Introduction +:PROPERTIES: +:ID: c9766ba7-319d-49f3-868e-8e289dbf5b3b +:END: Hello World, I've worked in and around software systems for many years. Throughout @@ -37,6 +41,9 @@ align with. * COMMENT The Compiler Company +:PROPERTIES: +:ID: ae6e6d60-e7c7-4efa-9136-26ad262a55b3 +:END: Without further ado, I'd like to announce /The Compiler Company, LLC/. The purpose of /The Compiler Company/ is to /compile/ /companies/. @@ -58,6 +65,9 @@ for internal benchmarking. ** [[https://compiler.company/docs/core][core]] +:PROPERTIES: +:ID: f64eb994-2a5e-4f7b-90c4-e6c29e321791 +:END: The =core= is a collection of applications and libraries built from the bottom-up with modularity in mind. It's primarily written in Common Lisp and Rust with minimal external dependencies. @@ -79,6 +89,9 @@ environment in parallel to Lisp. ** [[https://compiler.company/docs/infra][infra]] +:PROPERTIES: +:ID: 3c6bd04c-1da6-43d0-8d5c-bb267ada3f7a +:END: Unfortunately, ideas can't host themselves. We need a robust infrastructure to compensate for this. The project =infra= contains scripts for building and maintaing the entire corporate diff -r db5ece2206cf -r 6d54ccb29de4 draft/on-lisp-ecosystems.org --- a/draft/on-lisp-ecosystems.org Mon Aug 12 18:31:37 2024 -0400 +++ b/draft/on-lisp-ecosystems.org Sun Aug 18 22:16:12 2024 -0400 @@ -1,1 +1,2 @@ #+setupfile: ../../clean.theme +#+property: header-args :eval no-export diff -r db5ece2206cf -r 6d54ccb29de4 draft/outlines.org --- a/draft/outlines.org Mon Aug 12 18:31:37 2024 -0400 +++ b/draft/outlines.org Sun Aug 18 22:16:12 2024 -0400 @@ -1,6 +1,10 @@ #+title: outlines #+setupfile: ../../clean.theme +#+property: header-args :eval no-export * Overview +:PROPERTIES: +:ID: f49fa8a0-39a6-4a5f-8fb6-8d4086ea5476 +:END: Source code files are hard to manage. They can get unwieldly quickly and making the wrong assumption about your whereabouts in the code tree can have unintended consequences. @@ -33,6 +37,9 @@ structure of a source code file. * Outlines +:PROPERTIES: +:ID: 651aa74f-e634-4eac-8292-95efbe2aab9c +:END: Like all my good ideas, this one is credited entirely to Emacs. In this case, the excellent [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html][Outline mode]]. If you are an Emacs user you've probably already used it without knowing -- Org mode, for example, is [[https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org.el?h=release_9.6.9#n4789][derived from outline-mode]]. @@ -48,6 +55,9 @@ -- [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html][GNU]] ** Quickstart +:PROPERTIES: +:ID: 8e1927c5-5e2b-470a-9249-5fe0e375451c +:END: If you want to jump in right away, I recommend using these keybinds in Emacs: #+tblname: outline-keys @@ -73,6 +83,9 @@ move around the file with the new keybinds above. ** Outlines4All +:PROPERTIES: +:ID: 0751feb7-7e44-44d3-befd-905d365d05a1 +:END: Not all programming modes have outline support built-in. The good news is that it's easy to enable it. @@ -80,6 +93,9 @@ =outline-minor-mode=. *** Using dir-locals +:PROPERTIES: +:ID: cf39a556-fc2c-46e3-a2f7-e659213a915f +:END: The way it's done in the NAS-T codebase is with a [[../../.dir-locals.el][.dir-locals.el]] file. You just need to add this form for the mode of your choice, replacing the string @@ -94,6 +110,9 @@ minor-mode separately though. For project-level support, that's all there is to it. *** Using init.el +:PROPERTIES: +:ID: c76e4c71-c77a-43b6-811c-0a83981a1dc5 +:END: You may also modify your config to enable =outline-minor-mode= for select major-modes at startup. Here's a quick example from my config: @@ -124,9 +143,15 @@ ;;; outline-cfg.el ends here #+end_src ** Default Sections +:PROPERTIES: +:ID: c912d356-9688-4d48-91a8-ae234b410d46 +:END: Our default sections should look familiar - they're just Emacs Lisp defaults, with a few choice extensions. *** Source Header +:PROPERTIES: +:ID: 6e5856f0-3d75-4a4d-b44d-35e9015a63ab +:END: First line of every source code file. Here is the prototype in lisp: @@ -141,13 +166,22 @@ etc. **** Metadata :optional: +:PROPERTIES: +:ID: 56e5ccd3-b98a-4ba0-aaaa-eef49bc3fac7 +:END: Some files may insert a blank line and start the =Code= heading, while others will include some additional information about the file such as a long-description, version, list of exports, etc. *** Commentary :optional: +:PROPERTIES: +:ID: a8e36d82-4788-422c-af83-3374f23f9dc9 +:END: An optional programmer commentary included in source code files after the =Source Header= but before the =Code=. The contents are unpredictable but may include notes, todos, diagrams, stack notations, test results, links, tips, etc. *** Code +:PROPERTIES: +:ID: 7422d382-450b-46d6-898f-42daae455a47 +:END: The =Code= heading should be the final toplevel heading of any source code file. You may see a number of sub-headings, starting with four or more comment chars.