←back to thread

169 points constantinum | 1 comments | | HN request time: 0.235s | source
Show context
mg ◴[] No.40714992[source]
The baml config files look a lot like code. For example in baml:

    class Resume {
        name string
        education Education[] @description("Extract in the same order listed")
        skills string[] @description("Only include programming languages")
    }
Could be expressed in Python like this:

    class Resume:
        name: str
        education: List[Education] # Extract in the same order listed
        skills: List[str] # Only include programming languages
Two benefits I see are that it would make the file leaner (because Python is nicely lean) and provide free parsing and syntax highlighting.

Is there a benefit of rolling your own DSL?

replies(3): >>40715066 #>>40715071 #>>40715322 #
1. mejutoco ◴[] No.40715322[source]
Using Pydantic also looks very close to the DSL (trivial to translate mechanically)

https://docs.pydantic.dev/latest/concepts/models/#dynamic-mo...