« Name of things | Main | New build #292 is out »

June 05, 2006

MPS Constraints Language

Recently the new language has enriched the family of the MPS bootstrap languages - the Constraints Language.
A language definition now may include a constraints model which allows to attach additional logic to the features defined in the structure model of the language.
The language constraints model would enforce model integrity and allow to build more intelligent default behavior of the MPS editor.

There were different kinds of constrains before, of course. First are very simple, wired into the Structure Language (like link multiplicity 0..1, 0..n etc.) constraints, and others are extremely flexible but considerably more complex rules, enabling type checking and type inference.
The Constraints Language lies somewhere between these two extremes, combining both simplicity and flexibility.

Currently, the Constraints language is very small and not complete, it only includes facilities that needed immediately. Namely, there are only two kinds of constraints: one is for a property declaration and the second is for a reference link declaration.
For a property declaration a user can define a value-computation function, and
for a reference link declaration the user can define a function that will compute so-called 'referent search scope'.

Here is an example of the property constraint applicable to the name of a class constructor:

constraints-lang-property.PNG

Posted by Igor Alshannikov at June 5, 2006 09:26 PM

Comments

Post a comment




Remember Me?