Esoteric Language Stuff

I've made a few programs for some esoteric languages, namely, BrainF**k and SNUSP.

BrainF**k (bf)

This is a rather interesting language. It has only 8 commands, and so is very easy to make a compiler/interpreter for. Some information on it is here. I've made an interpreter and compiler in Python (a bit too slow) for it.

Unfortunately, they use win32 system calls and assembly, so they only work on windows. A batch file for use with NASM and ALink can be used to automate the compilation of bf files.


BF2SNUSP

This is a simple Python program that converts programs in the above language to the language below. You can simply put in the name of the BF program on the command line, and it will output the text of the new program. It works on every operating system, but the files it generates have many extraneous characters and go much, much faster with the compiler (in theory, only very slightly slower than the original programs).


SNUSP

This is pretty much a 2-dimensional version of the language above. A working draft of the specification exists, and some examples and ideas are at the Portland Pattern Repository Wiki.

I've managed to create a full Bloated SNUSP interpreter, which is, as far as I'm aware, the first complete interpreter. I have also managed to create a full-blown Modular SNUSP compiler (not just a pseudo compiler). This is, as far as I am aware, the first compiler ever created for a two-dimensional programming language.

It compiles each row and column, forwards, backwards, top to bottom and bottom to top, into a separate string of code. By jumping between these, the instruction pointer can simulate running in any direction.The only disadvantage is that the program has to take up roughly four times the space it otherwise would (there are optimizations to decrease the size, though).

These programs again require python and work only on Windows. I've created another batch file to help compile programs; this one also requires NASM and ALink. I've also gathered a small library of program in this language. Some (randout.snusp, parallel.snusp) won't work on the compiler.

I've just managed to make a version of that compiler that compiles to c. It should work on Linux. It uses setjmp, and longjmp for @ and #, so due to the extra space those structures use, recursion is more limited (just 1000 calls allowed, though that can be increased).


Here's another version of the above compiler for the Path language, which SNUSP was based on. There are differences in the details, but they are similar - unfortunately, the compiler doesn't support plugins for the language. I've also made another batch file to ease compilation.
The programs on this page are released under the terms of the GPL.