⚠️ Work in progress
This website (and Lutra project as a whole) is a work in progress. It describes what I want Lutra to become, not what it is yet. The content might be outdated, incomplete or might contain typos.
See project status.
Lutra is a language for preserving type information between different software components. It is a high-level, statically typed language, designed for querying data and expressing data structures.
type Album: {id: int16, title: text}
func : [Album] -> std::sql::
func : Album -> (
|
)
It is minimal and designed to be extended to new execution targets. Currently, it can run on a reference-implementation interpreter and PostgreSQL.
import std::(filter, sort, slice)
# Load all the data at once
func -> {
user = ,
posts = (
|
|
|
),
}
It is verbose in exchange for type safety, readability and composability.
import std::(Date, find, filter, map, group, mean, sum, count, sort, slice)
# Constant
const transaction_fees: float64 = 0.8
# Type definition
type Invoice: {
customer_id: int32,
invoice_date: Date,
total: float64,
}
# Function that reads a table
func : [Invoice] -> (
std::sql::
)
type Customer: {
id: int32,
first_name: text,
last_name: text,
}
# Function that performs an index lookup
func : Customer -> (
std::sql::
|
| std::option::
)
func -> (
| .0 >= @1970-01-16.0)
|
|
|
|
|
|
|
|
)
Again, this all compiles to SQL and can be executed on PostgreSQL.
See more
Core concepts
How can Lutra be used? How does it interact with other tools?Try it out
Install CLI that can check, compile and run Lutra programs.Advent of SQL 2024
In December of 2025 I've been solving Advent of SQL 2024 in Lutra. See many examples there.Language test corpus
Test suite covers all that is possible with the Lutra language.Zulip Chat
If you want to get involved or just have feedback join the Zulip workspace I've created.
