bloom-lang / bud

Prototype Bud runtime (Bloom Under Development)
http://bloom-lang.net
Other
854 stars 60 forks source link

Language support for constraints/assertions #219

Open neilconway opened 13 years ago

neilconway commented 13 years ago

There's a common idiom for writing down correctness constraints and assertions:

    fail <= should_not_happen { ... }
    stdio <= fail { ["error!"] }
    _ <= fail { raise BudError }

We might consider adding support for this idiom to the language itself. For a start, it would slightly simplify programs, and make them more uniform. It might also enable us to address some related questions, such as:

neilconway commented 11 years ago

I'm thinking about implementing support for this soonish. If anyone has any input on how this feature should be designed, let me know (I'm inclined to skip thinking about how errors should interact with the module system).

jhellerstein commented 11 years ago

Please offer a design we can discuss. Some questions from my end:

And maybe most importantly:

Joe

On Feb 1, 2013, at 11:18 PM, Neil Conway notifications@github.com wrote:

I'm thinking about implementing support for this soonish. If anyone has any input on how this feature should be designed, let me know (I'm inclined to skip thinking about how errors should interact with the module system).

— Reply to this email directly or view it on GitHub.