What is the purpose of this language called Brainfuck?

Asked

Viewed 920 times

20

There is a programming language called Brainfuck which has a very confusing and difficult to understand syntax.

For example, to make a simple Hello World in the same, you have to do the following:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Looking at this little "string", we can understand why the language name.

Then, taking into account the difficult syntax of the language (and the name), I would like to know what is the purpose of its existence?

This is a joke they made or this language can actually be used to build applications?

One more example:

inserir a descrição da imagem aqui

  • 4

    The goal is already described by the name of the language.

2 answers

17


This language is part of a set of languages that has more theoretical applications than practical. Wikipedia (free translation):

Although it is equivalent to the Turing machine, [the language] was not developed for practical applications, but only for challenge and entertain the programmers.

It’s kind of a joke, but how she is Turing complete, can be used to create any application (not that someone will do it in practice). You will find several examples of its use in Programming Puzzles & Code Golf.

  • 1

    Brainfuck is the second most fodastic programming language that exists in the context of being Turing complete. The most fucked up of all is another that came out of her, the Boolfuck.

14

"Brainfuck is an esoteric programming language, it has almost no function, it is a compact language. His goal was to create the world’s smallest compiler, and also challenge and confuse the programmers, and then, is not useful for a development. Because of its simplicity, the development of compilers and interpreters for this language is much easier than for other languages, for example, the size of its compiler is 240Bytes."

source link

Browser other questions tagged

You are not signed in. Login or sign up in order to post.