Markdown-Native
Write code and documentation together in .lm.md files, or use raw .lm files when you want source-only modules. Both are first-class inputs.
Build deterministic agent workflows with static types, first-class AI primitives, and markdown-native source files.
# Install (One-liner)
curl -fsSL https://raw.githubusercontent.com/alliecatowo/lumen/main/scripts/install.sh | sh
# Or via Cargo
cargo install lumen-langSet up your editor with the VS Code extension.
# Create your first program
cat > hello.lm.md << 'EOF'
cell main() -> String
return "Hello, World!"
end
EOF
# Run it
lumen run hello.lm.mdBuilding AI systems today means juggling Python notebooks, API clients, prompt templates, and orchestration frameworks. Lumen unifies this into one language:
|> for readable data flow# Optional types with T? sugar
cell find_user(id: Int) -> User?
# ...
end
# Labeled loops with filters
for @outer item in items if item.active
for sub in item.children
if sub.done
break @outer
end
end
end
# Floor division, shifts, and bitwise ops
let page = offset // page_size
let flags = 1 << 3 | 1 << 5
# Destructuring let
let (x, y) = get_coordinates()
# Defer for cleanup
defer
close(handle)
end
# Type tests and casts
if value is String
let s = value as String
endHead to the Playground to run Lumen code directly in your browser -- no installation required.
use tool llm.chat as Chat
grant Chat
model "gpt-4o"
max_tokens 1024
temperature 0.7
bind effect llm to Chat
agent Assistant
cell respond(message: String) -> String / {llm}
role system: You are a helpful assistant.
role user: {message}
return Chat(prompt: message)
end
end
cell main() -> String / {llm}
let bot = Assistant()
return bot.respond("What is pattern matching?")
end