beta-Juliet and Portia

From Esolang
Jump to navigation Jump to search

beta-Juliet is an esoteric programming language designed by Chris Pressey, which aimed to be an event-oriented Turing tarpit. A beta-Juliet program consists of a set of named of events, each of which specifies its consequences.

Portia is a pre-processor for beta-Juliet which expands templates for event names into multiple events.

beta-Juliet and Portia have been superseded by 2iota.

Etymology and Disambiguation

beta-Juliet and Portia are not to be confused with the (non-esoteric) Juliet Programming Language and Portia Virtual Machine. This is an etymological coincidence. While the Juliet PL and Portia VM were named after characters from Shakespeare's plays, beta-Juliet and Portia are puns on the names of automobile manufacturers.

Computational class

Any beta-Juliet program can be shown to be no more powerful than a finite-state automaton in the following manner. A running beta-Juliet program, consisting of n events (where n is, of course, a finite non-negative integer), has only the following state:

  • Which event is currently occurring (n possibilities); and
  • A list of events, sorted by the last time each of them occurred (n! possibilities.)

This is a total of n*n! possibilities, which is finite since n is finite. Therefore, a running beta-Juliet program can only be in a finite number of states; each of these states can be enumerated, the transitions between them mapped, and arranged together to form a finite-state automaton.

Adding Portia does not change this, since Portia can only expand a pattern into a larger (but still finite) set of events.

2iota does change this, by allowing an indefinite number of new events to be generated at run time.

Note that, since there is no arbitrary limit on the size of a beta-Juliet program, the converse should hold: any FSA can be translated into a beta-Juliet program (if we allow beta-Juliet the luxury of input -- something which was never well-specified.)

External resources