BEP — BAML Enhancement Proposals
BEPs are design proposals for evolving the BAML language and core tooling.
Below is an auto-generated index of all BEPs.
⚠️ Do not edit the table below by hand. Run the BEP update script instead (see instructions at the bottom).
| Status | Meaning |
|---|---|
| Work in progress, not ready for review | |
| Ready for review and discussion | |
| Approved for implementation | |
| Feature is live in BAML | |
| Decided against | |
| Replaced by another BEP |
| BEP |
|---|
| BEP-001: Exception Handling Shepherd(s): Vaibhav Gupta |
| BEP-002: match Shepherd(s): hellovai |
| BEP-005: Prompt Optimization - `baml-cli` supports a new command called `optimize` that writes and improves prompts for you, similar to [DSPy](https://dspy.ai/). - Prompt optimization attempts to maximize the number of passing BAML test cases, and optionally minimize tokens and latency. - The optimizer is based on the [GEPA algorithm](https://arxiv.org/abs/2507.19457), which is partially encoded as BAML functions that you can tweak. Shepherd(s): Greg Hale |
| BEP-006: compiler-errors Uniform user-facing experience for compiler errors. Shepherd(s): Greg Hale |
| BEP-007: Mid-level Intermediate Representation (MIR) This proposal introduces a Mid-level Intermediate Representation (MIR) between THIR and bytecode generation in the BAML compiler pipeline. MIR is a Control Flow Graph (CFG) based representation that simplifies the compilation of complex control flow constructs like `match` statements and error handling (`catch` expressions). By lowering high-level constructs into basic blocks connected by explicit jumps, MIR bridges the semantic gap between the tree-structured THIR and the linear bytecode, making codegen simpler, more maintainable, and easier to extend with new language features. Shepherd(s): Antonio Sarosi |
| BEP-008: Function and Lambda Syntax Design Shepherd(s): Language Design Team |
| BEP-009: Function and Lambda Syntax Design (TS-aligned) Shepherd(s): Language Design Team |
Management
Scripts are self-contained Python scripts using
uv. Ensureuvis installed.
Creating a new BEP
To create a new proposal:
This will:
1. Create a new directory beps/BEP-XXX-feature-name/
2. Create a README.md template inside it with the next available BEP ID.
Updating the Index
After modifying any BEP, update this README table:
Managing BEPs
To update a BEP's status or timestamp:
Touch (Update Timestamp):
Change Status:
(Valid statuses: Draft, Proposed, Accepted, Implemented, Rejected, Superseded)