Next: Compatibility of grade modifiers, Previous: Grade modifiers for target language debugging, Up: Grade modifiers [Contents][Index]
There is one grade modifier that users will probably encounter that they will propably never need to use themselves. This the grade modifier that the Mercury team itself uses only for a single purpose: making source distributions. Such distributions include not just the code of the Mercury system, which is mostly written in Mercury itself. but also the C code generated for each Mercury module. This allows people who do not have a working Mercury installation on their machine to create one.
.pregen
Compiling programs in a grade that
includes the .pregen
grade modifier
switches off all optional features,
and tells the compiler to make the fewest possible assumptions
about the platform on which the generated code will run.
(For example, the generated code will work
on both 32-bit and 64-bit platforms.)
Source distributions use grades that include this modifier
(the grade usually being hlc.gc.pregen
)
because it makes the C code in them portable to as many platforms as possible.
However, it has no advantages beyond this,
and, on 64-bit machines,
the requirement to use a data representation scheme
that also works on 32-bit platforms
imposes a nontrivial cost in performance.
This is why for pretty much any purpose other than source distributions,
other grades are a better choice.
This grade modifier is applicable
only to the base grades hlc
and none
.