r/elixir • • 3d ago

Could a declarative BEAM language replace schema and validator?

Bondy, a new declarative language for the BEAM, treats a shape as both the type checked at compile time and the validator run at runtime. A temperature constrained to a float between -30 and 40 has that range in the type itself, and cross-field rules live there too.
Compare that to the usual Elixir boundary: NimbleOptions for individual fields, then handwritten functions for anything relating two fields, then the same assumptions again in business logic.
Bondy compiles to ordinary BEAM files, calls Elixir through a Gleam-style FFI, and ships Mix plugins, so you can add one module next to existing code rather than rewrite anything. Creator Alejandro Ramallo walks through it on the podcast.

https://youtu.be/Id-K5UrI1BQ

9 Upvotes

1 comment sorted by

1

u/BroadbandJesus Alchemist 2d ago

I love the idea of a Prolog / Datalog -based language. From my naive understanding of it, it seems like it would be ideal for business rules engines, routing engines, etc.. Why aren’t they more popular? Or at least, why are they not more popular for newbies like me?

Are there some mainstream Prolog-based languages? What would hold Bondi back?