metanohi/site/projects/enigma/index.org

1.7 KiB

Enigma

#&summary A backwards programming language with interpreter. #&

Enigma: A programming language

#&img;url=art/enigma-logo-small.png, alt='Enigma logo',\ #&width=400, height=200, float=right, medlink=art/enigma-logo.svg

Enigma is an interpreted programming language. With it you can create computer software. Enigma is not recommended for industrial use. It does work, however.

An Enigma interpreter along with a few tests can be downloaded *here*&large. It's relatively stable. I had to write it in Java, as I had to do an exam project in Java and I didn't want to create a programming language and a random Java program at the same time. I would've liked to write it in C otherwise (for the experience and for a FFI).

Documentation

Documentation is also included in the program download.

But before you do anything, here's an example of a program:

{/num/
    1 = res;
    {/n,r/
        r n ! multiply;
        n 1 ! subtract;
        n 1 ! greater = return;
    } = facfunc;
    facfunc num res ! loop;
    res = return;
} = factorial;

5 ! factorial | stdout "5! =" temp "\n" ! write;
7 ! factorial | stdout "7! =" temp "\n" ! write;

This is a factorial program. It will output this:

5! = 120 
7! = 5040 

So, while the syntax may be different than eg. C, it's not completely incomprehensible.

#&line

Note for people who are unable to not understand Danish:

Hvis du forstår dansk, kan du se min (anonymiserede) aflevering her.