Commit d3226f6
Add foundational BAML language compiler infrastructure (#2684)
Set up the core compiler pipeline with lexer, parser, HIR, THIR, and
codegen stages, organized as a Rust workspace with modular crates for
each compilation phase. Includes comprehensive test infrastructure with
snapshot testing and benchmarks for compiler performance.
RUN_CODSPEED=1
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces a modular Rust workspace for the BAML compiler
(lexer→parser→HIR→THIR→codegen) with diagnostics, auto-generated
snapshot tests and CodSpeed benchmarks, and comprehensive CI plus dev
hooks.
>
> - **BAML Language Workspace**:
> - Add Rust workspace `baml_language` with crates: `baml_base`,
`baml_lexer`, `baml_parser`, `baml_syntax`, `baml_hir`, `baml_thir`,
`baml_codegen`, `baml_workspace`, `baml_diagnostics`, `baml_db`.
> - Implement lossless lexer (Logos), stub parser (Rowan), syntax
kinds/nodes, HIR/THIR data structures and helpers, diagnostics rendering
(Ariadne), and bytecode model stubs.
> - **Tests & Benchmarks**:
> - New `baml_tests` crate with build script to auto-generate snapshot
tests from `projects/` and instrumented benchmarks from `benches/`
(incremental and scale scenarios).
> - Add snapshots, benchmark datasets, and bench harness
(CodSpeed-compatible).
> - **CI/CD**:
> - Add `.github/workflows/ci.yaml` running fmt, clippy, tests
(Linux/macOS/Windows), WASM build, MSRV check, cargo-deny, snapshot
tests, and CodSpeed benchmarks (opt-in via flags/paths).
> - **Dev Tooling**:
> - Add git pre-commit hook setup (`scripts/setup-hooks.sh`) and docs;
workspace `rustfmt.toml`, `rust-toolchain.toml`, `deny.toml`; update
`.gitignore`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3491f84. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude <[email protected]>1 parent 38cfe9b commit d3226f6
File tree
87 files changed
+6080
-1
lines changed- .github/workflows
- baml_language
- crates
- baml_base
- src
- baml_codegen
- src
- baml_db
- src
- baml_diagnostics
- src
- baml_hir
- src
- baml_lexer
- src
- baml_parser
- src
- baml_syntax
- src
- baml_tests
- benches
- incremental
- add_user_field
- after
- before
- rename_type
- after
- before
- scale
- projects
- basic_types
- error_cases
- simple_function
- snapshots
- src
- baml_thir
- src
- baml_workspace
- src
- docs
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
87 files changed
+6080
-1
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
| |||
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
| 177 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments