Skip to content

derive macro typed issues #54

Closed
Closed

Description

@darinkishore

the derive macro for BAMLType currently takes a bunch of effort. proposing replacing it with something like Facet so we don't have to maintain as much code, we can control representation really granularly, and everything can impl everything for when RLMs come along and when we want custom rendering formatting to the models . (eg: #[render] for jinja) .

shit is fucked and does not scale when the codebase gets much more complex

Activity

  1. darinkishore commented on Feb 12, 2026

    @darinkishore
    CollaboratorAuthor

    Closing — this was done.

    #[BamlType] now derives facet::Facet via the attribute macro in bamltype-derive. The old schemars-based derive path is gone from the main typed pipeline. The macro handles:

    • #[baml(rename = "...")], #[baml(rename_all = "...")]
    • #[baml(skip)], #[baml(default)]
    • #[baml(check(...))], #[baml(assert(...))] constraints
    • #[baml(with = AdapterType)] for custom field adapters
    • #[baml(description = "...")] and doc-comment extraction
    • Serde compat attrs are normalized onto Facet

    Remaining schemars usage (the field! macro in lib.rs and specials.rs) is tracked by #52 and #73.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions