THIS IS NOT A BRAINFUCK DERIVATIVE

From Esolang
(Redirected from TINBFD)
Jump to navigation Jump to search
Not to be confused with This is not a brainfuck derivative.

THIS IS NOT A BRAINFUCK DERIVATIVE (alternatively TINABD, TINBD, TINABFD, TINBFD, or simply TIN) is, contrary to the title, a brainfuck derivative. In fact, it's essentially brainfuck; there's no extensions, there's no catch, it's literally just brainfuck but with phrases instead of letters as commands. It is technically a compiled language, since it "compiles" the TINBFD program into brainfuck code, then interprets the brainfuck code.

And those sentences are:

In BF In TINBFD
+ THIS IS NOT A BRAINFUCK DERIVATIVE
- IT HAS NOTHING TO DO WITH BRAINFUCK
> IT NEVER WAS
< IT NEVER WILL BE
[ SHUT UP YOU LITTLE BITCH
] SHUT THE FUCK UP
. TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE:
, FUCK YOU

So, programs become absolutely massive in size compared to their... less profane BF counterparts. For example, here is the world's shortest brainfuck Hello, World! program:

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

And here is it translated into TINBFD:

IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT NEVER WAS IT HAS NOTHING TO DO WITH BRAINFUCK IT NEVER WAS IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE SHUT UP YOU LITTLE BITCH THIS IS NOT A BRAINFUCK DERIVATIVE SHUT UP YOU LITTLE BITCH IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WILL BE IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT NEVER WILL BE IT HAS NOTHING TO DO WITH BRAINFUCK IT NEVER WILL BE IT HAS NOTHING TO DO WITH BRAINFUCK IT NEVER WILL BE IT HAS NOTHING TO DO WITH BRAINFUCK IT NEVER WAS IT NEVER WAS IT NEVER WAS SHUT THE FUCK UP IT NEVER WILL BE SHUT THE FUCK UP IT NEVER WAS IT NEVER WAS IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS IT NEVER WAS IT HAS NOTHING TO DO WITH BRAINFUCK TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS IT NEVER WAS TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE IT NEVER WILL BE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE IT NEVER WILL BE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS IT NEVER WAS IT NEVER WAS TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE IT NEVER WILL BE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE IT NEVER WILL BE IT HAS NOTHING TO DO WITH BRAINFUCK TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS IT NEVER WAS IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE:

Isn't that a pleasant program? Such kind words, isn't it?

Syntaxual remarks

The TINBFD parser operates on a set of "words," which are separated by spaces. When it checks for a command, it first reads the first "word" of the program, or just up until the next space. Then, it checks to see if the word matches any of the first words of each command. If it doesn't match, it skips to the next word and restarts. If it does, it continues on until a whole phrase is matched.

For example:

  • THIS IS NOT A BRAINFUCK DERIVATIVE IT HAS NOTHING TO DO WITH BRAINFUCK is compiled to +-, as it should be.
  • THIS IS NOT A BRAINFUCK DERIVATIVE right? totally not a brainfuck derivative. IT HAS NOTHING TO DO WITH BRAINFUCK is also compiled to +-, as it should be; right? totally not a brainfuck derivative. doesn't match any proper commands, so it is ignored.
  • THIS IS NOT A BRAINFUCK DERIVATIVE IT HAS NOTHING TO DO WITH BRAIN FUCK, however, compiles to +, even though the first part of the second phrase matches, when it gets to the end, it sees BRAIN instead of BRAINFUCK so it drops the whole phrase and starts looking again for phrases that match BRAIN, which it will find none.

Compiler/Interpreter Package

You can get the compiler/interpreter at the GitHub repository.

Sample programs

These are just "decompiled" BF programs. Nobody actually writes code in TINBFD.

Hello, world!

This one is a simpler one than the one mentioned above, but is also longer.

THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE SHUT UP YOU LITTLE BITCH IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WAS IT NEVER WAS IT NEVER WAS IT NEVER WAS IT HAS NOTHING TO DO WITH BRAINFUCK SHUT THE FUCK UP IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WILL BE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE:

Cat

FUCK YOU SHUT UP YOU LITTLE BITCH TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: FUCK YOU SHUT THE FUCK UP

Nope. interpreter

THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE SHUT UP YOU LITTLE BITCH IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WILL BE IT HAS NOTHING TO DO WITH BRAINFUCK SHUT THE FUCK UP IT NEVER WAS TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE SHUT UP YOU LITTLE BITCH IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WILL BE IT HAS NOTHING TO DO WITH BRAINFUCK SHUT THE FUCK UP IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK IT HAS NOTHING TO DO WITH BRAINFUCK TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE SHUT UP YOU LITTLE BITCH IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WILL BE IT HAS NOTHING TO DO WITH BRAINFUCK SHUT THE FUCK UP IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE:

Truth Machine

IT NEVER WAS IT NEVER WAS IT NEVER WAS FUCK YOU TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: SHUT UP YOU LITTLE BITCH SHUT UP YOU LITTLE BITCH IT HAS NOTHING TO DO WITH BRAINFUCK IT NEVER WAS THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WILL BE IT NEVER WILL BE THIS IS NOT A BRAINFUCK DERIVATIVE IT NEVER WAS SHUT THE FUCK UP IT NEVER WAS IT HAS NOTHING TO DO WITH BRAINFUCK SHUT THE FUCK UP IT NEVER WILL BE IT NEVER WILL BE IT NEVER WILL BE SHUT UP YOU LITTLE BITCH IT NEVER WILL BE IT NEVER WILL BE SHUT THE FUCK UP IT NEVER WAS SHUT UP YOU LITTLE BITCH TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE: SHUT THE FUCK UP 

Interpreter

Trivial brainfuck substitution style interpreter.

#!/usr/bin/ruby
h = {
    'THIS IS NOT A BRAINFUCK DERIVATIVE' => 'm[p]+=1;',
    'IT HAS NOTHING TO DO WITH BRAINFUCK' => 'm[p]-=1;',
    'IT NEVER WAS' => 'p+=1;',
    'IT NEVER WILL BE' => 'p-=1;',
    'SHUT UP YOU LITTLE BITCH' => '(',
    'SHUT THE FUCK UP' => ')while((m[p]&=255)!=0);',
    'TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE:' => 'putc m[p];',
    'FUCK YOU' => 'm[p]=STDIN.getbyte if !STDIN.eof;'
}
r = Regexp.union(Regexp.union(h.keys.sort{|a,b|b.length<=>a.length}),/./);
eval 'm=Hash.new(p=0);'+ARGF.read.gsub(/[\n\t ]+/," ").gsub(r,h);

See also