{"id":35826071,"url":"https://github.com/7mind/baboon","last_synced_at":"2026-03-13T02:01:52.491Z","repository":{"id":184502484,"uuid":"667946249","full_name":"7mind/baboon","owner":"7mind","description":"Data modeling and versioning language with automatic evolution derivation","archived":false,"fork":false,"pushed_at":"2026-03-04T22:36:33.000Z","size":2811,"stargazers_count":24,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-05T00:11:00.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/7mind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"7mind","patreon":"7mind","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.buymeacoffee.com/7mind"]}},"created_at":"2023-07-18T16:53:05.000Z","updated_at":"2026-03-04T22:36:35.000Z","dependencies_parsed_at":"2023-08-18T07:34:52.641Z","dependency_job_id":"d1c7c2e4-97aa-4cc9-baef-95ebf0c9a14c","html_url":"https://github.com/7mind/baboon","commit_stats":null,"previous_names":["7mind/baboon"],"tags_count":184,"template":false,"template_full_name":null,"purl":"pkg:github/7mind/baboon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7mind%2Fbaboon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7mind%2Fbaboon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7mind%2Fbaboon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7mind%2Fbaboon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/7mind","download_url":"https://codeload.github.com/7mind/baboon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7mind%2Fbaboon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30450872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T21:31:01.033Z","status":"ssl_error","status_checked_at":"2026-03-12T21:30:43.161Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-07T20:18:30.302Z","updated_at":"2026-03-13T02:01:52.485Z","avatar_url":"https://github.com/7mind.png","language":"Scala","funding_links":["https://github.com/sponsors/7mind","https://patreon.com/7mind","https://www.buymeacoffee.com/7mind"],"categories":[],"sub_categories":[],"readme":"# baboon\n\n[![Build Status](https://github.com/7mind/baboon/actions/workflows/baboon-build.yml/badge.svg)](https://github.com/7mind/baboon/actions/workflows/baboon-build.yml)\n[![License](https://img.shields.io/github/license/7mind/baboon)](https://github.com/7mind/baboon/blob/main/LICENSE)\n[![Latest Release](https://img.shields.io/github/v/release/7mind/baboon)](https://github.com/7mind/baboon/releases/latest)\n[![IntelliJ Plugin](https://img.shields.io/badge/IntelliJ-Plugin-blue)](https://plugins.jetbrains.com/plugin/28203-baboon-support)\n[![VSCode Extension](https://img.shields.io/badge/VSCode-Extension-blue)](https://marketplace.visualstudio.com/items?itemName=SeptimalMind.baboon-vscode)\n[![Nix](https://img.shields.io/badge/Built%20with-Nix-5277C3.svg?logo=nixos\u0026logoColor=white)](https://builtwithnix.org)\n[![Nix Flake](https://img.shields.io/badge/Nix-Flake-blue.svg)](https://nixos.wiki/wiki/Flakes)\n[![Playground](https://img.shields.io/badge/Try-Playground-green)](https://7mind.github.io/baboon/)\n\n*Let the Baboon do the monkey job.*\n\nBaboon is a minimal Data Modeling Language and compiler that provides ergonomic, declarative schemas and enforces reliable schema evolution. The compiler runs as a fast immutable multi-phase DAG transform, and is easy to understand and maintain.\n\nEssentially, you define your data structures and Baboon generates implementations for you. Then you define new versions, Baboon generates new versions of the structures, the conversions from old structure versions to new ones and forces your to provide conversions which cannot be derived automatically. Also it comes with extremely efficient tagless binary encoding for all your structures.\n\nThe language is completely formal and platform/implementation-agnostic. Unlike e.g. OpenAPI, you can't leave some parts of a structure undefined; you still have an unsafe escape hatch in the form of foreign types.\n\nUse cases:\n  - Serializable application state with safe and automatic version upgrades\n  - Efficient data transfer with custom tagless binary format\n  - Quick data model design with an extremely concise and expressive language\n\nGenerates:\n  - **C#**\n  - **Scala**\n  - **Python**\n  - **Rust**\n  - **TypeScript**\n  - **Kotlin**\n  - **Java**\n  - **Dart**\n  - **Swift**\n\n## Highlights\n\n- Automatic codec derivation for [JSON](docs/json-codecs.md) and [UEBA](docs/ueba-format.md) (Ultra-Efficient Binary Aggregate, a custom tagless binary format)\n- Evolution-aware codegen: derives migrations when possible, emits stubs when manual work is required\n- Set-based structural inheritance with `+`, `-`, and `^` operators\n- Algebraic data types (`adt`), DTOs (`data`) and enums.\n- Basic form of nominal inheritance (`contract`)\n- Namespaces, includes, and imports\n- Collections (`opt`, `lst`, `set`, `map`) and timestamps/UID primitives\n- Deduplicated C# output (reuses as much code as possible to lower binary footprint)\n- Interactive Explorer: REPL-style shell for browsing types, evolution, and debugging codecs.\n- LSP support\n\n# TLDR\n\nYou define your data model:\n\n```\nmodel acme.billing\nversion \"1.0.0\"\n\nroot adt PaymentMethod {\n  data Card {\n    pan: str\n    holder: str\n  }\n  data Wallet {\n    provider: str\n    token: str\n  }\n}\n```\n\nThen you refactor and extend it:\n\n```\nmodel acme.billing\nversion \"2.0.0\"\n\ndata Token {\n  token: str\n}\n\nroot adt PaymentMethod {\n  data Card {\n    pan: str\n    holder: str\n  }\n  // refactored, but same structure as before\n  data Wallet {\n    provider: str\n    + Token\n  }\n\n  // new ADT member\n  data BankTransfer { iban: str }\n}\n```\n\nBaboon generates conversions (migrations) from version `1.0.0` to `2.0.0`. In this particular case all the migrations will be generated automatically.\n\nDetailed language walkthrough with copy-paste examples: [docs/language-features.md](docs/language-features.md).\n\n## Editor support\n\n- [Intellij Idea Plugin](https://plugins.jetbrains.com/plugin/28203-baboon-support) (source: [baboon-intellij](https://github.com/7mind/baboon-intellij))\n- [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=SeptimalMind.baboon-vscode) (source: [baboon-vscode](https://github.com/7mind/baboon-vscode))\n- [VSCodium Extension](https://open-vsx.org/extension/SeptimalMind/baboon-vscode)\n- **LSP Server**: Baboon includes a built-in Language Server Protocol (LSP) implementation for integration with any LSP-compatible editor (Neovim, Emacs, etc.). See [docs/lsp-integration.md](docs/lsp-integration.md) for details.\n\n## Interactive Explorer\n\nBaboon includes an interactive explorer for browsing and debugging domain models. It provides a REPL-style shell to explore types, dependencies, evolution history, and test codecs.\n\n```bash\nbaboon --model-dir ./src/models :explore\n```\n\nSee [docs/explorer-mode.md](docs/explorer-mode.md) for a full command reference.\n\n## Limitations\n\n1. No templates\n2. Only Enums, DTOs and ADTs\n3. Nominal inheritance support is limited to trait model\n4. Generic/type constructor support is limited to builtin collections\n5. (*) This is a DML, not an IDL, service/interface definitions support is extremely limited at the moment\n7. (*) Comments are not preserved in the transpiler output\n8. (*) No structural inheritance information is preserved in the transpiler output\n9. (*) Only integer constants may be associated with enum members\n10. (*) No newtypes/type aliases\n11. (*) No inheritance-based lenses/projections/conversions\n\nPoints marked with (*) will/may be improved in the future.\n\n## CLI\n\nThe `baboon` CLI supports multiple commands for compilation, exploration, and IDE integration:\n\n- `:cs`, `:scala`, `:python`, `:rust`, `:typescript`, `:kotlin`, `:java`, `:dart`, `:swift` - Code generation for target languages\n- `:explore` - Launch [Interactive Explorer](docs/explorer-mode.md)\n- `:lsp` - Start [LSP Server](docs/lsp-integration.md)\n\nSee build configuration in [.mdl/defs/actions.md](.mdl/defs/actions.md) and test configuration in [.mdl/defs/tests.md](.mdl/defs/tests.md).\n\n## Notes\n\n1. All the types which are not transitively referenced by `root` types will be eliminated from the compiler output.\n2. Usages in structural inheritance are not considered references, so structural parents which are not directly referenced as fields and not marked as `root`s will be eliminated\n\n## Foreign types\n\nBe careful about foreign types. It is your responsibility to wire codecs correctly.\n\nFor every foreign type:\n\n1) Create a custom codec\n2) Override the generated dummy codec with `BaboonCodecs#Register`\n3) Override the generated dummy codec using the setter on `${Foreign_Type_Name}_UEBACodec#Instance`\n4) Override the generated dummy codec using the setter on `${Foreign_Type_Name}_JsonCodec#Instance`\n\nMake sure your foreign types are NOT primitive types or other generated types. It's a funny idea, but it will explode in runtime.\n\nForeign types may hold any position in generics but it's up to you to ensure correctness.\n\n## Development\n\n### Build commands\n\nThis project uses [mudyla](https://github.com/7mind/mudyla) for build orchestration.\n\n#### Common Commands\n\n```bash\n# Format code\ndirenv exec . mdl :fmt\n\n# Build the compiler\ndirenv exec . mdl :build\n\n# Run complete test suite\ndirenv exec . mdl :build :test\n\n# Run full build pipeline (format, build, test)\ndirenv exec . mdl :full-build\n\n# Run specific test suites\ndirenv exec . mdl :build :test-gen-regular-adt :test-cs-regular :test-scala-regular :test-rust-regular :test-typescript-regular :test-kotlin-regular :test-java-regular :test-dart-regular :test-swift-regular\ndirenv exec . mdl :build :test-gen-wrapped-adt :test-cs-wrapped :test-scala-wrapped :test-rust-wrapped :test-typescript-wrapped :test-kotlin-wrapped :test-java-wrapped :test-dart-wrapped :test-swift-wrapped\ndirenv exec . mdl :build :test-gen-manual :test-gen-compat-scala :test-gen-compat-cs :test-gen-compat-rust :test-gen-compat-typescript :test-gen-compat-kotlin :test-gen-compat-java :test-gen-compat-dart :test-gen-compat-swift :test-manual-cs :test-manual-scala :test-manual-rust :test-manual-typescript :test-manual-kotlin :test-manual-java :test-manual-dart :test-manual-swift\n\n# Create distribution packages\ndirenv exec . mdl :build :mkdist\n\n# Build with custom distribution paths\ndirenv exec . mdl --mkdist-source=./custom/path --mkdist-target=./output :build :mkdist\n```\n\n#### Setting up the environment\n\n```bash\n# Enter the nix development shell\nnix develop\n\n# Or use direnv for automatic shell activation\ndirenv allow\n```\n\n#### Quick testing\n\n```bash\nsbt baboonJVM/GraalVMNativeImage/packageBin\n./baboon --help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7mind%2Fbaboon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F7mind%2Fbaboon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7mind%2Fbaboon/lists"}