An interpreter for a computer language with a naughty name.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
brainmess-dotnet
csharp
csrc
haskell
java
js
scripts
.gitignore
README.md
test.txt

README.md

Brainmess

This project contains multiple implementations of interpreters and compilers for the language I call Brainmess. (Note, this links to the wikipedia article that describes the language and gives it's real name. The real name may by NSFW.)

I've normally taken the approach that the tape should be "infinite" in both directions and therefore I tend to use a linked list.

I've used this programming exercise during Refactoring study groups, with an emphasis on clean code and testability rather than on efficiency. Therefore, the implementations tend to be more "verbose" than the implementations discussed at the Wikipedia site.

This abstraction presents itself as interfaces an extension methods in C#. In Haskell, I created my own class to break the module circular dependencies. In C I used header files to define modules with different implementations for production and test.

DirectoryDescription
javaA Java implementation. A few unit tests. The Java LinkedList works a little stranger than I expected. I wrote a strange ListTraveler class to adapt the iterator to my needs. Opens up in Eclipse.
csharpA C# implementation. A lot of unit tests. At one point it was 100% code coverage. Some refactorings have left the coverage somewhat less. Opens up in Visual Studio 2010. The code projects will open in MonoDevelop as well. The test projects won't as they are MSTest. I'm considering switching to another code coverage tool so I don't need to use MSTest.
haskellA Haskell implementation. Some unit tests. Compiles with ghc. Just type ghc brainmess.hs to compile.
csrcA C implementation. No unit tests (I plan to try CUnit.) Should compile by just typing make.
scriptsSome sample brainmess programs.
brainmess-dotnet A .net brainmess compiler. No unit tests.

Other implementations that I plan to tackle: C++, Objective C, Javascript.