Вот изложение истории языка и полное его описание:
Brainfuck
An Eight-Instruction Turing-Complete Programming Language
Brainfuck is the ungodly creation of Urban Müller, whose goal was apparently to create a Turing-complete language for which he could write the smallest compiler ever, for the Amiga OS 2.0. His compiler was 240 bytes in size. (Though he improved upon this later -- he informed me at one point that he had managed to bring it under 200 bytes.)
I originally started playing around with Brainfuck because of my own interest in writing very small programs for x86 Linux. I also used it as a vehicle for writing a program that created ELF files. Eventually, however, I too succumbed to the Imp of the Perverse and wrote some actual Brainfuck programs of my own.
The Language
A Brainfuck program has an implicit byte pointer, called "the pointer", which is free to move around within an array of 30000 bytes, initially all set to zero. The pointer itself is initialized to point to the beginning of this array.
The Brainfuck programming language consists of eight commands, each of which is represented as a single character.
| > | Increment the pointer. |
| < | Decrement the pointer. |
| + | Increment the byte at the pointer. |
| - | Decrement the byte at the pointer. |
| . | Output the byte at the pointer. |
| , | Input a byte and store it in the byte at the pointer. |
| [ | Jump forward past the matching ] if the byte at the pointer is zero. |
| ] | Jump backward to the matching [ unless the byte at the pointer is zero. |
Вот интерпретатор BF с примерами программ на BF:
http://esoteric.sange.fi/brainfuck/compi
Так выглядит HelloWorld:
>+++++++++[<++++++++>-]<.>+++++++[<++++>
<.#>+++++++++++[<+++++>-]<.>++++++++[<++
<++++>-]<+.[-]++++++++++.
А вот нахождение всех делителей числа, с авторскими
комментариями:
(проверял, оно работает!!)
* factor an arbitrarily large
positive integer
*
* Copyright (C) 1999 by Brian Raiter
* under the GNU
General Public License
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-
*
* read in the
number
*
<<<<<<<<<+
[-[>>>>>>>>>>][-]<<<<<<<<<<[[->>>>>>>>>>
>>>>>>>>>>,----------]
>>>>>>>>>>[-----------------------------
<[+>[>>>>>>>>>+>]<-<<<<<<<<<<]-
*
* display the number and
initialize the loop variable to two
*
[>++++++++++++++++++++++++++++++++++++++
----------------------------------------
++++++++++++++++++++++++++++++++++++++++
--------------------------.[-]
>>>>>>>>>>>>++<<<<+
*
* the main
loop
*
[ [-]>>
*
* make copies of the number and the loop variable
*
[>>>>[-]>[-]>[-]>[-]
>[-]>[-]
<<<<<<<[->>>+>+<<<<]>>>>>>>>]
<<<<<<<<<<[>>>>>>[-<<<<+>>>>]<<<<<<<<<<<
[>[->>>+>>+<<<<<]>>>>>>>>>]
<<<<<<<<<<[>>>>>>[-<<<<<+>>>>>]<<<<<<<<<
*
* divide the number by the loop variable
*
[>>>[-]>>>[-]>[-]>>>]
<<<<<<<<<<[<<<<<<<<<<]
>>>>>>>>>[-]>>>>>>>+<<<<<<<<[+]+
[
->>
double divisor until above
dividend
[>>>>>>[->++<]>>>>]<<<<<<<<<<
[>>>>>>>>[-]>[-]
<<<<[->>>++<<<]<<<<<<<<<<<<<<<]>>>>>>>>>
[>>>>>>>>[->+<[->+<[->+<[->+<[->+<[->+<[
[->--------->>>>>>>>>+<<<<<<<<<<[->+<]]]
<<<<<<<<<<[>>>>>>>>>[-<+<<<+>>>>]<<<<<<<
[>>>>>>>[-<+>[-<+>[-<+>[-<+>[-<+>[-<+>[-
[-<--------->>>>>>>>>>>+<<<<<<<<<<[-<+>]
<<<<<<<<<<
[>>>>[->>>+>>+<<<<<]<<<<<<<<<<<<<<]
>>>>>>>>>>[>>>>>>>[-<<<+>>>]>>>]<<<<<<<<
[>>>>>>>>[->-<]>
[<<<<<<<<<[<[-]>>>>>>>>>>[-<<<<<<<<<<+>>
>>>>>>>>>>>>>>>>>>>]
<<<<<<<<<<<<<<<<<<<]
>>>>>>>>>[+[+[+[+[+[+[+[+[+[+[[-]<+>]]]]
]
>>>>>>>>
[
subtract divisor from
dividend
<<<<<<
[>>>>>>>>[-]>[-]<<<<<[->>>+>+<<<<]>>>>>>
[>>>>>>>>[-<<<<+>>>>]<<<[->>>+>+<<<<]<<<
[>>>>>>>>>[-<<<<+>>>>]>]<<<<<<<<<<
[>>>>>>>>[-<->]<<<<<<<<<<<<<<<<<<]>>>>>>
[>>>>>>>[->+<[->+<[->+<[->+<[->+<[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>>>>[-<<<<<<<<<<<<<+>>>>>>>>>>>>>]>>
[>>>>>>>>[-<<<<<<<<<<<<<+++++>>>>>>>>>>>
[<<<<<<<<<<]>>>>>>>>>>
>>>>>>
]
<<<<<<
*
* make
copies of the loop variable and the quotient
*
[>>>[->>>>+>+<<<<<]>>>>>>>]
<<<<<<<<<<
[>>>>>>>[-<<<<+>>>>]<<<<<[->>>>>+>>+<<<<
>>>>>>>>>>[>>>>>>>[-<<<<<+>>>>>]>>>]<<<<
*
* break
out of the loop if the quotient is larger than the loop variable
*
[>>>>>>>>>[-<->]<
[<<<<<<<<
[<<[-]>>>>>>>>>>[-<<<<<<<<<<+>>>>>>>>>>]
>>>>>>>>>>>>>>>>>>]<<<<<<<<<<<<<<<<<<]
>>>>>>>>[>-<[+[+[+[+[+[+[+[+[+[[-]>+<]]]
[ [-]
*
* partially increment the loop
variable
*
<[-]+>>>>+>>>>>>>>[>>>>>>>>>>]<<<<<<<<<<
*
* examine the remainder for nonzero
digits
*
[<<<<<<[<<<<[<<<<<<<<<<]>>>>+<<<<<<<<<<]
>>>>>>>>>>>>>>>>>>>>[>>>>>>>>>>]<<<<<<<<
>>>>-
[ [+]
*
* decrement the loop variable
and replace the number with the quotient
*
>>>>>>>>-<<[>[-]>>[-<<+>>]>>>>>>>]<<<<<<
*
* display the loop
variable
*
[+>>[>>>>>>>>+>>]<<-<<<<<<<<<<]-
[>>+++++++++++++++++++++++++++++++++++++
----------------------------------------
++++++++++++++++++++++++++++++++.[-]>>>>
]
*
* normalize the loop
variable
*
>>>>>>
[>>[->>>>>+<<<<<[->>>>>+<<<<<
[->>>>>+<<<<<[->>>>>+<<<<<
[->>>>>+<<<<<[->>>>>+<<<<<
[->>>>>+<<<<<[->>>>>+<<<<<
[->>>>>+<<<<<[->>>>>--------->>>>>+<<<<<
[->>>>>+<<<<<]]]]]]]]]]]>>>>>>>>]
<<<<<<<<<<[>>>>>>>[-<<<<<+>>>>>]<<<<<<<<
>>>>>>>>>
]<
]>>
*
* display the number and
end
*
[>>>>>>>>>>]<<<<<<<<<<[+>[>>>>>>>>>+>]<-
[>++++++++++++++++++++++++++++++++++++++
++++++++++.
The BF interpreter in BF (when filtered through a comment remover) looks like: >>>,[->+>+<<]>>[-<<+>>]>++++[<++++++++>-]<+<[->>+>>+<<<<]>>>>[-<<<<+>> >>]<<<[->>+>+<<<]>>>[-<<<+>>>]<<[>[->+<]<[-]]>[-]>[[-]<<<<->-<[->>+>>+ <<<<]>>>>[-<<<<+>>>>]<<<[->>+>+<<<]>>>[-<<<+>>>]<<[>[->+<]<[-]]>[-]>]< <<<[->>+<<]>[->+<]>[[-]<<<[->+>+<<]>>[-<<+>>]>++++++[<+++++++>-]<+<[-> >>+>+<<<<]>>>>[-<<<<+>>>>]<<<[->+>>+<<<]>>>[-<<<+>>>]<[<[->>+<<]>[-]]< [-]>>[[-]<<<<->-<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<<[->+>>+<<<]>>>[-<<<+> >>]<[<[->>+<<]>[-]]<[-]>>]<<<<[->>>+<<<]>[->>+<<]>+>[<->[-]]<[<<<<+>>> >[-]]<<<[->+>+<<]>>[-<<+>>]>+++++[<+++++++++>-]<<[->>>+>+<<<<]>>>>[-<< <<+>>>>]<<<[->+>>+<<<]>>>[-<<<+>>>]<[<[->>+<<]>[-]]<[-]>>[[-]<<<<->-<[ ->>>+>+<<<<]>>>>[-<<<<+>>>>]<<<[->+>>+<<<]>>>[-<<<+>>>]<[<[->>+<<]>[-] ]<[-]>>]<<<<[->>>+<<<]>[->>+<<]>+>[<->[-]]<[<<<<++>>>>[-]]<<<[->+>+<<] >>[-<<+>>]>++++++[<++++++++++>-]<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<<[->+ >>+<<<]>>>[-<<<+>>>]<[<[->>+<<]>[-]]<[-]>>[[-]<<<<->-<[->>>+>+<<<<]>>> >[-<<<<+>>>>]<<<[->+>>+<<<]>>>[-<<<+>>>]<[<[->>+<<]>[-]]<[-]>>]<<<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[-[-[ -<<<+>>>[<<<->>>[-]]]]]]]]]]<<<[<+>[-]]<]>[-]]<<[->>>>>+<<<<<]>>>>>+>[ -]]>>]
March 1 2005, 03:11:38 UTC 7 years ago
Вообще этот язык довольно просто интерпретировать. А если написать для него ещё конвертатор туда-сюда в ассемблер (или даже C с ограничениями), то вполне можно такой изврат всавлять куда-нибудь :)
March 1 2005, 03:33:15 UTC 7 years ago
March 1 2005, 04:22:59 UTC 7 years ago
March 1 2005, 05:05:16 UTC 7 years ago
March 1 2005, 05:19:02 UTC 7 years ago
March 14 2005, 14:37:07 UTC 7 years ago
Anonymous
March 19 2005, 05:55:37 UTC 7 years ago
да и двоичная логика (add/and/or/xor) не помешает, если уж говорить о реальном применении, а иначе очень медленно будет, не смотря на простоту.
дальше - команды [ ] не есть командами risc, поскольку требуют дополнительную память хранения (стек, как вариант) и предвыборку - нужно добавить команды "пропуск следущего опкода если 0" и "переход по адресу..".
Вобщем если этот язык преобразовать под _быструю_ интерпретацию, получим форт-процессор :)
С Уважением, zyxman.
March 19 2005, 07:00:10 UTC 7 years ago
March 2 2005, 19:23:26 UTC 7 years ago
March 18 2005, 20:49:30 UTC 7 years ago
Anonymous
March 18 2005, 20:58:06 UTC 7 years ago
April 18 2005, 23:10:18 UTC 7 years ago
April 26 2005, 15:15:41 UTC 7 years ago
April 26 2005, 15:25:32 UTC 7 years ago
http://homepages.cwi.nl/~tromp/cl/l
Anonymous
October 20 2006, 06:50:06 UTC 5 years ago
Anonymous
August 5 2007, 06:06:56 UTC 4 years ago
Мой компилятор
Я знаю о Brainfuck всего два дня. Но мне очень понравилось на нём писать. Вот моя версия компилятора.http://ifolder.ru/2898078
Он очень простой. Может комуто понадобится.