⚠️ 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, average, 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::
)
func -> (
| .0 >= @1970-01-16.0)
|
|
|
|
|
|
|
|
)
Again, this all compiles to SQL and can be executed on PostgreSQL.
