Tutorials — Learn Clean Language Step by Step
Learn Clean Language

Tutorials

Learn Clean Language step by step — from your first program to building real applications. Every tutorial is short, friendly, and gets you to working code fast.

Build a Web App
11
beginner5 min

Your First Web Server

Create a server with endpoints that respond to HTTP requests. You'll have something running in under 5 minutes.

frame.serverendpoints server:http.respond
12
beginner6 min

Returning HTML Pages

Serve complete HTML pages from your server. Use helper functions to keep your page structure consistent across every route.

html: blockfunctions:raw interpolationpage structure
13
beginner5 min

Route Parameters

Read values from the URL path and use them to serve dynamic content. One endpoint handles /users/alice, /users/bob, and every name in between.

req.param:param syntaxdynamic routes
14
beginner8 min

Reading from a Database

Connect to MySQL and query your data. Display database records in a web page using db.query and json.get.

frame.datadb.queryjson.getSQL params
15
intermediate8 min

Saving Data to a Database

Handle POST requests and save form data to your database. Build the write side of your web application.

POST endpointsreq.bodyINSERTvalidation
16
intermediate5 min

Building Reusable Components

Create functions that return HTML — Clean Language's component model. Write a card, a button, or a nav bar once and use it everywhere.

functions:html: blockreusable componentsraw interpolation
17
intermediate8 min

Listing Records from a Database

Fetch multiple rows and render them as a list. This pattern powers every feed, search result, and dashboard in your app.

COUNT queryiteratejson.get with indexlisting pattern
18
intermediate6 min

Query Parameters and Search

Read URL query strings to filter results. Add search and filtering to any listing page without changing your routes.

req.queryfilteringconditional SQLsearch
19
intermediate6 min

JSON API Endpoints

Return JSON instead of HTML. Build API endpoints that mobile apps, frontend JavaScript, or other services can consume.

application/jsonAPI designerror responseshealth check
20
intermediate10 min

Putting It All Together

Build a complete bookmarks app — add URLs, list them, view them. Every pattern from this track working together in one real project.

full-stack appCRUDcomponentsmultiple routes
Language in Depth
21
beginner5 min

Types and Conversions

Understand Clean Language's four core types and how to convert between them. The type system catches mistakes before they reach production.

stringintegernumberbooleantype conversion
22
intermediate7 min

Functions in Depth

Write functions that call each other, return different types for different conditions, and build complex behavior from simple pieces.

return typesfunction compositiontyped parametersboolean functions
23
intermediate6 min

List Operations

Everything you can do with a list — add items, access by index, check membership, iterate, and build new lists from existing ones.

list.add()index access.contains().length()iterate
24
intermediate6 min

The String Toolkit

A practical guide to Clean Language's string methods — the ones that appear in real programs, with examples that show when to reach for each one.

.trim().toUpperCase().contains().replace().split().slice()
25
intermediate7 min

Designing Classes

Bundle data and behavior into a class. Write a constructor, define methods, and create multiple independent instances from the same template.

classconstructorpropertiesmethodsinstances
26
intermediate7 min

Class Inheritance

Extend a class with is and call the parent constructor with base(). Reuse behavior from a parent and add or override what the child needs.

isbase()inheritancemethod overrideparent class
27
intermediate5 min

Contracts with require

State function preconditions explicitly. require is documentation and enforcement in one line — the compiler and runtime guarantee the contract is honored.

requirepreconditionscontractsdefensive programming
28
intermediate7 min

Error Handling in Depth

Signal errors with error() and handle them at the call site with onError. Make error handling explicit, local, and readable.

error()onErrorerror propagationdefensive programming
29
intermediate7 min

Iteration Patterns

Master all iteration forms — range, step, list, while, break, and continue. Know which pattern fits each problem.

iteratewhilebreakcontinuestepaccumulation
30
intermediate10 min

Language in Practice

Put it all together: build a word-frequency counter using classes, functions, lists, strings, and iteration. See how the pieces connect in a complete program.

program designfunctionsclasseslistsstringsiteration
Copied!