Dis
Paradigm(s) | imperative |
---|---|
Designed by | Ben Olmstead |
Appeared in | 1998 |
Memory system | contiguous array/register |
Dimensions | one-dimensional |
Computational class | Bounded-storage machine |
Reference implementation | Malbolge and Dis (from the Wayback Machine; retrieved on 9 December 2003) |
Influenced by | Malbolge |
File extension(s) | no standard ending |
Dis is an esoteric programming language designed by Ben Olmstead to walk the line between humanly impossible to program in and just extremely painful. While it is not quite as fearsome as Malbolge, Dis is still pretty bad.
Differences from Malbolge
Dis is very similar to Malbolge in many respects. Here's a summary of the differences:
- The need for decryption of the instruction prior to decoding is eliminated.
- Instructions are not encrypted after execution.
- The crazy operator is replaced by a tritwise subtract without borrow.
- The opcodes are remapped:
ji*p/<vo
become*^>|}{!_
respectively. - The output instruction can end the program immediately when a 2222222222 ternary is written.
- Comments may be used, enclosed in parentheses. They can't be nested.
- Unused memory is zero-padded.
Sample programs
There are not many examples of Dis code. This cat program comes from the author:
(Unix 'cat' in Dis. This is the language test; I shall be working on a) ('Hello, world' program presently. In the meantime, here's cat with ) (explanation: ) * (Set the data pointer to 42--from the ASCII code of '*') ^ (Jump to label 1, below, via the ! at the new data pointer.) |||||||||||||||||||||||||||||||| (Placeholders.) (label 1:) }{ (Read a character, write, automatically die on EOF.) * (Set data pointer back to 42.) ^ (Read character, write character, repeat.) ||||| (More placeholders.) !||* (Data for jump and data pointer instructions which are used elsewhere.)
hello world program, by User:Pro465:
('Hello, world!' program in Dis.) * (Set the data pointer to 42--from the ASCII code of '*') |{ |||{ |{{ |||{ |{ |||{ ||{ |||{ |||{ |||{ |{ ||{ ! (Halt the program.) || (Placeholders.) $|QQ7|J||QQW|j|QQ]|Qf|QQb|QQW|QQW|&|QL| (Data.)
Computational class
Due to having a limited amount of memory, Dis is in the class of bounded-storage machines. However, if Dis were modified to be able to address an unbounded area of memory, like Malbolge Unshackled, it would likely be Turing complete as its operations are complete, and similar techniques used in Malbolge for conditional execution could be used in Dis.
See also
External resources
- Mirror of the Dis '98 specification (from the Wayback Machine; retrieved on 17 August 2022) including the original interpreter
- Malbolge and Dis (from the Wayback Machine; retrieved on 9 December 2003)