Idiomdrottning’s homepage


This is a small, inflexible li’l Unix filter that reads a single sexp from stdin and prints out Graphviz’ Dot language.

It features different fonts for strings vs symbols (which you can change with -l and -g respectively).

When a list starts with another list, a dot-node is inserted to branch things off.

Quotes inside the sexp are treated as strings.


(a ((b c) (d e)) '(f g h))


(a (· (b c) (d e)) "(f g h)")

and looks like this when rendered with dot:

Example sexp as a tree

Source code

git clone

or install it with chicken-install cst.


I wrote the first version of this program more than ten years ago, for linguistics, so I could quickly make sentence structure diagrams with the life-changing magic of Emacs and Paredit.

Here are two examples from back then:

  (np (poss "Her")
      (np (n "parents"))))
 (vpp (vp
       (v "are")
        (deg "very")
         (adj "happy")
         (ppp (pp
               (p "about")
               (npp (det "the")
                    (np (n "weather."))))))))))

Her parents are very happy about the weather.

(s (npp (np (n "Dana")))
      (advpp (advp (adv "carefully")))
       (v "placed")
        (det "the")
        (np (n "watch")))
       (ppp (pp
             (p "on")
              (det "the")
              (np (n "table")))))))
     (ppp (spec "right")
           (p "after")
            (det "the")
            (np (n "meeting."))))))))

Dana carefully placed the watch on the table right after the meeting.

Of course, these examples are relics from a time when people believed human language had “grammar” and worked like some sort of Chomsky fever dream straight out of The Moon is a Harsh Mistress before everything got all tensors and networks and weights and activations and multilayer perceptions. It was a quaint and curious time. Fun fun fun.♥