Category:Brainf***: Difference between revisions

m
- 2nd link to Turingmachine
(recursive category?!)
m (- 2nd link to Turingmachine)
 
(14 intermediate revisions by 5 users not shown)
Line 1:
{{language|Brainf***|bnf=http://ninh.nl/blog/2008/10/25/brainfck-birds-of-a-feather-session-take-2/}}
{{Programming Language}}
Also known as '''Brainfuck''', but identified as '''Brainf***''' for reasons described [[Rosetta Code:Brainf***|here]]. <br>
Created by Urban Müller in 1993 in an attempt to create the world's smallest Turing-complete compiler.
It is noted as an [[:Category:Esoteric_Languages|esoteric programming language]],
as it is not ordinarily used for applications development,
but it also noted as being a minimalist language.
 
The construction of the language is similar to a [[wp:Turing Machine|Turing Machine]]. <br>
Also known as Brainfuck. Created by Urban Müller in 1993 in an attempt to create the world's smallest Turing-complete compiler. It is noted as an [[esoteric programming language]], as it is not ordinarily used for applications development, but it also noted as being a minimalist language.
As with the Turing Machine, Brainf*** is built from a finite state machine and an infinite tape of cells.
Each cell can be any size, including unbounded, but is frequently an eight bit byte.
The finite state machine is the program code with the program counter pointing at the current state. <br>
The strong similarity is one reason that a Brainf*** equivalent named ''Ρʺ''
was suitable for use by Corrado Böhm in 1964
to prove that structured programming using only ''while loops''
was just a powerful as ''goto spagetti'' programming.
 
The complete specification for the language can be summed up with the following eight symbols:
(the available state transitions of the Turing machine)
can be summed up with the following eight symbols:
 
{| class="wikitable"
Line 9 ⟶ 23:
!align="left" |Meaning
|-
|style="text-align:center"|<codett>></codett>
||increment the pointer (to point to the next cell to the right).
|-
|style="text-align:center"|<codett><</codett>
||decrement the pointer (to point to the next cell to the left).
|-
|style="text-align:center"|<codett>+</codett>
||increment (increase by one) the bytecell at the pointer.
|-
|style="text-align:center"|<codett>-</codett>
||decrement (decrease by one) the bytecell at the pointer.
|-
|style="text-align:center"|<codett>.[</codett>
||outputjump forward to the valuecommand ofafter the bytecorresponding <tt>]</tt> if the cell at the pointer is zero.
|-
|style="text-align:center"|<codett>,]</codett>
||acceptjump oneback byteto ofthe input,command storingafter itsthe valuecorresponding in<tt>[</tt> if the bytecell at the pointer is nonzero.
|-
|style="text-align:center"|<codett>[.</codett>
||jump forward tooutput the commandvalue afterof the corresponding <code>]</code> if the bytecell at the pointer isas a zerocharacter.
|-
|style="text-align:center"|<codett>],</codett>
||jumpaccept backone tocharacter theof commandinput, afterstoring theits correspondingvalue <code>[</code> ifin the bytecell at the pointer is nonzero.
|}
 
Alternatively, the <codett>]</codett> command may instead be translated as an unconditional jump '''to''' the corresponding <codett>[</codett> command, or vice versa; programs will behave the same but willmay run more slowly.
 
All other symbols, including traditional whitespace characters, are interpreted as comments.
 
The definition of the <tt>.</tt> and <tt>,</tt> in the above table still has some ambiguities due to the many ways of converting 'numbers' to 'characters'.
Due to this minimal instruction set, Brainf*** is used as an introduction to compilers and has even been successfully implemented as a microprocessor core and the foundation to an operating system using a slightly extended syntax for output.
Urban Müller's ''smallest compiler'' converted between characters and numbers using the ASCII character set.
The newline character is number ''10'' and a end of file on input is signalled by the cell value being unchanged when the <tt>,</tt> command completes.
The <tt>,</tt> command uses line editing and waits for for the return key to be pressed.
 
Due to this minimal instruction set, Brainf*** is used as an introduction to compilers and has even been successfully implemented as a microprocessor core and the foundation to an operating system using a slightly extended syntax for output.
== Citations ==
BUT due to vehement opposition to the name [http://esolangs.org/wiki/Cupid various] [http://esolangs.org/wiki/Category:Brainfuck_equivalents equivalents] are frequently used.
 
* [http://en.wikipedia.org/wiki/Brainfuck Wikipedia entry on Brainf***]
==See also==
* [[Rosetta Code:Brainf***]] ( why some people call it BF :)
* [[RCBF]] - BF interpreters as a Rosetta Code task
 
== Citations ==
 
* [[eso:Brainfuck|Esoteric languages wiki entry]]
* [http[wp://en.wikipedia.org/wiki/Brainfuck |Wikipedia entry on Brainf***]]
* [http://dmoz.org/Computers/Programming/Languages/Brainfuck/ DMOZ Brainf*** category]
* [http://www.iwriteiam.nl/Ha_BF.html Brainf*** tutorial]
 
 
[[Category:Esoteric LanguagesEsoteric_Languages]]
Anonymous user