# caffeine_lang
<div align="center">
<img src="images/temp_caffeine_icon.png" alt="Caffeine Icon" width="250" height="250">
[](https://hex.pm/packages/caffeine_lang)
[](https://github.com/Brickell-Research/caffeine_lang/actions/workflows/test_caffeine.yml)
[](https://www.gnu.org/licenses/gpl-3.0)
[](https://gleam.run/)
The pure compiler core for the [Caffeine](https://caffeine-lang.run) DSL — generates reliability SLOs (Terraform for Datadog, Honeycomb, Dynatrace, NewRelic) from service expectation definitions.
</div>
***
## Usage
### As a Gleam dependency
```toml
# gleam.toml
[dependencies]
caffeine_lang = ">= 5.0.8 and < 6.0.0"
```
```gleam
import caffeine_lang/compiler
let result = compiler.compile_from_strings(blueprints, expectations, output_path)
```
### In the browser
```javascript
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`](https://github.com/Brickell-Research/caffeine) repo:
```bash
brew tap brickell-research/caffeine
brew install caffeine_lang
```
## Development
```bash
gleam test # Run tests (Erlang target)
gleam test --target javascript # Run tests (JavaScript target)
make ci # lint + build + test (both targets)
```
## Learn more
- [Website](https://caffeine-lang.run)
- [Hex package](https://hex.pm/packages/caffeine_lang)
- [CLI & LSP repo](https://github.com/Brickell-Research/caffeine)