Impressum

sunflower under snow

Modest Hacks for Humanity

Web authoring aids

The web pages here at Schnada.de derive from sexp (S-expression) based descriptions handled within Scheme or in fact Scsh, a full-fledged programming language. Sexps, or bracketed prefix expressions, are the grammar of choice for describing document trees, and Scheme supports sexps and trees very well. (However, the standard binary tree representation of sexps doesn't provide back-links from a child node to its parent, that would allow you to climb up and down easily, e.g. on search for nodes that answer a particular query. The quad tree suggested by Erik Naggum would suit such needs –beyond mine, though.)

The HTML document trees themselves are typically not the primary form of their content, but generated via some kind or other of markup macros from data (e.g. quotations, images, links) organised ad lib, the data management becoming the crux of the matter as the content grows.

This site formerly used homegrown sexponential html with Scheme procedures in lieu of markup macros and free-form back-end data, a mix of target markup and ad hoc data structures. It is now migrating to statixite, i.e. SXML with SXML macros and SXML back-end data (all data contained in SXML files, some data implicitly), while Brazil's thong-wearing samba queens have traditionally been better known for their buxom behinds. For instance, see the SXML source or descriptor of this page below. (Wait a minute! How come the description of this page can describe itself? Can it, do we have enough lotus at hand, or —should the answer be obscenely simple? Let's see.)

(page (@ (class "wimp") (lang "en"))
      (rtape
       (loco "https://www.schnada.de/progn/hax.html")
       (up "top" "cooly"))
      (about (dsc "fairly useless but free self-made computer programs"))

      (title "Modest Hacks for Humanity")

      (illu (@ (src "../bilders/i/sonblum31a.jpg")
               (alt "sunflower under snow")
               (class "innaface")))
      (heading (@ (w8 "1") (id "modest")) "Modest Hacks for Humanity")

      (heading (@ (w8 "2") (id "authoring")) "Web authoring aids")

      (p "The web pages here at Schnada.de derive from sexp (S-expression) based descriptions handled within "
         (a (@ (href (purl "tao" "scheme"))) "Scheme")
         " or in fact "
         (a (@ (href (purl "tao" "scsh"))) "Scsh")
         ", a full-fledged programming language.  Sexps, or bracketed prefix expressions, are the grammar of choice for describing document trees, and Scheme supports sexps and trees very well.  (However, the standard binary tree representation of sexps doesn't provide back-links from a child node to its parent, that would allow you to climb up and down easily, e.g. on search for nodes that answer a particular query.  The "
         ; selm=3283503882585065KL2065E_-_%40naggum.no
         (a (@ (href "http://groups.google.de/group/comp.lang.lisp/msg/f7e4a1167a139959"))
            " quad tree suggested by Erik Naggum")
         " would suit such needs "8211"beyond mine, though.)")
      (p "The " (abbr "HTML") " document trees themselves are typically not the primary form of their content, but generated via some kind or other of markup macros from data (e.g. quotations, images, links) organised ad lib, the data management becoming the crux of the matter as the content grows.")
      (p "This site formerly used homegrown " (a (@ (href "#doedel")) "sexponential html") " with Scheme procedures in lieu of markup macros and free-form back-end data, a mix of target markup and ad hoc data structures. It is now migrating to " (a (@ (href "#statixite")) "statixite") ", i.e. " (a (@ (href "#softsex")) (abbr "SXML")) " with " (a (@ (href "#softsex")) (abbr "SXML")) " macros and " (a (@ (href "#softsex")) (abbr "SXML")) " back-end data (all data contained in " (a (@ (href "#softsex")) (abbr "SXML")) " files, some data implicitly), while Brazil's thong-wearing samba queens have traditionally been better known for their buxom behinds.  For instance, see the " (a (@ (href "#softsex")) (abbr "SXML")) " source or descriptor of this page below. (Wait a minute!  How come the description of this page can describe itself?  Can it, do we have enough lotus at hand, or " 8212 "should the answer be obscenely simple? Let's see.)" )
      (pre (tt (include "hax.scm" "txt")))


      (heading (@ (w8 "3") (id "doedel")) "Sexponential HTML")

      (p "Sexponential " (abbr "HTML") " is a simple-minded html generator for Scheme"160"48.  It sports sexp-powered  markup and some extensibility.  It comes in three flavours:")
      (dl (dt "doedel")
          (dd "a compiled flavour or syntactic extension to Scheme.  The document descriptor is " (em "not") " first class.  It makes sense only in the context of a special form, the " (abbr "HTML") " output command.  (One of the less convincing applications of macros.)")

          (dt "doedel*")
          (dd "an interpreted flavour or Scheme printing procedure eating lists.  The document descriptor is a Scheme list.")

          (dt "taggers")
          (dd "a namespace-cluttering flavour or host of specialised element emitters, both macroidal and procedural, eating content printers.  (There is no proper document descriptor.)"))

      (p "Runs in "
         (a (@ (href "http://www.scsh.net/download.html"))
            "scsh 0.5.2 or greater")
         ". Part of the code relies on the "
         (a (@ (href "http://www.s48.org/")) "Scheme 48")
         " low-level macro facility, but hardly anything on "
         (a (@ (href (purl "tao" "scsh")))
            "Scheme Shell")
         " specialties.  The little package "
         (a (@ (href "doedel.tar.gz")) "doedel.tar.gz")
         " containing the sources, some documentation and "
         (a (@ (href "doedel/sample.scm")) "examples")
         " is in the public domain.  (May be quite suitable for Scheme"160"48 or Scsh neophytes who want to get intimate with low-level macro definitions in conjunction with the module system.  No master coding here, but a non-trivial, though simple, isolated application of macros.)  Been phased out in favour of Statixite; see below.")


      (heading (@ (w8 "3") (id "statixite")) "Statixite web authoring package")

      (p (em "Statixite") " is a package of "
         (a (@ (href "#softsex")) (abbr "SSAX") "/" (abbr "SXML"))
         " macros and Scheme utilities for handling the web pages "8211"including pictures, quotations, text, and textual glue"8211" of simple static web sites, in fact for "
         (a (@ (href (purl "top"))) "Schnada.de")
         " and its outpost "
         (a (@ (href (purl "culious"))) "Culious.de")
         ".  The concrete sxml macros (or transformations) are site-specific, but some utilities are more general, in particular the " (i "sxml"rarr"html") " conversion with symbolic and numeric entity references, reasonable line-breaks, and an " (i "include") " macro; on the side: "(i "sxml"rarr"xml") " conversion (for all-ascii input) used to generate sitemaps such as this site's "(a (@ (href "../sitemap.xml"))"sitemap.xml")" (conforming to the precepts of "(a (@ (href "http://www.sitemaps.org/")) "sitemaps.org")").")
      (p "[Some of those sxml macros are morally dubious insofar as they may treat adjacent strings as separate arguments, not as contiguous parts of running character data, e.g. "(tt "(ali \"xxx\" \"yyy\")")" isn't equivalent to "(tt "(ali \"xxxyyy\")")", whereas xml wouldn't distinguish "(tt "<ali>xxxyyy</ali>")" from "(tt "<ali>xxxyyy</ali>")"; an alternative form is avaliable, though, trading a bit of convenience for markup rectitude: "
         (tt "(ali (rf \"xxx\") \"yyy\")")".]")
      (p "The sxml source of the current page is shown above and also contained, along with the code and rudimentary documentation, in the downloadable package "
         (a (@ (href "statixite.tar.gz")) "statixite.tar.gz r"thinsp"0.6")
         ". Works with ssax-5.1, scsh-0.7, sunterlib-0.8.  Enjoy poached or broiled.")


      (heading (@ (w8 "3") (id "softsex")) "Related software and the like")

      (ul (ali (rf "http://okmij.org/ftp/Scheme/xml.html#XML-authoring")
               (abbr "SXML") #\ 8211 #\ (abbr "HTML") "/" (abbr "XML")
               " authoring in Scheme")
          (ali (rf "http://htus.org/Book/2001-11-13/howto-Z-H-4.html#%25_sec_2")
               (abbr "PLT") "'s little " (abbr "XML") " library by the book")
          (ali (rf "http://sunet.cvs.sourceforge.net/sunet/sunet/scheme/xml/")
               "Scsh port of "
               (abbr "PLT") " Scheme's old " (abbr "XML") " library")
          (ali (rf "http://www.plt-scheme.org/")
               (abbr "PLT") " Scheme with built-in "
               (abbr "XML") " capabilities")
          (ali (rf "http://celtic.benderweb.net/webit/")
               "WebIt! - An " (abbr "XML") " Framework for Scheme")
          (ali (rf "http://www.scsh.net/resources/sunet.html")
               "The Scheme Underground Network Package")
          (ali (rf "http://www.paulgraham.com/acl.html")
               "Paul Graham: " (abbr "ANSI") " Common Lisp")
          (ali (rf "http://www.swiss.ai.mit.edu/~jaffer/SLIB.html")
               "the portable scheme library " (abbr "SLIB"))
          (ali (rf "http://groups.google.de/group/comp.lang.lisp/msg/f7e4a1167a139959")
               "document trees with back-links to parent nodes")
          (li (apage "eriknaggum-enamel"))))

Sexponential HTML

Sexponential HTML is a simple-minded html generator for Scheme 48. It sports sexp-powered markup and some extensibility. It comes in three flavours:

doedel
a compiled flavour or syntactic extension to Scheme. The document descriptor is not first class. It makes sense only in the context of a special form, the HTML output command. (One of the less convincing applications of macros.)
doedel*
an interpreted flavour or Scheme printing procedure eating lists. The document descriptor is a Scheme list.
taggers
a namespace-cluttering flavour or host of specialised element emitters, both macroidal and procedural, eating content printers. (There is no proper document descriptor.)

Runs in scsh 0.5.2 or greater. Part of the code relies on the Scheme 48 low-level macro facility, but hardly anything on Scheme Shell specialties. The little package doedel.tar.gz containing the sources, some documentation and examples is in the public domain. (May be quite suitable for Scheme 48 or Scsh neophytes who want to get intimate with low-level macro definitions in conjunction with the module system. No master coding here, but a non-trivial, though simple, isolated application of macros.) Been phased out in favour of Statixite; see below.

Statixite web authoring package

Statixite is a package of SSAX/SXML macros and Scheme utilities for handling the web pages –including pictures, quotations, text, and textual glue– of simple static web sites, in fact for Schnada.de and its outpost Culious.de. The concrete sxml macros (or transformations) are site-specific, but some utilities are more general, in particular the sxml→html conversion with symbolic and numeric entity references, reasonable line-breaks, and an include macro; on the side: sxml→xml conversion (for all-ascii input) used to generate sitemaps such as this site's sitemap.xml (conforming to the precepts of sitemaps.org).

[Some of those sxml macros are morally dubious insofar as they may treat adjacent strings as separate arguments, not as contiguous parts of running character data, e.g. (ali "xxx" "yyy") isn't equivalent to (ali "xxxyyy"), whereas xml wouldn't distinguish <ali>xxxyyy</ali> from <ali>xxxyyy</ali>; an alternative form is avaliable, though, trading a bit of convenience for markup rectitude: (ali (rf "xxx") "yyy").]

The sxml source of the current page is shown above and also contained, along with the code and rudimentary documentation, in the downloadable package statixite.tar.gz r 0.6. Works with ssax-5.1, scsh-0.7, sunterlib-0.8. Enjoy poached or broiled.

Related software and the like