BrainFc

From Esolang
Jump to navigation Jump to search

BrainFc (pronounced the same as "brainfuck") is a metalanguage by User:None1. It can interpret almost any Trivial brainfuck substitution languages, translate them from and to brainfuck,and to other Trivial brainfuck substitution languages and some non-esoteric languages (like C).

Examples

{
  "cmd": {
    "+": "-",
    "-": "+",
    ",": ".",
    ".": ",",
    "[": "]",
    "]": "[",
    ">": "<",
    "<": ">"
  },
  "delims": [],
  "actions": [
    ["frombf","++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++."],
    ["tobf",".],.["],
    ["inter","------]<------------->+[<,<-----------]<---------->+[<-,-,+++++++++++,<-----]<--------->+[<-,"],
  ]
}

specifies ReverseFuck and translates the brainfuck program ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++. to ReverseFuck, then translates the ReverseFuck program .],.[ to brainfuck and interprets the ReverseFuck program ------]<------------->+[<,<-----------]<---------->+[<-,-,+++++++++++,<-----]<--------->+[<-,.

BrainFc supports a beginning and ending of program so it is possible to implement and then.

All BrainFc programs are JSON files.

Documentation

Unfortunately, BrainFc has a lack of documentation. But here is the GitHub repository of BrainFc along with a very brief readme and the source code of the language in Python and some examples. There is also a Repl.

See also