Your First Program
Write and run your very first Clean Language program in just three lines.
Variables and Types
Store values in variables and discover Clean's four basic types.
Working with Text
Use string interpolation and the most common string operations.
Making Decisions
Use if, else if, and else to run different code based on conditions.
Loops: Doing Things More Than Once
Use iterate and while loops to repeat code, and break or continue to control the flow.
Lists: Keeping Groups of Things
Create and work with lists of values — add, access, iterate, and check.
Writing Your Own Functions
Write reusable functions with parameters and return values.
Classes: Grouping Data and Behavior
Define classes with fields, constructors, and methods — then build on them with inheritance.
Handling Errors
Raise errors with error() and catch them gracefully with onError.
Your AI Coding Partner
Use the MCP server to get AI assistance that knows the exact Clean Language spec.
Your First Web Server
Create a server with endpoints that respond to HTTP requests. You'll have something running in under 5 minutes.
Returning HTML Pages
Serve complete HTML pages from your server. Use helper functions to keep your page structure consistent across every route.
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.
Reading from a Database
Connect to MySQL and query your data. Display database records in a web page using db.query and json.get.
Saving Data to a Database
Handle POST requests and save form data to your database. Build the write side of your web application.
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.
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.
Query Parameters and Search
Read URL query strings to filter results. Add search and filtering to any listing page without changing your routes.
JSON API Endpoints
Return JSON instead of HTML. Build API endpoints that mobile apps, frontend JavaScript, or other services can consume.
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.
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.
Functions in Depth
Write functions that call each other, return different types for different conditions, and build complex behavior from simple pieces.
List Operations
Everything you can do with a list — add items, access by index, check membership, iterate, and build new lists from existing ones.
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.
Designing Classes
Bundle data and behavior into a class. Write a constructor, define methods, and create multiple independent instances from the same template.
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.
Contracts with require
State function preconditions explicitly. require is documentation and enforcement in one line — the compiler and runtime guarantee the contract is honored.
Error Handling in Depth
Signal errors with error() and handle them at the call site with onError. Make error handling explicit, local, and readable.
Iteration Patterns
Master all iteration forms — range, step, list, while, break, and continue. Know which pattern fits each problem.
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.