We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Sushi (sushi)
Jump to navigation
Jump to search
Sushi is an esoteric programming language based on an infinite number of stacks, created in 2026 by User:Sushi with the goal of being an atypical language. It has the following commands:
| Command | Description |
|---|---|
| Stack manipulation | |
Cps |
1. Duplicate the top element of stack s. |
Swstt |
2. Swap the top elements of stacks s and t. |
Rtsnn |
3. Rotate stack s by n positions (negative = reverse direction). |
Rvs |
4. Reverse stack s. |
Mvstt |
5. Move the top element of s to t. |
Mgstt |
6. Merge all of s onto t, emptying s. |
Cls |
7. Clear stack s. |
Szs |
8. Push the size of s onto s. |
Pksnn |
9. Push a copy of the n-th element from the top of s onto s. |
Spstt |
10. Split s in half; the upper half goes to t. |
Ilstt |
11. Interleave s and t into s. |
Dds |
12. Remove duplicate values from s (first occurrence stays). |
Sts |
13. Sort s ascending. |
Shs |
14. Shuffle s. |
Mrstt |
15. Copy s into t in reverse order. |
Dps |
16. Delete the bottom element of s. |
Ibsxx |
17. Insert x at the bottom of s. |
Lks |
18. Lock s: all pushes and pops on it are ignored. |
Uks |
19. Unlock s. |
Frs |
20. Freeze the top element of s: pop skips it. |
| Arithmetic | |
Ads |
21. Pop two elements, push their sum. |
Sbs |
22. Pop two, push the difference (second − top). |
Mls |
23. Pop two, push the product. |
Dvs |
24. Pop two, push the quotient. On division by zero, push the stack number instead. |
Mds |
25. Pop two, push the remainder. |
Pws |
26. Pop two, push second to the power of top. |
Sqs |
27. Square root of the top; if negative, push it to stack -s instead. |
Abs |
28. Absolute value of the top. |
Ngs |
29. Negate the top. |
Gcs |
30. Pop two, push their GCD. |
Lcs |
31. Pop two, push their LCM. |
Fcs |
32. Replace the top with its factorial. |
Fbs |
33. Replace the top with the n-th Fibonacci number. |
Pfs |
34. Replace the top with its prime factors (smallest on top). |
Rdsnn |
35. Round the top to n decimal places. |
| Control flow | |
Ifs … Fi |
36. Run the block if the top of s is non-zero. |
Uns … Nu |
37. Run the block unless the top of s is non-zero. |
Lpsnn … Dn |
38. Repeat the block n times. |
Whs … Hw |
39. Repeat the block while s is not empty. |
Br |
40. Break out of the innermost loop. |
Skn |
41. Skip the next n commands. |
Lbl |
42. Define label l. |
Jml |
43. Jump to label l. |
Fnname … Nf |
44. Define a function. |
Caname |
45. Call a function. |
Rn |
46. Return from a function. |
Eqs |
47. Pop two, push 1 if equal, otherwise 0. |
Lts |
48. Pop two, push 1 if second < top. |
Gts |
49. Pop two, push 1 if second > top. |
Nts |
50. Logical NOT of the top. |
| Input / output | |
Prs |
51. Print the top of s without popping. |
Pns |
52. Pop the top of s and print it with a newline. |
Pas |
53. Print the whole stack as a list. |
Chs |
54. Print the top as an ASCII character. |
Rcs |
55. Read a single character into s. |
Rls |
56. Read a line and push it as character codes. |
Rfnamess |
57. Read a file's contents into s. |
Wfnamess |
58. Write stack s to a file. |
Ar |
59. Push command-line arguments onto stack 0. |
Ectext |
60. Print the literal text. |
Ers |
61. Print the top of s to the error stream. |
Bl |
62. Ring the terminal bell. |
| Strings | |
Sjs |
63. Concatenate the top two strings. |
Lns |
64. Push the length of the top string. |
Ups |
65. Convert the top string to uppercase. |
Lws |
66. Convert the top string to lowercase. |
Rss |
67. Reverse the top string. |
Srsaabb |
68. Replace every a with b in the top string. |
Css |
69. Convert character codes on s into a string. |
Scs |
70. Convert the top string into character codes. |
Pds |
71. Push 1 if the top string is a palindrome, otherwise 0. |
Cnscc |
72. Count occurrences of c in the top string. |
Trs |
73. Trim whitespace from the top string. |
Rosnn |
74. Apply ROT-n to the top string. |
| Stack ecosystem and meta | |
Nw |
75. Create a new stack and push its number onto the current one. |
Dls |
76. Destroy stack s; its contents scatter to random stacks. |
Ls |
77. List all non-empty stacks. |
Bks |
78. Take a snapshot of s. |
Res |
79. Restore s from its last snapshot. |
Uds |
80. Undo the last operation on s. |
Rps |
81. Redo the last undone operation on s. |
Alstt |
82. Make s an alias of t. |
Tps |
83. Teleport the top of s to a random stack from -100 to 100. |
Evs |
84. Evaluate the top string as Sushi code. |
Qn |
85. Print the program's own source code. |
Ht |
86. Halt the program. |
Sln |
87. Sleep for n milliseconds. |
Cmtext |
88. Comment (ignored). |
| Randomness and time | |
Rgsaabb |
89. Push a random integer from a to b. |
Cfs |
90. Coin flip: push 0 or 1. |
Dcsnn |
91. Roll an n-sided die and push the result. |
Tms |
92. Push the current Unix time. |
Dts |
93. Push the current date as YYYYMMDD. |
Sdn |
94. Seed the random number generator with n. |
Pcspp |
95. Push 1 with probability p%, otherwise 0. |
Wks |
96. Push the current weekday number (1–7). |
| Bitwise and conversion | |
Ans |
97. Pop two, push bitwise AND. |
Ors |
98. Pop two, push bitwise OR. |
Xrs |
99. Pop two, push bitwise XOR. |
Bns |
100. Convert the top to a binary string. |
Hxs |
101. Convert the top to a hexadecimal string. |
Mtsnamename |
102. Map the named function over every element of s. |
History
Sushi was created in 2026 by a user named Sushi as an unconventional language built around an infinite number of stacks.
Etymology
The language takes its name from its creator's username, which was itself chosen at random.