Nondescript
Jump to navigation
Jump to search
Paradigm(s) | Imperative |
---|---|
Designed by | User:PixelatedStarfish |
Appeared in | 2021 |
Memory system | Stack-based |
Computational class | Turing Complete |
Major implementations | Interpreter |
File extension(s) | .ndsc |
Nondescript is a programming language by User:PixelatedStarfish. It is a genericized, stack-based, language designed such that it has a simple interpreter. It supports various stack operations with minimal syntax. Riveting, isn't it? It was created for the language Bedtime as a base language. Bedtime compiles to Nondescript.
Commands
Commands are simple integers separated by newlines. Arguments for a command are separated by a space.
-1 - Comment. The '#' can also be a comment. 0 - Print top of stack 1 - Print ASCII value 2 - Print top of stack as ASCII 3 - Pop 4 - Push [0 if no argument] 5 - ADD V to value at top of stack [or 1] 6 - Label L 7 - GOTO L (Label) [or start] 8 - GOTO L if 0 [or start] 9 - Input. Singer char is default. Use argument 1 for an integer and 2 for a string. 10 - Duplicate top and push [or push 0 if empty] 11 - Shuffle Stack [unless empty] 12 - Halt 13 - No operation
Note that stack values range from 0 to 255. Adding 1 to 255 sets a value to zero.
Program Examples
Hello World
1 72 1 69 1 76 1 76 1 79 1 32 1 87 1 79 1 82 1 76 1 68
or
1 H 1 E 1 L 1 L 1 O 1 32 1 W 1 O 1 R 1 L 1 D
Truth Machine
9 5 -48 8 0 6 1 1 49 # Can include a no op here 7 1 6 0 1 48
Random Number (1-10)
4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 4 10 11 0