In any programming or scripting language x, write a program that takes a valid brainfuck sourcecode from stdin and output, to stdout, the sourcecode of a program, written in language x, that would output the exact same thing as the brainfuck program would do.
Your program must work for any valid brainfuck program, including the empty file.
Your score would be equal to the byte count of your sourcecode, plus the byte count of your output given the following input:
+++++ [-]
+++++ +++++ [
> +++++ ++
> ++ +++ ++++ +
> +++
<<< -
]
> ++ . H
> + . e
++ +++ ++. l
. l
+++ . o
> ++ . space
< +++++ +++ . w
----- --- . o
+++ . r
---- - - . l
----- --- . d
> + . exclamation mark
------lol; useless code :-)--------------------------[.............................................][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]<-<<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
For example, for an input of [-]
, the output of *p=0;
is much more favourable than while(*p) *p--;
If you happen to use non-ASCII characters, the byte count must be calculated using the UTF-8 encoding.
Lowest score wins. However, creative solutions that attempt to minimise the output shall be encouraged by upvotes.
byte count of source + (byte count of output)^2
, would that encourage people to focus more on simplifying the output? \$\endgroup\$