Pollen for the Homepage


This is short article on the use of Racket programming language and Pollen for these pages. I am a programmer and this is a setup that works for me.

You can check out the source for this article. It may seem like a peculiar choice so here are a few words of explanation.

Markup, Variables and Functions

Publishing anything on the web involves combining text and layout using markup language. Nobody likes to write HTML directly. However, as a programmer, absolutely all pre-fabricated ways of producing markup feel roundabout and distracting.

What makes Pollen bearable are two things:

Pollen supports several modes. I am using the markup dialect (.pm extension) which offers a concise way to specify tags. The heading of this section is written like this:
◊h2{Markup, Variables and Functions}
In the end, a conversion procedure called ->html turns everything into proper HTML.

That is not all, though. I can bind an identifier to a value and refer to it like a constant or variable symbol:

  ◊(define x 42)
  The answer to the ultimate question of life,
  the universe and everything is ◊|x|

I can also bind identifiers to procedures:

  ◊(define (my-emphasis x)
        ◊span[#:class "my-emphasis"]{◊|x|}}
  Markup is code, and I prefer code
    with ◊my-emphasis{procedure-calls}.

will produce <span class="my-emphasis">procedure-calls</span>.

This alone is already a vast improvement over HTML syntax and authoring via copy-and-paste.

Build and Push

Currently, I am using good old GNU Make for generating everything, before pushing manually.

When authoring, I use raco pollen start which renders each changed file automatically, and do a manual reload in the browser.

Rendering a file individually is done with raco pollen render <file>.html.pm

Inline math with MathJax3

Typesetting math like $\pi \nabla \longrightarrow \lambda x. \Omega$ is not handled by Pollen, but by MathJax3.

With the bussproofs package, we can do proof trees: $$ \begin{prooftree} \AxiomC{$P$} \AxiomC{$P\to Q$} \RightLabel{$\to_E$} \BinaryInfC{$Q$} \end{prooftree} $$