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.

Dango

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.
🍡Dango
Designed by User:RaiseAfloppaFan3925
Appeared in 2025
Memory system Stack-based, Hash table-based (Dango V2)
Computational class
Reference implementation
Influenced by C++ (function syntax), OCaml (comments, Dango V2)
File extension(s) .dango, .🍡

Dango is an esolang by User:RaiseAfloppaFan3925 based on dango, a Japanese rice-based dumpling. There are two iterations (dango-deprecated and Dango V2), with a third one being planned.

Dango V1

This section is a stub.
🍡Dango
Designed by User:RaiseAfloppaFan3925
Appeared in 2025
Memory system Stack-based, slightly array-based
Computational class somewhere between a Push-down automaton and a Linear bounded automaton (unproven)
Reference implementation dango-deprecated
Influenced by Lisp (native function naming convention)
File extension(s) .dango, .🍡

Dango V1 (just Dango) was the first version of the Dango esoteric programming language, written in Rust. It was initially just a stack-based language with the syntactic element being dango, a Japanese rice-based dumpling — specifically hanami dango.

Syntax

The syntax of Dango V1 was pretty much the same as Dango V2 with some minor differences.

Dango V1 did not have comments, so the remove (your comment here)---- pattern was used instead.

Values

Dango V1 had seven types of values: nil, 64-bit signed wrapping integers, 64-bit IEEE 754 doubles, "raw" text, strings, dango, and native functions.

Nil was represented in code and in printing with (), as it is a dumpling with nothing inside.

"Raw" text was just text inside a dumpling, for example (blast from the past). When printed, it would print with the parentheses, which is why the (') was needed for printing text.

Dango (as in the datatype, not the language or food) were an array that could contain one to five elements. It was printed very unusually.[stub]

Native functions were just any string preceded by a colon, for example (:123456 help me kebab-case). They were searched in a global symbol table then invoked, which allowed Dango V1 to have some use in embedding.

Operations

Dumpling operations
Operator Arguments Action
(') Any Stringifies the top of the stack.
('c) Integer Uses the stack top as a Unicode codepoint to make a string, like chr() in Python.
(j) Integer Uses the stack top as a line number to jump to.
(`) Integer | Float | String Converts the value into an integer. If the conversion failed, returns () instead.
(;) Integer | Float | String Convers the value into a float. If the conversion failed, returns () instead.
(len) Dango Pushes the length of the dango.
Anything else Pushes zero.

eat and remove below can either take the top of the stack (implicit), or as they are shown in the examples in the table below, have an explicit argument that they take.

Keyword operations
Operation Example Action
eat eat (')(Hello, world!)----, eat Pops the top of the stack and prints it.
fetch fetch 2 Copies the value N slots down from the top of the stack and moves the copy to the top.
remove remove If the top of the stack is a dango, then it removes the value at the end and pushes it to the stack.

Example:

skewer 2 (1)(2)----
eat remove
eat remove

Stack (line 1):

top
(1)(2)----    (Dango)
bottom

Stack (line 2, before eat):

top
1             (Int)
(2)----       (Dango)
bottom

Stack (line 3, before eat):

top
2             (Int)
bottom
skewer <N> skewer 2 (1)(2)---- Pops the top N values off of the stack and stores them in a dango that is pushed onto the stack, with the stack top being stored to the left and the value at top_pos - N being stored to the right.

Example:

eat skewer 3 (1)(2)(3)----

Output:

(1)(2)(3)----

If the amount of values requested to be skewered is greater than 5, then an error occurs. Example:

eat skewer 6 (1)(2)(3)---- skewer 2 (4)(4)---- (5)(6)----

Output:

error: skewer is too short for 6 dumplings

If the amount of values requested to be skewered is zero, then an error occurs. Example:

skewer 0

Output:

error: cannot have dango with zero dumplings, that's just a stick

Standard library

Dango V1 had a standard library.

The format here is function-signature-description.

I/O

  • :io-input

    This function was the only way to get input from the user in Dango V1.

    • 0

      Receives input from the user normally.

    • 1, a string

      Receives input from the user normally, but with a string prompt.

  • :env-args

    Returns the argument vector passed to Dango, stored in a dango.

Chrono

  • :chrono-now

    Returns the amount of time in seconds (with milliseconds in the decimal places) since the Unix epoch.

  • :chrono-sleep

    int or float

    Sleeps for the given amount of seconds.

Math

  • :math-cos

    int or float

    Returns the cosine of a number.

  • :math-e

    Returns the value of Euler's number , approximately equal to 2.71828.

  • :math-pi

    int or float

    Returns the value of , approximately 3.14159.

  • :math-sin

    int or float

    Returns the sine of a number.

  • :math-sqrt

    int or float

    Returns the square root of a number. Errors on negative number inputs.

  • :math-sqrt2

    Returns the value of , approximately 1.41421.

  • :math-tan

    int or float

    Returns the tangent of a number.

Computational class

Dango V1's computational class was never found, however it is theorized to be somewhere between a push-down automaton and a linear bounded automaton as it can fetch any element from the stack no matter where it is, however it is still bound to the stack.

Examples

"Hello, world!" program

eat (')(Hello, world!)----

Cat program

eat (:io-input)(0)----

Truth-machine

(j)(5)(while)(=)(')(0)(:io-input)(0)----
eat (1)----
(j)(3)----
eat (0)----

Another truth-machine, which for some reason was listed separately before this one in the last version of this page before Dango V2.

(j)(3)---- eat (0)(while)(=)(0)(:io-input)(0)----
(j)(2)---- eat (1)----

Fibonacci number (iterative)

(`)(1)---- remove (Our fibonacci number)----
fetch 0 fetch 0
remove (Fib[n], iterative fibonacci by the way)----
    (j)(9)(while)(!=)(0)---- fetch 0 remove (if n == 0 -> 0)----
    (j)(46)(0)----
    (j)(9)(while)(!=)(1)---- fetch 0 remove (if n == 1 -> 1)----
    (j)(46)(1)----

    fetch 0 remove (let n = n)----
    (0)---- remove (let x = 0)----
    (1)---- remove (let y = 1)----
    (1)---- remove (let i = 0)----
    remove (while i < y)----
        remove (top i y x n bottom )----

        fetch 2 remove (x)----
        remove (top x i y x n bottom )----

        fetch 2 remove (y)----
        remove (top y x i y x n bottom )----

        (+)---- remove (let z = x + y)----
        remove (top z i y x n bottom )----

        fetch 4 remove (n = n)----
        remove (top n z i y x n bottom )----

        fetch 3 remove (x = y)----
        remove (top x n z i y x n bottom )----

        fetch 2 remove (y = z)----
        remove (top y x n z i y x n bottom )----

        fetch 4
        (+)(1)---- remove (i = i + 1)----
        remove (top i y x n z i y x n bottom )----

        fetch 0 remove (get i)----
        remove (top i i y x n z i y x n bottom )----

        fetch 4 remove (get n)----
        remove (top n i i y x n z i y x n bottom )----

        (j)(13)(while)(<)----
    remove (end while)----
remove (end)----
eat (')(F()----
eat
eat ('c)(41)----
eat (')( = )----
eat
eat ('c)(10)----

User-friendly Fibonacci function

By User:RaiseAfloppaFan3925.

(j)(11)(while)(=)(')(exit)---- fetch 0 fetch 0 (:io-input)(1)---- eat (')(Input a number: )----
(j)(1)---- eat eat eat eat (')('exit' to exit)('c)(10)(')('help' to see this)('c)(10)---- (while)(=)(')(help)----
(j)(1)---- eat eat (')(Invalid number. Try again.)('c)(10)---- (while)(=)()---- fetch 0 (`)
(j)(1)---- eat eat (')(Cannot get a negative Fibonacci number. Try again.)('c)(10)(while)(<)(0)---- fetch 0
(j)(1)---- eat eat (')(Resulting value would be too large. Try again.)('c)(10)(while)(>)(92)---- fetch 0
(j)(10)(0)(while)(=)(0)---- fetch 0
(j)(10)(1)(while)(=)(1)---- fetch 0
(1)(1)(0)---- fetch 0
(j)(9)(while)(<)---- fetch 4 fetch 0 (+)(1)---- fetch 4 fetch 2 fetch 3 fetch 4 (+)---- fetch 2 fetch 2
(j)(1)---- eat ('c)(10)---- eat eat eat ('c)(41)(')( = )---- eat eat (')(F()----

User-friendly sleep program

By User:RaiseAfloppaFan3925.

fetch 0 fetch 0 (:io-input)(1)(+)(')( )(+)('c)(58)(+)('c)(41)(')(Sleep for (seconds)----
(j)(12)(while)(=)(')(exit)----
(j)(1)---- eat eat eat eat eat eat (')('exit' to exit)('c)(10)(')('help' to show this)('c)(10)(')(this program takes in a number as input and sleeps for that amount of time)('c)(10)---- (while)(=)(')(help)----
(j)(1)---- remove remove eat eat (')(Invalid duration. Try again.)('c)(10)---- (while)(+)(<)(0)---- fetch 1 (=)()---- fetch 0 fetch 0 (;)----
(-)(:chrono-now)---- remove (:chrono-sleep)---- fetch 1 (:chrono-now)----
(-)---- fetch 1 (0)----
fetch 0
(-)---- fetch 3 eat (')( seconds (error of )---- eat fetch 0 eat (')(Slept for )----
eat eat ('c)(41)('c)(10)---- eat
remove remove remove remove
(j)(1)----

Dango V2

🍡Dango V2
Designed by User:RaiseAfloppaFan3925
Appeared in 2026
Memory system Stack-based, Hash table-based
Computational class possibly Turing complete (unproven)
Reference implementation Dango V2
Influenced by C++ (function syntax), OCaml (comments)
File extension(s) .dango, .🍡

Dango V2 (just Dango) is the second iteration of Dango, released in early 2026.

Syntax

Dango's syntax is based on dango, so most instructions (other than three) are placed in dumplings that must have trailing sticks made of four minus signs. (----)

Comments can be done with [* comment *], and they can be nested.

Labels can be defined with an identifier prefixed with a @. When referred to in a GOTO instruction, the string must also have the at sign.

Values

Dango has six types of values: 64-bit integers that wrap around on overflow, 64-bit IEEE 754 doubles, strings, string-value tables, lambdas, and native functions.

Functions

Dango functions (which are anonymous) can be declared using a syntax based on C++'s lambda syntax.

[] {
    [* body goes here... *]
}

Operations

Dango operations operate on the stack.

Name Dumpling Operation
Addition (+) Pops the two top values off of the stack and adds them. If both values are strings, then they are concatenated. If the top is a table and the value below that is a string, then the value below the string is inserted into the table with the key being the string.
Division / Pops two values from the stack and divides them.
Equal (=) Pops two values from the stack and checks if they are equal.
Getattr ($) If the top of the stack is a string, then it retrieves the corresponding global variable. If it is a table, then the value below it (which must be a string) is used as a key to get a value from the table.
Goto (@) The operand must be a string. The operand is treated as a label and execution jumps to the label with the same text, and it is discarded. If the operand is not a string or is a nonexistent label, an error is thrown. It is undefined behavior to use (@) Goto inside of a dango that is used as a parameter for a serve or eat statement. (@label)(@)---- eat. is valid, but eat (@label)(@)---- is not.
Multiplication (*) Pops two values from the stack and multiplies them.
Multitool (#) What this does depends on the type of the stack top. If the top of the stack is a function, then it calls it. If it is a string, then it converts the first character into an integer with its Unicode codepoint. If it is an integer, then it converts it into a string with one character, being the Unicode character with that codepoint. If it is a table, then it gives the number of entries in the table. In all cases, the operand is discarded.
Select (?) If the top of the stack is truthy, it pops two values from the stack. Otherwise, it pops once, preserves the second value, and removes the value below that.
Stringify (') Converts the top of the stack into a string
Subtraction (-) Pops two values from the stack and subtracts them.

Along with the dumpling operations, Dango also has keyword operations (for a lack of a better word).

consume

consume takes one line of input from the user and pushes it as a string, without the newline.

eat

eat generally discards the arguments given to it. However, it has two types.

When given a dango like in the example eat (some)(operations)(here)----, it will discard all of the values produced by that dango. Even if the dango produces a dynamic amount of values, they will all be discarded.

When given no dango or if a dot character is placed in front of it (like in eat. (This will not be discarded)----, it will only discard the top of the stack.

serve

serve has the same behavior and same cases as eat, except instead of just discarding the values it also prints them.

serve (1)(2)(3)----

The above will print 321 since it starts printing from the top of the stack, and 3 was the last value pushed putting it at the top of the stack.

Standard library

The standard library now lives inside a table in a global variable named libstd.

Chrono

Currently, libstd.chrono only has one function, sleep. It takes in a number and sleeps for that many seconds.

Env

libstd.env only has one member, args. This contains the argument vector passed to the Dango process. It is a table with the indices being stringified numbers starting from zero.

Math

The math library libstd.math has only five functions, sin, sqrt, deg2rad, rad2deg, and hypot. However, it supports many math constants such as pi, tau, Euler's number, Euler's constant, the lemniscate constant, and the golden ratio.

Examples

Hello world program

serve (Hello, world!)----

Truth machine

consume (@0)(@1)(2)(\)(0)(')(=)(?)(@)----
@1
    serve (0)(\)----
    (@1)(@)----
@0
    serve

Cat program

consume serve

Dango V3

🍡Dango V3 (placeholder)
Designed by User:RaiseAfloppaFan3925
Appeared in possibly 2026
Memory system Stack-based, random-access (poke memory wherever)
Computational class Unknown
Reference implementation Unimplemented
Influenced by Dango V2, C++, OCaml, C, Go, Forth (kinda), Ada, Rust
File extension(s) .dango, .🍡

Dango V3 (no official name yet, so this is a placeholder) does not exist yet, although it will be a compiled programming language. Many features of Dango V2 will be dropped in favor of making the language usable in a freestanding environment (say, an operating system kernel) while still retaining the stack semantics and dango theme.