[m-dev.] for discussion: feature set pragma proposal

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Nov 23 18:44:56 AEDT 2007


The following proposal (see diff below) is intended to catch things like 
an absence of trailing in modules that require trailing earlier than link 
time (where that particular problem is detected now.)

I haven't bothered document what the features below mean yet, although
they should be fairly self explanatory.



Index: reference_manual.texi
RCS file: /home/mercury/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.413
diff -u -r1.413 reference_manual.texi
--- reference_manual.texi	16 Nov 2007 03:44:53 -0000	1.413
+++ reference_manual.texi	23 Nov 2007 07:39:41 -0000
@@ -9957,6 +9957,9 @@
                                  calculated results and detecting or avoiding
                                  certain kinds of infinite loops.
  * Termination analysis::        Support for automatic proofs of termination.
+* Feature sets::                Support for checking that optional features of
+                                the implementation are supported at compile
+                                time.

  @end menu
  @c XXX The `reserved tag' pragma is not documented because it is intended to
@@ -10420,6 +10423,43 @@
  @c The compiler includes a structure reuse analysis system.

+ at node Feature sets
+ at section Feature sets
+The University of Melbourne Mercury implementation supports a number
+of optional features, such as @ref{Trailing} or @ref{Tabled evalaution}.
+Feature sets allow the programmer to assert that a module depends upon
+the availability of a specific set of these optional features in order
+to execute correctly.
+This assertion can be made use a @samp{pragma require_feature_set}
+The @samp{require_feature_set} pragma declaration has the following form:
+ at example
+:- pragma require_feature_set(@var{FeatureSet}).
+ at end example
+where @samp{FeatureSet} is list of features.
+Features that can be included in the list of features are:
+ at table @asis
+ at item @samp{concurrency}
+ at item @samp{single_prec_float}
+ at item @samp{double_prec_float},
+ at item @samp{memo}
+ at item @samp{parallelism}
+ at item @samp{trailing}
+ at end table
+If a module is compiled in a compilation grade in which any element
+of the feature set is not supported, the implementation will emit an
+error message informing the user of this.
+A @samp{pragma requrire_feature_set} may only occur in the implementation
+section of a module.
  @node Bibliography
  @chapter Bibliography

mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au

More information about the developers mailing list