Rata combines what I love about three languages:
- Modern,
tidyverseR just feels nice to code with. - Python is the go-to data engineering language for a reason, it sets a really high bar. I also enjoy some aspects of its syntax.
- Elixir is a language designed with such good taste, it constrain users in a paradoxically freeing way. There is a real joy in Elixir. The BEAM virtual machine is a natural fit to data engineering workloads because it allows one to easily write fault-tolerant, parallel code.
This is being vibe coded and takes a lot of inspiration from T.
module BirdCount {
# Get today's bird count (first element)
today = function(counts: [int]) {
if Vector.is_empty(counts) {
return nil
} else {
return Vector.first(counts)
}
}
# Increment today's count by 1
increment_day_count = function(counts: [int]) {
if Vector.is_empty(counts) {
return 1
} else {
today_count = Vector.first(counts)
rest_counts = Vector.rest(counts)
return Vector.prepend(rest_counts, today_count + 1)
}
}
# Check if any day had zero birds
has_day_without_birds = function(counts: [int]) {
Enum.some(counts, ~ .x == 0)
}
# Calculate total birds across all days
total = function(counts: [int]) {
Enum.sum(counts)
}
# Count busy days (5+ birds)
busy_days = function(counts: [int]) {
counts
|> Enum.keep(~ .x >= 5)
|> Vector.length()
}
}
module Math {
fibonacci = function(n: posint) {
if n <= 2 {
return 1
} else {
return fibonacci(n-1) + fibonacci(n-2)
}
}
# Generate first 10 fibonacci numbers
first_10_elements_fib_sequence = 1..10 |>
Enum.map(fibonacci)
}
Rata is still highly experimental and my side-project. Wanna talk about it? Hit me up on twitter X.
