Brainfuck Markup Language

From Esolang
Jump to navigation Jump to search

Brainfuck Markup Language (BFML) is an example of an Esoteric Markup Language created by User:Hppavilion1 in the #Esoteric IRC channel to provide an example of an Esoteric Markup Language.

Syntax

BFML has a simple syntax derived from Brainfuck and Plain Text. The first line of a BFML program is a valid program written in a close derivative of (36-bit) (wrapping) brainfuck (Minus I/O). The . operator is changed to an eof detector, returning 0 if the pointer location is less than or equal to the file length and 1 if it is greater. This program is executed by the interpreter and the final tape stored (if the program doesn't halt, the program hangs forever (so as not to cause any Halting Problems)).

The rest of the file is plain text to be marked up.

For each character, the corresponding cell from the tape of the brainfuck program is taken and converted to binary. The bits in this cell determine the formatting of the cell.

The bits are as such:

  • Most Significant Bit: Bold (bold if 1, else standard)
  • Bit 2: Italics (italicized if 1, else standard)
  • Bit 3: Underline (underlined if 1, else standard)
  • Bits 4..11: Text size (Text size corresponds to decimal of these bits)
  • Bits 12..36: Color (color corresponds to hex code of these bits)

Newlines are counted as characters. Centering and such is done via tons of spaces. Whitespace is not collapsed.

Shortcuts

Due to the unimaginable (i.e. 34,359,738,368) number of incrementers needed just to make a single character bold, it has been decided that instructions can be repeated n times by following the instruction with the integer n. This will make BFML programming significantly easier.

Examples

Hello World

Notice the lack of BF on this line (this being a comment)
Hello, World!

Rainbow Hello World

(To Be Implemented)

Computational Class

Interestingly for a Markup Language, BFML is Turing-complete as it includes a brainfuck program in every file. Since brainfuck is Turing-complete, and as such anything extending brainfuck (without removing any key features) is Turing-complete, and BFML essentially extends brainfuck, BFML is, by definition, Turing-complete.

Precursors

Prior to to the creation of BFML (by about 30 seconds), Hppavilion1 created a simpler language called "brainfuck Markup Language (Bold Only)". The syntax was similar to BFML, except the only stylization was bold, available if n>1 (where n is the corresponding cell)

Variants

For every Brainfuck Derivative or Brainfuck equivalent with a non-finite tape, there is at least one BFML variant that uses that variant's tape (plus more for more complex ones that also include stacks or the like). If the cells in the language's tape are limited to below 36 bits (such as in Boolfuck), the bits in the tape are joined then split into 36 bit chunks (the excess bits left over).