Theme options

Thank you for trusting this site to use Javascript. It is used in a way that degrades gracefully; for persistence of the below values. This uses local session storage, just so you know.

Sougen; trampling grass

Posted on
2026-08-07T07:48:00Z
Tags
Content warnings
None
This page is a draft! Content may not yet be finalized.
Table of Contents

§ Moving away from Clojure

Kusachi; my last static site generator was heavy, bloated even. Requires a JRE, requires a whole tonne of dependencies. Sintech; the syntax highlighter required a whole rust toolchain. Rust is tainted. Many of the dependencies I was using were tainted. The commonmark library certainly was.

In this era of large language models, deskilling and wandering lobotomites with wanton disregard for decency, I do away with the taint as much as I can. I know Clojure's good and untainted, god knows Rich Hickey doesn't like all of this Generative AI nonsense; he says it enough. That said... I'm a fan of not needing several GiB of dependencies to build my site, and that's my fault and my fault only. Laboring to fix this issue, I thought back to the short time I was playing with David Thompson's Haunt; a static site generator written in GNU Guile used in a multitude of places.

GNU Guile, huh? I do like Guile and Guix, after all... but, Haunt isn't for me. The way readers feed into builders is not my style, one bit. I respect David Thompson and his work, hell, and Spritely Institute a tonne. Inspired by Kusachi's design prior, I thought I would bring it across and I wondered what I would lack in this pursuit.

We're continuing the motif of digital gardens, of course. From 草地 to 草原!

§ The Guile Experience

Guile has wonderful documentation, like most GNU projects. I've spent a good portion of my time as of late learning Guile, Guix, C (from the C language reference and glibc documentation) and autoconf. I can't thank the GNU people enough for their efforts on documentation; compared to NixOS I basically drown in information here.

Haunt contributed a lot here to what I was able to do with Guile! David Thompson is responsible for spritely/guile-commonmark which provides block/inline HTML parsing. Haunt also uses htmlprag.

§ SXML / SHTML

It's amazing how much Guile has built in. For an example, here's what reads a markdown file from a path and does element replacing upon it.

update with md->post

My emphasis here would be upon the pre-post-order traversal SXML expression tree transformer function. It's so surprising to me that this is provided. Here's an example of how I use it!

update with the area around highlighter

It gives me near trivial capacity to do "components". Functions running over an element that they match upon with a destructuring of their input. I can use <emd/> to produce an em-dash. Here, let me try; —. Of course, if you understand that code, you also understand that what you're looking at it in is produced by that code, too.

§ SRFI-197: Pipeline Operators

The function chain, from SRFI-197 is my favourite implementation of pipelining within a language ever. You can see it in that first codeblock, too. I love it because unlike Clojure's, you need not choose thread-first or thread-last. You just provide _ or ... and that is what provides the prior output(s) as parameters. This isn't that uncommon either, cut and cute of SRFI-26 use placeholders too!

§ How does Sougen work?

A core is the base unit for any expressed site generation. It specifies:

  • how to generate an output from any given input (compiler)
  • a filter, provided as a transducer that determines the set of inputs for the compiler from everything resident within the site generator's directory
  • a way to determine where the output should go (router)
  • hooks to run when the overall core is finished compiling all of its located inputs
update with new core

The compiler is given the responsibility of emplacing files itself because it allows for producing a "compiler" that just copies a file to the routed destination without as much overhead. The hooks provided allow it to do things like regenerate the RSS feed, blogpost list, tag list and index pages upon completion.

You have already seen what a "compiler" looks like, with the first codeblock containing md->post.

§ What I miss from Clojure

§ Destructuring

Compare these:

(defn quoter [[_ {url :url cite :cite} & rest] & _]
  [:div.quote
    [:blockquote {:cite url}
      rest
    ]
    [:cite
      [:a {:href url} cite]
    ]
  ])

vs

(define (quoter tag attrs content)
  (let ((url (assq-ref attrs 'url))
        (cite (assq-ref attrs 'cite)))
  `(div (@ (class "quote"))
      (blockquote (@ (cite ,url))
          ,content
      )
      (cite
        (a (@ (href ,url)) ,cite)
      )
    )))

You might be tempted to say, "oh, that's not that bad! come on". Well, you're right, but to even make it that convenient was painful! All of the below to work with attributes in an ergonomic-ish way.

update with split-attrs stuff