Dosctrign’
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
i don’t know how to edit stuff like this, so it would be really helpful if you contribute here. this esolang is a work in progress.
//info box is from !i!m!p!o!s!s!i!b!l!e
Designed by | Zaydiscool777 |
---|---|
Appeared in | 2023 |
Dimensions | one-dimensional |
Computational class | Total |
Reference implementation | DNE |
Influenced by | Unknown |
File extension(s) | .apostrophe, .dosc, .mehow, .hoy |
Dosctrign’ [huj:.me.nuj:.me.nuj:] /hoy-me-noy-me-noy/, which can be shortened to dosc’ /dosk/, is an esolang that will be created by Zaydiscool777. Its unique feature is that it’s one of not many esolangs that can interchangeably change their data structure from a stack to a cyclic linked list.
Oh yeah, also, all command, parentheses, and other stuff (w.i.p.) have to be separated by a space. Also, you can only create negative numbers using neg. Also, you have to use base 11. Also, there is no digit for 10. I mean, you won’t die typing out add 10 ( neg 1 ), dude.
Humor
You can replace here with here lies, and end with me how, and vice versa. Sometimes people need humor for once, especially when dealing with goto statements.
Now, back to where we were
Every command returns a value. When a list is given where a number should, its first element is used as the number. if that is a list, then its first element is used, and so on. If a list is empty, 0 is used instead. When turning a list into a number for a command, if a sublist is empty, the next element that the sublist is in is used instead, and if all the elements in the list are or contain empty lists, then 0 is used instead. When a variable is given where a constant should, then unless there is a specific case, the value it holds is used instead. When a number is give where a list should, then a simpleton of that number is used instead. Here are some examples:
[ ] = 0 [ 1 ] = 1 [ 1 , 2 ] = 1 [ [ ] , 2 ] = 2 [ [ [ ] , [ ] ] , 55 ] = 55 [ [ ] , [ [ ] ] , [ [ ] , [ [ ] ] ] ] = 0 x = (value of x) 9 = [ 9 ]
Basically:
- LN: the first number the interpreter finds is returned, but if there is no number found, 0 is.
- NL: Simpleton
- VC: Value
The starting mode (a.k.a. is it stack or list?) is dependent based on your interpreter (that doesn’t exist).
Flow
There is a lack of flow in Dosc’. does that make it a functional programming language? well, there are no functions. hmm… There are only 3 (4 if you count neg [actually, you should, why did I exclude neg?]) flow controlling commands in Dosc’:
goto (c/v c/v=1) | Goes to the here command with the same label as the first value if the second one is 1. (if left out, is default is.) Returns 0. |
here/here lies (c/v) | All goto commands with the same first value as this one will make the command pointer jump to this command. Returns 0. |
less (c/v c/v) | If the first value is less than the second one, then it returns 1. else, it returns -1. |
neg (c/v) | Returns 0 - the value. Serves as a logical not gate. |
Here is a truth-machine (credit to Keymaker) (how do i make this look like code?):
init x get x add x ( neg 44 ) goto 1 x print 44 end here 1 print 45 goto 1
And here is a slightly more humorous version:
init lol get lol add lol ( neg 44 ) goto 69 lol print 44 me how 21 here lies 69 #we will miss him dearly. print 45 goto 69
Commands
‘ = linked list (mode), “ = stack (mode), [] = type of c/v. ‘ or “ in first column means only works in that mode.
Command | Function |
---|---|
init (var) | Initializes the variable at 0. Returns 0. ex: init x -> 0 |
set (var c/v) | Sets the variable to the second value, which is returned. ex: set x 1 -> 1 & x = 1 |
kill (var) | Undefines the variable, and returns its value before deletion. |
of | Example |
add (const[n] c/v) | Returns an addition of the two values. ex: add 3 ( neg 2 ) -> 1 |
add (var c/v) | Applies the second value to the variable with add, and returns it. ex: x = 2 & add x 1 -> 3 & x = 3 |
add (const[l] c/v) | Appends the second value to the list, and returns that. (If the second value is another list, the entire list is appended.) ex. add [ 1 , 2 ] 3 -> [ 1 , 2 , 3 ] |
neg (c/v) | Returns 0 minus the value. ex: neg 5 -> -5 |
neg less (see less) | Returns the opposite of what less should. ex: neg less 1 2 -> -1, because less 1 2 -> 1. No parentheses are needed for the less part. |
less (c/v c/v) | If the first value is less than the second one, then it returns 1. else, it returns -1. ex: less 1 2 -> 1 |
goto (c/v c/v=1) | Goes to the here command with the same label as the first value if the second one is 1. (if left out, by default, is.) Returns the second value. |
here/here lies (c/v) | All goto commands with the same first value as this one will make the command pointer jump to this command. Returns 0. |
switch | Interchanges the mode between ‘ and “. Returns 0 if was “ before, 1 if was ‘. (may change based on interpreter) |
con’ | Example |
rem’ | Example |
pop” | Example |
psh” | Example |
head | Example |
eye’ | Example |
exist’ | Example |
Example | |
get | Example |
wait | Example |
# (a string) | Returns 0. |
end/me how (const=0) | Halts the program. If given, the value is the exit code. If not, returns exit code 0. |