blog

My blog.

Home

Source code

git clone https://projects.rickardlindberg.me/scm/blog.git

Website

https://blog.rickardlindberg.me

Recent events

2025-05-31 11:31 Rickard pushed to blog

commit 4b06edb6f318077d6ddaea34bc43845fe4e9d0a6
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Sat May 31 11:30:42 2025 +0200

    New post.

diff --git a/posts/2025/05/31/classes-as-a-bunch-of-independent-vms/post.md b/posts/2025/05/31/classes-as-a-bunch-of-independent-vms/post.md
new file mode 100644
index 0000000..1be80b0
--- /dev/null
+++ b/posts/2025/05/31/classes-as-a-bunch-of-independent-vms/post.md
@@ -0,0 +1,17 @@
+---
+date: 2025-05-31 11:22:08
+title: Classes as a Bunch of Independed VMs
+tags:
+---
+
+I want to explore what and object-oriented programming system looks like where
+each object is represented as a VM running on the host hardware.
+
+VMs should be independent of each other so that they can't crash each other.
+
+VMs should also be specialized for the work of the class/object. You will have
+different compilers for different types of classes/objects that compile those
+to VMs specialized in solving those problem.
+
+I'm not sure what the point of this would be. Other than exploring ideas that I
+think are interesting.

2025-05-31 11:18 Rickard pushed to blog

commit 1dabf21602346b1fb29f7db4a2f1670861d6794e
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Sat May 31 11:18:31 2025 +0200

    New post.

diff --git a/bib/lex309carmack.md b/bib/lex309carmack.md
new file mode 100644
index 0000000..aa84ee2
--- /dev/null
+++ b/bib/lex309carmack.md
@@ -0,0 +1,6 @@
+---
+date: 2025-05-31 10:27:00
+title: John Carmack: Doom, Quake, VR, AGI, Programming, Video Games, and Rockets | Lex Fridman Podcast #309 
+type: youtube
+link: https://youtu.be/I845O57ZSy4
+---
diff --git a/posts/2025/05/31/how-to-make-programs-come-alive/post.md b/posts/2025/05/31/how-to-make-programs-come-alive/post.md
new file mode 100644
index 0000000..9b4f74b
--- /dev/null
+++ b/posts/2025/05/31/how-to-make-programs-come-alive/post.md
@@ -0,0 +1,22 @@
+---
+date: 2025-05-31 10:45:52
+title: How to Make Programs Come Alive?
+tags:
+---
+
+In [](bib:lex309carmack), Carmack explains how he likes to run his programs
+through a debugger so that he can see what is going on.
+
+It was a very long time since I used a debugger. I find that they are not
+really needed and argue that unit testing decreases the need for a debugger.
+
+However, I think both debugging and unit testing are ways of making programs
+come alive. Instead of "blindly manipulating symbols", as Bret Victor puts it,
+you run the program with some input and observe that it does the right thing.
+
+Bret Victor has talked about how to make programming better than just blindly
+manipulating symbols. Alan Kay has talked about how CAD software has ways of
+simulating your models to ensure their correctness and asked why there is no
+equivalent in the software world.
+
+These topics interest me, and I want to study them more.

2025-05-31 10:04 Rickard pushed to blog

commit 9e7b0adfea7ce85c46111680e2580309932af19f
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Sat May 31 10:04:36 2025 +0200

    Summaries.

diff --git a/blog.py b/blog.py
index f73a15e..8dd47b9 100755
--- a/blog.py
+++ b/blog.py
@@ -104,12 +104,17 @@ class Index:
                 key=lambda post: post.date.date,
                 reverse=True,
             ):
+                if self.description.summary_number_of_words:
+                    summary = " " + post.body_summary(self.description.summary_number_of_words)
+                else:
+                    summary = ""
                 html_path = post.html_path(start=os.path.dirname(self.path))
                 ul.inner(
                     Tag("li").inner(
                         Tag("a", href=html_path).inner(
                             post.link_title()
-                        )
+                        ),
+                        summary,
                     )
                 )
             f.write(str(ul))
@@ -163,6 +168,7 @@ class Bib:
     def __init__(self, path, content):
         self.id = os.path.splitext(os.path.basename(path))[0]
         self.doc = HeaderDocument(content)
+        self.summary_number_of_words = 20
 
     @property
     def title(self):
@@ -331,6 +337,7 @@ class IndexDescription:
     def __init__(self, title, html_body=""):
         self.title = title
         self.html_body = html_body
+        self.summary_number_of_words = 20
 
 class Breadcrumb:
 

2025-05-31 09:59 Rickard pushed to blog

commit 877ee292aa0015a69f273cbbdb8fb26a224a3626
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Sat May 31 09:59:43 2025 +0200

    Better titles.

diff --git a/blog.py b/blog.py
index cbc6f1c..f73a15e 100755
--- a/blog.py
+++ b/blog.py
@@ -177,9 +177,15 @@ class Bib:
             ("../..", "Home"),
             ("..", "All Bibs"),
         ]).to_html()
-        pre = str(Tag("p").inner(
-            "Link: ",
-            Tag("a", href=self.link()).inner(self.link()),
+        pre = str(Tag("ul").inner(
+            Tag("li").inner(
+                "Type: ",
+                self.doc.header("type").strip(),
+            ),
+            Tag("li").inner(
+                "Link: ",
+                Tag("a", href=self.link()).inner(self.link()),
+            ),
         ))
         return breadcrumb + pre + self.html_body_body
     
@@ -216,13 +222,15 @@ class Posts:
         self.by_id[post.id()] = post
         self.add_to_index(
             "",
-            IndexDescription(title="All Posts"),
+            IndexDescription(
+                title="All Posts",
+            ),
             post,
         )
         self.add_to_index(
             post.index_y(),
             IndexDescription(
-                title=post.index_y(),
+                title=f"Posts {post.index_y()}",
                 html_body=Breadcrumb([
                     ("..", "Home"),
                 ]).to_html(),
@@ -232,7 +240,7 @@ class Posts:
         self.add_to_index(
             post.index_ym(),
             IndexDescription(
-                title=post.index_ym(),
+                title=f"Posts {post.index_ym()}",
                 html_body=Breadcrumb([
                     ("../..", "Home"),
                     ("..", y),
@@ -243,7 +251,7 @@ class Posts:
         self.add_to_index(
             post.index_ymd(),
             IndexDescription(
-                title=post.index_ymd(),
+                title=f"Posts {post.index_ymd()}",
                 html_body=Breadcrumb([
                     ("../../..", "Home"),
                     ("../..", y),
@@ -256,7 +264,7 @@ class Posts:
             self.add_to_index(
                 os.path.join("tags", tag),
                 IndexDescription(
-                    title=tag,
+                    title=f"Posts with tag {tag}",
                     html_body=Breadcrumb([
                         ("../..", "Home"),
                         ("..", "All Tags"),

commit ac4e2d4b8b585033057e8d0166671f73d4e97822
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Sat May 31 09:54:21 2025 +0200

    Reword.

diff --git a/bib/lex48bjarne.md b/bib/lex48bjarne.md
index b1d835c..1649787 100644
--- a/bib/lex48bjarne.md
+++ b/bib/lex48bjarne.md
@@ -6,4 +6,4 @@ link: https://youtu.be/uTxRF5ag27A
 ---
 
 I listened to this because I enjoyed a previous Lex podcast, and I needed
-something to entertain me during a long car ride.
+something to entertain me during a long drive.

2025-05-31 09:40 Rickard pushed to blog

commit 8e405d232e281dfeb0ae2f55bbf78b717d0fedf1
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Sat May 31 09:40:26 2025 +0200

    Better titles for breadcrumb.

diff --git a/blog.py b/blog.py
index 86cc3e4..cbc6f1c 100755
--- a/blog.py
+++ b/blog.py
@@ -212,6 +212,7 @@ class Posts:
         return self.by_id[post_id]
 
     def append(self, post):
+        y, m, d = post.date.ymd_list()
         self.by_id[post.id()] = post
         self.add_to_index(
             "",
@@ -234,7 +235,7 @@ class Posts:
                 title=post.index_ym(),
                 html_body=Breadcrumb([
                     ("../..", "Home"),
-                    ("..", post.index_y()),
+                    ("..", y),
                 ]).to_html(),
             ),
             post,
@@ -245,8 +246,8 @@ class Posts:
                 title=post.index_ymd(),
                 html_body=Breadcrumb([
                     ("../../..", "Home"),
-                    ("../..", post.index_y()),
-                    ("..", post.index_ym()),
+                    ("../..", y),
+                    ("..", m),
                 ]).to_html(),
             ),
             post,

2025-05-31 09:37 Rickard pushed to blog

commit be6bafb1911e03c5b7313469a601cc14b4a8eab4
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Sat May 31 09:37:43 2025 +0200

    More breadcrumbs.

diff --git a/blog.py b/blog.py
index 674d2c4..86cc3e4 100755
--- a/blog.py
+++ b/blog.py
@@ -173,11 +173,15 @@ class Bib:
 
     @property
     def html_body(self):
+        breadcrumb = Breadcrumb([
+            ("../..", "Home"),
+            ("..", "All Bibs"),
+        ]).to_html()
         pre = str(Tag("p").inner(
             "Link: ",
             Tag("a", href=self.link()).inner(self.link()),
         ))
-        return pre + self.html_body_body
+        return breadcrumb + pre + self.html_body_body
     
     @property
     def html_body_body(self):
@@ -209,14 +213,62 @@ class Posts:
 
     def append(self, post):
         self.by_id[post.id()] = post
-        self.add_to_index("", IndexDescription(title="All Posts"), post)
-        self.add_to_index(post.index_y(), IndexDescription(title=post.index_y()), post)
-        self.add_to_index(post.index_ym(), IndexDescription(title=post.index_ym()), post)
-        self.add_to_index(post.index_ymd(), IndexDescription(title=post.index_ymd()), post)
+        self.add_to_index(
+            "",
+            IndexDescription(title="All Posts"),
+            post,
+        )
+        self.add_to_index(
+            post.index_y(),
+            IndexDescription(
+                title=post.index_y(),
+                html_body=Breadcrumb([
+                    ("..", "Home"),
+                ]).to_html(),
+            ),
+            post,
+        )
+        self.add_to_index(
+            post.index_ym(),
+            IndexDescription(
+                title=post.index_ym(),
+                html_body=Breadcrumb([
+                    ("../..", "Home"),
+                    ("..", post.index_y()),
+                ]).to_html(),
+            ),
+            post,
+        )
+        self.add_to_index(
+            post.index_ymd(),
+            IndexDescription(
+                title=post.index_ymd(),
+                html_body=Breadcrumb([
+                    ("../../..", "Home"),
+                    ("../..", post.index_y()),
+                    ("..", post.index_ym()),
+                ]).to_html(),
+            ),
+            post,
+        )
         for tag in post.tags:
-            self.add_to_index(os.path.join("tags", tag), IndexDescription(title=tag), post)
+            self.add_to_index(
+                os.path.join("tags", tag),
+                IndexDescription(
+                    title=tag,
+                    html_body=Breadcrumb([
+                        ("../..", "Home"),
+                        ("..", "All Tags"),
+                    ]).to_html(),
+                ),
+                post,
+            )
         for bib in post.bibs:
-            self.add_to_index(os.path.join("bibs", bib), self.bibs.get(bib), post)
+            self.add_to_index(
+                os.path.join("bibs", bib),
+                self.bibs.get(bib),
+                post,
+            )
 
     def get_indices(self):
         yield from self.indices.values()
@@ -267,9 +319,9 @@ class Posts:
 
 class IndexDescription:
 
-    def __init__(self, title):
+    def __init__(self, title, html_body=""):
         self.title = title
-        self.html_body = ""
+        self.html_body = html_body
 
 class Breadcrumb:
 

2025-05-31 09:30 Rickard pushed to blog

commit 7500d6f8163b4a3f4c97b9be3c2b0f300e474b25
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Sat May 31 09:29:50 2025 +0200

    More breadcrumbs.

diff --git a/blog.py b/blog.py
index 94e8cec..674d2c4 100755
--- a/blog.py
+++ b/blog.py
@@ -116,8 +116,9 @@ class Index:
 
 class IndexOfIndex:
 
-    def __init__(self, path, description, indices):
+    def __init__(self, path, description, body, indices):
         self.path = path
+        self.body = body
         self.description = description
         self.indices = indices
 
@@ -126,6 +127,7 @@ class IndexOfIndex:
         os.makedirs(os.path.dirname(file_path), exist_ok=True)
         with open(file_path, "w") as f:
             f.write(str(Tag("h1").inner(self.description)))
+            f.write(self.body)
             ul = Tag("ul")
             for index in sorted(
                 self.indices,
@@ -221,6 +223,9 @@ class Posts:
         yield IndexOfIndex(
             path=os.path.join("tags", "index.html"),
             description="All Tags",
+            body=Breadcrumb([
+                ("..", "Home"),
+            ]).to_html(),
             indices=[
                 index
                 for name, index
@@ -231,6 +236,9 @@ class Posts:
         yield IndexOfIndex(
             path=os.path.join("bibs", "index.html"),
             description="All Bibs",
+            body=Breadcrumb([
+                ("..", "Home"),
+            ]).to_html(),
             indices=[
                 index
                 for name, index
@@ -263,6 +271,18 @@ class IndexDescription:
         self.title = title
         self.html_body = ""
 
+class Breadcrumb:
+
+    def __init__(self, href_name_pairs):
+        self.href_name_pairs = href_name_pairs
+
+    def to_html(self):
+        return " / ".join([
+            str(Tag("a", href=href).inner(name))
+            for href, name
+            in self.href_name_pairs
+        ])
+
 class Post:
 
     """
@@ -370,13 +390,12 @@ class Post:
         lines = []
         lines.append(Tag("h1").inner(self.link_title()))
         y, m, d = self.date.ymd_list()
-        lines.append(Tag("a", href="../../..").inner("Home"))
-        lines.append(" / ")
-        lines.append(Tag("a", href="../..").inner(y))
-        lines.append(" / ")
-        lines.append(Tag("a", href="..").inner(m))
-        lines.append(" / ")
-        lines.append(Tag("a", href=".").inner(d))
+        lines.append(Breadcrumb([
+            ("../../..", "Home"),
+            ("../..", y),
+            ("..", m),
+            (".", d),
+        ]).to_html())
         for tag in self.tags:
             lines.append(" / ")
             lines.append(Tag("a", href=f"../../../tags/{tag}").inner(f"#{tag}"))

2025-05-30 21:13 Rickard pushed to blog

commit a535bd3f673699061e5f4f1465d859cb06d627d0
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Fri May 30 21:13:27 2025 +0200

    Add index of indicies.

diff --git a/blog.py b/blog.py
index 740609a..94e8cec 100755
--- a/blog.py
+++ b/blog.py
@@ -75,6 +75,23 @@ class Index:
     def add_post(self, post):
         self.posts.append(post)
 
+    def link_title(self):
+        return self.description.title
+
+    @property
+    def date(self):
+        return sorted(
+            self.posts,
+            key=lambda post: post.date.date,
+            reverse=True,
+        )[0].date.date
+
+    def html_path(self, start="."):
+        return os.path.relpath(
+            self.path,
+            start=start,
+        )
+
     def write(self, root):
         file_path = os.path.join(root, self.path)
         os.makedirs(os.path.dirname(file_path), exist_ok=True)
@@ -97,6 +114,34 @@ class Index:
                 )
             f.write(str(ul))
 
+class IndexOfIndex:
+
+    def __init__(self, path, description, indices):
+        self.path = path
+        self.description = description
+        self.indices = indices
+
+    def write(self, root):
+        file_path = os.path.join(root, self.path)
+        os.makedirs(os.path.dirname(file_path), exist_ok=True)
+        with open(file_path, "w") as f:
+            f.write(str(Tag("h1").inner(self.description)))
+            ul = Tag("ul")
+            for index in sorted(
+                self.indices,
+                key=lambda index: index.date,
+                reverse=True,
+            ):
+                html_path = index.html_path(start=os.path.dirname(self.path))
+                ul.inner(
+                    Tag("li").inner(
+                        Tag("a", href=html_path).inner(
+                            index.link_title()
+                        )
+                    )
+                )
+            f.write(str(ul))
+
 class Bibs:
 
     def __init__(self):
@@ -172,7 +217,27 @@ class Posts:
             self.add_to_index(os.path.join("bibs", bib), self.bibs.get(bib), post)
 
     def get_indices(self):
-        return self.indices.values()
+        yield from self.indices.values()
+        yield IndexOfIndex(
+            path=os.path.join("tags", "index.html"),
+            description="All Tags",
+            indices=[
+                index
+                for name, index
+                in self.indices.items()
+                if name.startswith("tags/")
+            ]
+        )
+        yield IndexOfIndex(
+            path=os.path.join("bibs", "index.html"),
+            description="All Bibs",
+            indices=[
+                index
+                for name, index
+                in self.indices.items()
+                if name.startswith("bibs/")
+            ]
+        )
 
     def add_to_index(self, path, description, post):
         path = os.path.join(path, "index.html")

2025-05-30 20:47 Rickard pushed to blog

commit db266c63a0dd5d53a4badd21d2fa674d6d897df1
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Fri May 30 20:47:10 2025 +0200

    Modify title.

diff --git a/blog.py b/blog.py
index cb6845b..740609a 100755
--- a/blog.py
+++ b/blog.py
@@ -162,7 +162,7 @@ class Posts:
 
     def append(self, post):
         self.by_id[post.id()] = post
-        self.add_to_index("", IndexDescription(title="Home"), post)
+        self.add_to_index("", IndexDescription(title="All Posts"), post)
         self.add_to_index(post.index_y(), IndexDescription(title=post.index_y()), post)
         self.add_to_index(post.index_ym(), IndexDescription(title=post.index_ym()), post)
         self.add_to_index(post.index_ymd(), IndexDescription(title=post.index_ymd()), post)

2025-05-30 20:45 Rickard pushed to blog

commit 68d1879649231e9669c0ab3760664f1277eae5c9
Author: Rickard Lindberg <rickard@rickardlindberg.me>
Date:   Fri May 30 20:45:01 2025 +0200

    Fix broken indices.

diff --git a/blog.py b/blog.py
index 22a16a5..cb6845b 100755
--- a/blog.py
+++ b/blog.py
@@ -72,6 +72,9 @@ class Index:
         self.description = description
         self.posts = posts
 
+    def add_post(self, post):
+        self.posts.append(post)
+
     def write(self, root):
         file_path = os.path.join(root, self.path)
         os.makedirs(os.path.dirname(file_path), exist_ok=True)
@@ -79,7 +82,11 @@ class Index:
             f.write(str(Tag("h1").inner(self.description.title)))
             f.write(self.description.html_body)
             ul = Tag("ul")
-            for post in self.posts:
+            for post in sorted(
+                self.posts,
+                key=lambda post: post.date.date,
+                reverse=True,
+            ):
                 html_path = post.html_path(start=os.path.dirname(self.path))
                 ul.inner(
                     Tag("li").inner(
@@ -135,7 +142,7 @@ class Bib:
 class Posts:
 
     def __init__(self, bibs):
-        self.partitions = collections.defaultdict(list)
+        self.indices = {}
         self.by_id = {}
         self.bibs = bibs
 
@@ -155,26 +162,23 @@ class Posts:
 
     def append(self, post):
         self.by_id[post.id()] = post
-        self.partitions[("", IndexDescription(title="Home"))].append(post)
-        self.partitions[(post.index_y(), IndexDescription(title=post.index_y()))].append(post)
-        self.partitions[(post.index_ym(), IndexDescription(title=post.index_ym()))].append(post)
-        self.partitions[(post.index_ymd(), IndexDescription(title=post.index_ymd()))].append(post)
+        self.add_to_index("", IndexDescription(title="Home"), post)
+        self.add_to_index(post.index_y(), IndexDescription(title=post.index_y()), post)
+        self.add_to_index(post.index_ym(), IndexDescription(title=post.index_ym()), post)
+        self.add_to_index(post.index_ymd(), IndexDescription(title=post.index_ymd()), post)
         for tag in post.tags:
-            self.partitions[(os.path.join("tags", tag), IndexDescription(title=tag))].append(post)
+            self.add_to_index(os.path.join("tags", tag), IndexDescription(title=tag), post)
         for bib in post.bibs:
-            self.partitions[(os.path.join("bibs", bib), self.bibs.get(bib))].append(post)
+            self.add_to_index(os.path.join("bibs", bib), self.bibs.get(bib), post)
 
     def get_indices(self):
-        for (name, index_description), posts in self.partitions.items():
-            yield Index(
-                path=os.path.join(name, "index.html"),
-                description=index_description,
-                posts=sorted(
-                    posts,
-                    key=lambda post: post.date.date,
-                    reverse=True,
-                ),
-            )
+        return self.indices.values()
+
+    def add_to_index(self, path, description, post):
+        path = os.path.join(path, "index.html")
+        if path not in self.indices:
+            self.indices[path] = Index(path=path, description=description, posts=[])
+        self.indices[path].add_post(post)
 
     def render_link_list(self, source):
         ul = Tag("ul")