Compose

From Esolang
Jump to navigation Jump to search

Compose is a language with 3 levels of abstraction, described in mixed metaphors to avoid being thematic. The lowest level is based on string rewriting, the next based on graphs, and the highest is based on function composition. There are many different ways to accomplish anything in this language, as tasks can be moved between levels of abstraction. Due to this, and the distinct sections of each program, it can be thought of as a language that is used to write programs, or as a language that is used to write programming languages, in a manner similar to currying.

This is a work in progress, as better syntax is developed.

Particles

The first section of a Compose program is the definition of particles. Each particle consists of:

  • A stack, which holds characters
  • A buffer, initially empty
  • A list of string rewriting rules

A particle is defined as follows:

*name {match_0:replace_0, match_1:replace_1, ... match_n:replace_n}

This defines a particle named "name" with n string rewriting rules, each replacing "match_k" with "replace_k" for some k.

Organs

Functions