Getting Started
This guide walks you through creating and running your first Lumen program.
Prerequisites
Make sure you have installed Lumen.
Create Your First Program
Create a file called hello.lm.md:
markdown
# My First Lumen Program
This is a simple hello world example.
```lumen
cell main() -> String
return "Hello, World!"
end
## Run It
```bash
lumen run hello.lm.mdOutput:
Hello, World!What Just Happened?
- Lumen extracted the code block from the markdown
- It compiled the
maincell - It executed the cell and printed the result
Adding Parameters
Let's make it more interesting:
lumen
cell greet(name: String) -> String
return "Hello, {name}!"
end
cell main() -> String
return greet("Lumen")
endOutput:
Hello, Lumen!Running a Specific Cell
By default, lumen run executes the main cell. You can specify a different cell:
bash
lumen run hello.lm.md --cell greetType Checking
Check your program without running it:
bash
lumen check hello.lm.mdThis validates types and catches errors early.
Using the REPL
For interactive experimentation:
bash
lumen repllumen> let x = 42
lumen> x * 2
84
lumen> :helpREPL commands:
:help— Show available commands:quit— Exit the REPL:load <file>— Load a file:type <expr>— Show the type of an expression
Next Steps
Now that you can run Lumen programs, continue with:
- Tutorial: Basics — Learn core syntax
- Tutorial: Control Flow — Conditionals and loops
- Language Reference — Complete specification