caffeine_lang

Caffeine Icon

Hex.pm CI License Gleam

The pure compiler core for the Caffeine DSL. It generates reliability SLOs (Terraform for Datadog) from service expectation definitions. The vendor abstraction (Vendor enum, Platform registry, multi-vendor compiler dispatch) is in place so additional vendors can be added by registering a new Platform and generator module.


Usage

As a Gleam dependency

# gleam.toml
[dependencies]
caffeine_lang = ">= 5.2.0 and < 6.0.0"
import caffeine_lang/compiler

let result = compiler.compile_from_strings(blueprints, expectations, output_path)

In the browser

import { compile_from_strings } from "./caffeine-browser.js";
const result = compile_from_strings(blueprintsJson, expectationsJson, "org/team/service.json");

Looking for the CLI or LSP?

The installable binary (CLI + Language Server) lives in the caffeine repo:

brew tap brickell-research/caffeine
brew install caffeine_lang

Development

gleam test                     # Run tests (Erlang target)
gleam test --target javascript # Run tests (JavaScript target)
make ci                        # lint + build + test (both targets)

Learn more

Search Document