In accordance with our meta agreement to have a Language of the Month, and since the list of nominations has a single highest-voted entry as March nears its end, I am pleased to announce the next featured language! Throughout April 2018, our Language of the Month, nominated by Destructible Lemon, will be:
Brain-Flak
What's a Language of the Month?
See the meta posts linked above. In short, during April, those who wish to participate should learn (at least the basics of) Brain-Flak, use it to solve challenges, and discuss it in the Brain-Flak chat room, The Third Stack. Participation is completely optional, but is anticipated to be fun!
Information about Brain-Flak
Brain-Flak is a minimalist stack-based turing tarpit. It uses only the brace characters ()[]{}<>
, which must be balanced. Data consists of integers stored on a pair of stacks. However, despite its humble feature set, there is a surprising depth and elegance to the language.
Brain-Flak is entirely composed of atoms, which can either be niladic (taking 0 arguments) or monadic (taking exactly one argument). A nilad is a pair of brackets with nothing between them, i.e. one of
"()", "{}", "[]",
or"<>"
. A monad is a pair of brackets with any number of other atoms between them.Due to the nature of using only brackets for code, these atoms are highly nestable. One of the most fun pieces of using brain-flak is learning how to use these atoms efficiently for both their functionality and returned value.
Even though it was designed as a turing tarpit with only 8 commands, there are certain tasks that can done very tersely in brain-flak. Most notably, operations with polygonal numbers and summations.
Documentation
The readme on the GitHub repository contains a good summary of the language. Further help can be found at:
- Brain-Flak wiki on GitHub
- Esolangs.org page
- Tips question
-
For help, you can ping @DJMcMayhem or @user56656.
(If you consider yourself knowledgeable in brain-flak and would like to help teach it to other users, feel free to add your name to the list)
Interpreter
The simplest way to run Brain-Flak is through Try It Online! There are two interpreters available on TIO: the original Ruby interpreter and an implementation in Haskell.
You can also download implementations in Ruby, C, Haskell, and Prolog.
(([((((()()())()())({}){}))]((((([]([][]([[]]([[]()()]([][]()([]()({}{}{})({})({})))))))[[]()])<([][][][])>[][])()[[]])))[[][]]())
Thanks to Jo King, user56656, and Nitrodon for golfing help :D