KICK THAT HABIT MAN

From Esolang
Jump to navigation Jump to search

KICK THAT HABIT MAN is an esoteric functional programming language by User:Salpynx based on the permutation poems of Brion Gysin and Ian Sommerville, which were an early example of computer generated art.

The language has three main conceits:

  1. That the application of combinator calculus used to build binary trees can be implemented as a unary function which takes one argument and returns a function which does what is needed to build tree branches and eventually apply the results.
  2. Useful unary functions can be converted to (less useful, more complex) demi-semi-ary functions (i.e. quarter arity), where it takes four function applications to perform one standard operation.
  3. A functional tarpit language named KICK THAT HABIT MAN should at least be suited to generating permutation poems of itself if nothing else.

The four functions are:

Function Symbol
KICK -
THAT (
HABIT $
MAN £

All functions are unary and return a function. The symbols are taken from the book The Third Mind, and can be used as a short alias for the function.

To produce useful results, the functions must be permuted in groups (or lines) of four.

  • KICK THAT HABIT MAN in the 'standard' order produces the Identity function
  • A permutation other than the standard beginning with KICK produces the K combinator
  • A permutation beginning with THAT produces the S combinator
  • A permutation beginning with HABIT produces the application function
  • A permutation beginning with MAN effectively takes four arguments (via currying) and returns a permutation

The following are side effects:

  • Any invalid permutation will generate a PERMUTATION ERROR
  • The permutation generated by a line beginning with MAN will print to STDOUT

The language is to be implemented as the four functions, and as such can be used directly within a range of languages.

Bracketing or other methods of grouping beyond HABIT fn fn fn are not required, but could be used and will have the expected effects of evaluating grouped expressions as if they were standalone KICK THAT HABIT MAN programs, and then combine the results.

A specific evaluation strategy is not yet determined. It appears like it must NOT be eager. An implementation of these functions in Python is in progress.

The exact permutation algorithm is left unspecified, but ideally it should be one documented from the pre-1980s era.

Some work is required to determine the original character set of the symbols from the table above. Are they from the 1965 Honeywell 200 Model 120, or the University of Cambridge's EDSAC 2? The answer has no real bearing on anything, but the £ seems like it could rule one out.

External resources