|
NAMEnbfc -- The new brainfuck compilerSYNOPSISnbfc [options] fileDESCRIPTIONnbfc is a new, completely portable compiler for the brainfuck programming language. It will generate and compile C code or as an option a Java application.nbfc is quite different from the original brainfuck
compiler by the language's inventor Urban Mueller:
OPTIONS
INVOCATIONWhen called without any options, nbfc will translate the brainfuck file given on the command line to C and call a C compiler to produce an executable.The executable will have the name bf.out (this can be changed with the -o option). The intermediate C file always has the name bf.out.c and will be deleted if the -k option is not present. When using Java as the intermediate language, the default name for the application is bf.out.class, the default name for the Java file is bf.out.java. Both the class name and the intermediate Java code file name can be changed with the -o option. THE LANGUAGEbrainfuck is a simple enough language to include the entire official language describtion in this man page. The following is from the original brainfuck distribution by Urban Mueller <umueller@amiga.physik.unizh.ch>, who also invented the language:''The language brainfuck knows the following commands: Cmd Effect Equivalent in C --- ------ --------------- + Increases element under pointer array[p]++; - Decrases element under pointer array[p]--; > Increases pointer p++; < Decreases pointer p--; [ Starts loop, counter under pointer while(array[p]) { ] Indicates end of loop } . Outputs ASCII code under pointer putchar(array[p]); , Reads char and stores ASCII under ptr array[p]=getchar();All other characters are ignored. The 30000 array elements and p are being initialized to zero at the beginning. Now while this seems to be a pretty useless language, it can be proven that it can compute every solvable mathematical problem (if we ignore the array size limit and the executable size limit).'' BUGSThere is no checking for balanced brackets; if these are not balanced, strange things may happen. The compiler doesn´t optimize. There really should be a backend that generates assembly language code (at least for Intel and PowerPC machines) instead of only C and Java.AUTHORJens Ohlig <jo@koeln.ccc.de>
Visit the GSP FreeBSD Man Page Interface. |