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.
Leetlang
Leetlang is a joke functional golfing-adjacent language where the only operations (hereby referred to as functions) directly correspond to Leetcode problems.
Values
Leetlang is a dynamically typed language where the type of a value is entirely dependent on the function calling it. There are basically two kinds of values in this language: iterables and non-iterables. Values are separated from other values by spaces.
Non-iterables include what are generally ints, floats, or chars in other languages. Ints are written as big-endian series of digits with optional underscores that make it easier to visually read them (like how you write them in Java or Python). Floats are written like that, but there is a decimal point which needs to have a digit on either side (again, Java or Python). You can also write "f" at the end of a float. Chars have an apostrophe on either side and consist of a single Unicode character.
Chars directly correspond to integers, while floats are analyzed as the integer you get when you only take the part before the decimal point. Therefore, if you need the number 65, you can write it in any of the following (comma-separated) ways: 65, 6_5, 65.0, 'A'
If you know it will be analyzed as an int or char, you can even write it as: 65.1, 6_5.5, 65.9
Iterables can be iterated over. This can include strings, lists, linked lists, or trees. Strings are within quotation marks, with special characters generally being marked by a backslash (\) which includes \n for newline, \t for tab, and \" for regular quotation mark.
"This is one string.""This is \n\n also one string.""This is \"\" also one string.""This will throw "" an error because of the double quotation marks.""These three strings will not throw " " an error because there is a space between them" "so we know they are separate."
All other iterables are written as being in between brackets ([ and ]) with the indexed values being separated by spaces with optional commas.
For every N-dimensional iterable, where N is a positive integer, an N-1 dimensional iterable is analyzed as an N-dimensional iterable with only one value in the Nth dimension. The idea is that [A B] and [[A] [B]] and [[[A]] [[B]]] are the same.
Non-iterables can be treated as 0-dimensional iterables, but not necessarily vice-versa. However, if the iterable only has one actual character in it, like "1" or [1], that can be analyzed as a non-iterable.
Strings have the unusual quality of being analyzed as either corresponding to their int or char value depending on what the function expects. Otherwise, the iterable will act like a non-iterable version of whatever its value is.
All of the following are valid iterables which can be analyzed as the same thing when passed into a function expecting a 1-dimensional array of ints.
- [65, 66]
- [65 66]
- [65.0 66.0]
- ['A' 'B']
- ["1" "2"]
- [[65] [66]]
- [["1"] ["2"]]
Unlike many programming languages, Leetlang does not have support for variables because there isn't a Leetcode problem which assigns a value to a variable.
Functions
Functions are written as numbers with l\ in front of them. For example, l\1 is Two Sum and l\1000 is Minimum Cost to Merge Stones. All proper Leetlang interpreters should be able to solve the Leetcode problem using their implementation of the corresponding function.
Computational Class
This language might be Turing-complete, but it's not immediately obvious to me how that could be.
Examples
Create 32-bit Integer
l\8 "1000"
You put the string you want to turn into an integer after l\8, which is String to Integer (atoi). Here, the example number "1000" is used. You would replace 1000 with your string.
Technically, something like l\8 ["1" "0" "0" "0"] would also work.