An ordered set of instructions. It reads input, follows rules, and produces output.
Workspace
Gleam
typed BEAM services friendly functional programming and reliable APIs
Definition first
What Gleam means
Gleam is a programming language for writing exact instructions, often used for typed BEAM services friendly functional programming and reliable APIs. Start with one mental model: input goes through steps and becomes output.
src/main.gleamRun gleam runHabit Use pattern matching and simple typed data before processesA value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
Gleam is the place that actually runs code from src/main.gleam.
First readable code
Program output
entry point output syntax io.printlnio.println("42")Output 42Language lineage
Gleam family tree
See where Gleam comes from, which languages feel close, and what to learn next.
Zero base path
Question bank
Search before practice
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
Gleam practice 1
Gleam question 1. Choose the statement that matches printing a value.
Gleam practice 2
Gleam question 2. Choose the statement that matches naming a value.
Gleam practice 3
Gleam question 3. Choose the statement that matches reusable function.
Gleam practice 4
Gleam question 4. Choose the statement that matches basic collection.
Gleam practice 5
Gleam question 5. Choose the statement that matches printing a value.
Gleam practice 6
Gleam question 6. Choose the statement that matches naming a value.
Gleam practice 7
Gleam question 7. Choose the statement that matches reusable function.
Gleam practice 8
Gleam question 8. Choose the statement that matches basic collection.
Gleam practice 9
Gleam question 9. Choose the statement that matches printing a value.
Gleam practice 10
Gleam question 10. Choose the statement that matches naming a value.
Gleam practice 11
Gleam question 11. Choose the statement that matches reusable function.
Gleam practice 12
Gleam question 12. Choose the statement that matches basic collection.
Gleam practice 13
Gleam question 13. Choose the statement that matches printing a value.
Gleam practice 14
Gleam question 14. Choose the statement that matches naming a value.
Gleam practice 15
Gleam question 15. Choose the statement that matches reusable function.
Gleam practice 16
Gleam question 16. Choose the statement that matches basic collection.
Gleam practice 17
Gleam question 17. Choose the statement that matches printing a value.
Gleam practice 18
Gleam question 18. Choose the statement that matches naming a value.
Multiple choice
Gleam practice 1
Gleam question 1. Choose the statement that matches printing a value.
io.println("42")Reference
Patterns for src/main.gleam
gleam runentry point output syntax io.println
Program output
io.println("42")- Run the smallest file first
- Print one known value
- Check the output before adding more code
variables assignment types let
Values and names
let total = 42 io.println(int.to_string(total))
- Give values readable names
- Keep one idea per line while learning
- Trace the value before changing it
function collection List
Functions and collections
fn add(a: Int, b: Int) -> Int {
a + b
}
let scores = [40, 2]
io.println(int.to_string(list.length(scores)))- Keep functions small
- Return useful values
- Use the common collection before reaching for frameworks