Splinter

If the language has no beauty its computation is useless. -- Keymaker (this quote not meant to be ironic)

Overview

Splinter is an esoteric programming language designed by Keymaker in 2007. The idea for the language was got few months before it was finished, then a break followed, until finally it was finished quite near the day it was finished. The language has 26 unbounded memory storages, splinters, indicated with the capital alphabets A-Z. Every time an instruction is executed in the program (initially the content of the file the interpreter reads), it's removed from the program, and running the program is finished when the program string is empty, in case the program is a terminating one. The program string is always executed from left to right, from its beginning. It may be of any length, or no characters at all. Data that doesn't form instructions is ignored and removed during execution, being NOP. An incomplete instruction, such as unmatching brackets, is an error.

Instructions

The language has three instructions.

1. Replacing a capital alphabet with the matching splinter. This instruction consist of only one character. If, for example, 'V' is encountered, its matching splinter replaces it. Say, there is data "ABC" stored in splinter 'V', so the program "VN" would look like "ABCN" after the 'V' is executed.

2. Storing in splinters. This instruction consist of three characters minimum. First a capital alphabet to indicate in which splinter to store, and then the content followed inside '{' and '}'. The string to store can be of any length, including length of zero. There can be nested '{' and '}, and every '{' needs to have a matching '}', unless they're part of an output instruction (see below).

3. Output. Output instruction consist of two characters, '\' and after it the character to output. For example, program "\t\e\s\t" would output "test". New-lines can be output by having the new-line character right after the '\'. Outputting brackets is allowed, and thus "\}" would be a valid program.

Computational class

The language has infinite storage capabilities well and proper, but not enough means to manipulate the data, or increase it infinitely. The language is a finite-state automaton, if I'm not mistaken. (Edited on 17.3.2008:) It seems the language is a push-down automaton, in fact! Nice to see it gaining more computational power, but now it's at its limit for sure, the language is not Turing-complete in any case! It being a PDA was noticed by ais523, and he also made a PDA to Splinter compiler! It appears what I thought was impossible, expanding memory infinitely, is possible afterall -- but only increasing the actual program data, not the data stored in splinters! Thus, only one stack can be 'emulated', and the data accessed only in the usual stack fashion -- first in, last out. (The program being always executed from left to right.) And just to note, the purpose was to keep it simple like this, and not to add extra functionality to gain Turing-completeness.

Programs

Here are some Splinter programs written by me.

hello.spl - Hello, world!

inf.spl - Shortest infinite loop.

99.spl - "99 bottles of beer" in Splinter.

limitless.spl - A program to showcase the push-down automaton properties of Splinter -- written in ais523's simple PDA (the PDA program can be found here), and compiled into Splinter with the compiler he wrote (see below). This program increases the program space infinitely (so likely the interpreter is going to crash at some point).

Interpreter

To run Splinter programs you can use this interpreter written in Python. I suggest you to run only valid programs as the interpreter doesn't handle error situations.

Compiler

A compiler for a simple push-down automata to Splinter has been written by ais523. It's written in Perl and you can get it here.

-- Keymaker, 16.11.2007