DotSF
DotSF is a stack based esoteric programming language created by user:ArthroStar11 that was heavily inspired by brainfuck, Befunge, with a few elements derived from Intercal.
Data Structure and Syntax
DotSF uses single character commands read from left to right. DotSF's only data structure is a stack of 32 bit integers with a maximum depth of 30000, a feature inspired by brainfuck's character cell count.
Commands
Math
- 0~9: push the corresponding integer onto the stack
- +: pops A then B off the stack then pushes A+B onto the stack
- -: pops A then B off the stack then pushes A-B onto the stack
- *: pops A then B off the stack then pushes A*B onto the stack
- /: pops A then B off the stack then pushes A/B onto the stack
- %: pops A then B off the stack then pushes A(mod)B onto the stack
- _: pops top value off stack then pushes two copies of the value onto the stack
I/O
- . takes input as an integer
- , takes input as a character
- : pops the top value and outputs it as an integer
- ; pops the top value and outputs it as a character
Flow Control
- [ and ]: [ pops the top value off the stack if the popped value is 0, skips to the next ] otherwise continues as normal
- A~Z: defines a label
- a~z: jumps to the corresponding label when reached, jumping to the same label more than 1000 times in a row throws an error.
Tip Command
The tip command, "$" has no function within the program but is necessary to include as the interpreter, known as "Agatha" wants compensation for it's work. This feature was inspired by Intercal's "PLEASE" command. the tip command should make up at least 1/10 of the source code but not more than 1/5.
- Note that your source contains one invisible tip command by default
- Also note that this means a source of less than 5 Bytes will always throw an error
Sample Programs
Prints "HI"
98*_;1+;
Truth Machine
.A__[:b$Ba]:
counts down from 99 to 1 (99 bottles of beer w/o lyrics)
0A1+_92+9*1+-_[:a]$
External Links
Link to ArthroStar11's interpreter (C++ source)
See Also
EXDotSF, a backwards compatible extension developed by User:Rudolph4268