Current version · v0.2.0

Zero Ceremony REST APIs.

A focused DSL (domain-specific language) for building REST APIs. No imports, no framework setup, no connection boilerplate. The route reads like the behavior it describes.

Install the CLI
$ curl -fsSL https://raw.githubusercontent.com/tm-dev-lab/marreta-lang/main/install.sh | sh
Linux, macOS & WSL · Installation guide
A first look

No imports, no dependencies, providers built in

Reference a type anywhere without importing it, and reach databases, caches, and queues through native namespaces. There are no packages to add and no connection code to write.

schemas/accounts.marretaschema
export schema NewAccount
    owner: string
routes/accounts.marretaroute
route POST "/accounts" take payload as NewAccount
    account = doc.accounts.save({ owner: payload.owner, balance: 0 })
    reply 201, account

route GET "/accounts/:id"
    account = doc.accounts.find(params.id)
    require account else fail 404, "account not found"
    reply 200, account
Professor Martim
Professor Martim can walk you through this, step by step

Routes, schemas, validation, and providers are built into the language.

Why Marreta

A sledgehammer that breaks through boilerplate

marreta /ma·ˈʁe·ta/ · noun

Brazilian Portuguese for sledgehammer, the heavy tool that breaks through whatever is in the way.

The name stays in Portuguese on purpose: it keeps the project's Brazilian origin instead of hiding it behind a generic English brand. And the metaphor is the whole point. A focused tool that breaks through boilerplate to reach the code that actually describes your API.

The three hypotheses

Marreta Lang began as a research project at TM Dev Lab, set out to prove three hypotheses at once, all validated in experiments.

01

Low resource usage

Efficient consumption, especially in containerized environments, with a predictable footprint that stays small under load.

02

Strong performance

The HTTP hot path is validated by experiments and shaped by profiling, not guesswork. Strong performance for real services.

03

Good developer experience

SQL, NoSQL, messaging, cache, HTTP and OpenAPI without redoing the same infrastructure boilerplate, with zero project dependencies.

A taste of the language

Parallel work, without the wiring

Running things in parallel usually means threads or callbacks. Here it is the broadcast operator, *>>: it fans a value out to several branches at once, and gathers their results in order.

tasks/users.marretatasks
export task load_profile(id) => http_client.get("https://api/users/#{id}")
export task load_orders(id) => http_client.get("https://api/orders/#{id}")
routes/users.marretaroute
route GET "/users/:id"
    data = params.id *>>
        -> users.load_profile
        -> users.load_orders

    reply 200, { profile: data[0], orders: data[1] }
Professor Martim
Professor Martim can walk you through this, step by step

The route reaches the tasks with no import, and the branches run at the same time.

Providers

Infrastructure as namespaces

Pick a provider, set the host and credentials in marreta.env, and use it. No imports.

CapabilityNamespaceBackend
Relational database db.* PostgreSQL
Document database doc.* MongoDB
Cache cache.* Redis
Queues & topics queue / topic RabbitMQ
Ready to break through boilerplate?

From business intent to a running endpoint, fast.

Martim holding a trophy