BrainFuck.Net
As part of their .Net initiative, Microsoft have created a VM
which is not only platform independent (theoretically anyway) but
also language independent. You can develop for .Net in VB.Net,
C++ or C#, Microsoft's Java clone. Microsoft have commissioned several
other people to port languages to the .Net platform.
However, in typical Microsoft style, they have totally overlooked one
of the most important and useful languages! I speak, of course, of
Brainfuck.
Brainfuck is designed to be one the most compact languages possible
while still being turing complete. While brainfuck has only 8
commands, it is still theoretically possible to do anything in it
that can be done in other languages. The 8 brainfuck commands are:
| + | Increment value under pointer |
| - | Decrement value under pointer |
| > | Increment pointer |
| < | Decrement pointer |
| [ | Loop while value under pointer is nonzero |
| ] | End of loop |
| , | Read character from input into pointer |
| . | Output value under pointer to screen |
To remedy this tragic oversight on the part of Microsoft, I have
written a compiler to compile brainfuck code to the MSIL VM.
Newsflash! The Portable.Net compiler now includes
a brainfuck frontend.
Credit for this goes to
Gopal.V. It generates the same code as my compiler does, although
the source is from scratch.
Download
FAQ
-
Does this work with the Microsoft IL Assembler?
I have no idea. I use the DotGNU
Portable.Net implementation of the IL Assembler. There should
be no reason why the Microsoft Assembler will not assemble the
IL code outputted by the compiler, but the compiler may pass
options to ilasm that the Microsoft Assembler will not understand.
-
Does this run under Windows?
Its rumoured to run in
CygWin and also DJGPP.
All my development for this was done under Linux.
-
Is the BrainFuck.Net language different to ordinary BrainFuck?
Unlike other impure languages which have had to change their syntax
in order to run in the CVM, BrainFuck is flexible enough that
there is no need to alter the syntax.
-
Could this be modified to work with the JVM?
Yes, very easily infact. You're welcome to do it if you want.
-
Shouldn't you write this in C#?
No, now go away.
-
Can I use BrainFuck.Net to write webservices?
No. Well, probably not. Yes! Using the Portable.Net
frontend, now you CAN write webservices in bf.net. Yet another
example of the crazy world we live in :)
-
Does BrainFuck.Net use the controversial Microsoft Passport system
for authentication?
No. The Brainfuck language has only 8 commands, and none of them
are related to authenticating remote network users.
Links
Simon Howard