Little is a programming language designed around portability, flexibility and ease of use. Its keywords can be customized, including for other languages.
Open the playground and type code into the Code field. Output updates as you type. The keyword table lets you try different names for keywords and built-in types.
define x = 3
x = x + 3
print(x)
This prints 6. Use define to declare a variable and print to write output.
action getNumber() = {
return 5
}
print(getNumber())
Use action to declare a function and return to return its result.
define i = 0
while (i <= 10) {
print(i)
i = i + 2
}
as specifies a type, nothing is the null value, and true and false are boolean values. Built-in type names in this playground include Number, Decimal, Boolean, and Characters.
These examples are adapted from the Little project's README and the bundled playground. See the project for more examples and current development.
The playground is the version bundled with the original website; newer language features may differ.