[project @ 2000-02-25 10:53:53 by sewardj]
[ghc-hetmet.git] / ghc / includes / options.h
1
2 /* --------------------------------------------------------------------------
3  * Configuration options
4  *
5  * Copyright (c) The University of Nottingham and Yale University, 1994-1997.
6  * All rights reserved. See NOTICE for details and conditions of use etc...
7  * Hugs version 1.4, December 1997
8  *
9  * $RCSfile: options.h,v $
10  * $Revision: 1.17 $
11  * $Date: 2000/02/25 10:53:53 $
12  * ------------------------------------------------------------------------*/
13
14
15 /* --------------------------------------------------------------------------
16  * Hugs paths and directories
17  * ------------------------------------------------------------------------*/
18
19 /* Define this as the default setting of HUGSPATH.                        
20  * Value may contain string "{Hugs}" (for which we will substitute the
21  * value of HUGSDIR) and should be either colon-separated (Unix)
22  * or semicolon-separated (Macintosh, Windows, DOS).  Escape
23  * characters in the path string are interpreted according to normal
24  * Haskell conventions.
25  *
26  * This value can be overridden from the command line by setting the
27  * HUGSFLAGS environment variable or by storing an appropriate value
28  * for HUGSFLAGS in the registry (Win32 only).  In all cases, use a 
29  * string of the form -P"...".  
30  */
31 #define HUGSPATH "."
32
33 /* The directory name which is substituted for the string "{Hugs}"
34  * in a path variable.  This normally points to where the Hugs libraries
35  * are installed - ie so that the file HUGSDIR/lib/Prelude.hs exists    
36  * Typical values are:                                  
37  *    "/usr/local/lib/hugs"                             
38  *    "/usr/homes/JFHaskell/hugs"                       
39  *    ".."      
40  *
41  * This value is ignored on Windows and Macintosh versions since
42  * it is assumed that the binary is installed in HUGSDIR.
43  *
44  * This value cannot be overridden from the command line or by using 
45  * environment variables.  This isn't quite as limiting as you'd think
46  * since you can always choose _not_ to use the {Hugs} variable - however,
47  * it's obviously _nicer_ to have it set correctly.
48  */
49 #ifndef HUGSDIR
50 #define HUGSDIR "."
51 #endif
52
53
54 /* --------------------------------------------------------------------------
55  * User interface options
56  * ------------------------------------------------------------------------*/
57
58 /* Define if you want to use the "Hugs for Windows" GUI.
59  * (Windows 3.1 and compatibles only)
60  */
61 #define HUGS_FOR_WINDOWS 0
62
63 /* Define if you want filenames to be converted to normal form by:
64  * o replacing relative pathnames with absolute pathnames and
65  *   eliminating .. and . where possible.
66  * o converting to lower case (only in case-insensitive filesystems)
67  */
68 #define PATH_CANONICALIZATION 0
69
70 /* Define if you want the small startup banner.
71  */
72 #define SMALL_BANNER 0
73
74 /* Define if you want to be able to redirect stdout/stderr to a buffer.
75  * Only necessary for the Hugs server interface (which is used in the
76  * Netscape plugin and the standalone evaluator "runhugs"). 
77  */
78 #define REDIRECT_OUTPUT (!HUGS_FOR_WINDOWS)
79
80
81 /* --------------------------------------------------------------------------
82  * Making Hugs smaller
83  * ------------------------------------------------------------------------*/
84
85 /* Define one of these to select overall size of Hugs
86  *   SMALL_HUGS     for 16 bit operation on a limited memory PC.
87  *   REGULAR_HUGS   for 32 bit operation using largish default table sizes.
88  *   LARGE_HUGS     for 32 bit operation using larger default table sizes.
89  */
90 #define SMALL_HUGS   0
91 #define REGULAR_HUGS 0
92 #define LARGE_HUGS   1
93
94 #define NUM_SYNTAX         100
95 #define NUM_TUPLES         37
96 #define NUM_OFFSETS        1024
97 #define NUM_CHARS          256
98 #if TREX
99 #define NUM_EXT            100
100 #endif
101 #define CHAR_MASK          0xff
102
103 #if     SMALL_HUGS                      /* the McDonalds mentality :-)     */
104 #define Pick(s,r,l)        s
105 #endif
106 #if     REGULAR_HUGS
107 #define Pick(s,r,l)        r
108 #endif
109 #if     LARGE_HUGS
110 #define Pick(s,r,l)        l
111 #endif
112
113 #define MINIMUMHEAP        Pick(7500,   19000,      19000)
114 #define MAXIMUMHEAP        Pick(32765,  0,          0)
115 #define DEFAULTHEAP        Pick(28000,  50000,      350000)
116
117 #define NUM_SCRIPTS        Pick(64,     100,        100)
118 #define NUM_MODULE         NUM_SCRIPTS
119 #define NUM_TYCON          Pick(60,     160,        400)
120 #define NUM_NAME           Pick(1000,   2000,       16000)
121 #define NUM_CLASSES        Pick(30,     40,         80)
122 #define NUM_INSTS          Pick(200,    300,        600)
123 #define NUM_TEXT           Pick(12000,  20000,      100000)
124 #define NUM_TEXTH          Pick(1,      10,         10)
125 #define NUM_TYVARS         Pick(800,    2000,       4000)
126 #define NUM_STACK          Pick(1800,   12000,      16000)
127 #define NUM_DTUPLES        Pick(3,      5,          5)
128
129 #define MAXPOSINT          0x7fffffff
130 #define MINNEGINT          (-MAXPOSINT-1)
131 #define MAXHUGSWORD        0xffffffffU
132
133 #define BIGBASE            Pick(100,    10000,      10000)
134 #define BIGEXP             Pick(2,      4,          4)
135
136 #define minRecovery        Pick(1000,  1000,       1000)
137 #define bitsPerWord        Pick(16,    32,         32)
138 #define wordShift          Pick(4,     5,          5)
139 #define wordMask           Pick(15,    31,         31)
140
141 /* Define to force a fixed size (NUM_TYVARS) for the current substitution.
142  * Setting this flag places a limit on the maximum complexity of
143  * expressions handled by the typechecker.  It is normally turned off
144  * but may be required for small machines/configurations.
145  */
146 #define FIXED_SUBST 0 
147
148 /* Define this to allocate tables dynamically.
149  * This is currently just a memory saving trick, but this may be
150  * extended at a later stage to allow at least some of the tables
151  * to be extended dynamically at run-time to avoid exhausted space errors.
152  */
153 #define DYN_TABLES SMALL_HUGS
154
155 /* Should quantifiers be displayed in error messages.
156  * Warning: not consistently used.
157  */
158 #define DISPLAY_QUANTIFIERS 0
159
160 /* Flags to determine which raw representations and operations are available
161  * Notes:
162  * o if you turn everything on, you might end up with more then 256
163  *   bytecodes: check the value of i_ccall (the lst bytecode) to check
164  * (JRS), 22apr99: I don't think any of the #undef'd ones will work
165  * without attention.  However, standard Haskell 98 is supported 
166  * is supported without needing them.
167  */
168 #undef  PROVIDE_STABLE
169 #undef  PROVIDE_FOREIGN
170 #undef  PROVIDE_WEAK
171 #undef  PROVIDE_CONCURRENT
172 #undef  PROVIDE_PTREQUALITY
173 #undef  PROVIDE_COERCE
174
175
176 /* Set to 1 to use a non-GMP implementation of integer, in the
177    standalone Hugs.  Set to 0 in the combined GHC-Hugs system,
178    in which case GNU MP will be used.
179 */
180 #define STANDALONE_INTEGER 1
181
182 /* Enable a crude profiler which counts BCO entries, bytes allocated
183    and bytecode insns executed on a per-fn basis.  Used for assessing
184    the effect of the simplifier/optimiser.
185 */
186 #undef CRUDE_PROFILING
187
188
189 /* Is the default default (Int,Double) or (Integer,Double)?
190  */
191 #define DEFAULT_BIGNUM 1
192
193 /* Are things being used in an interactive setting or a batch setting?
194  * In an interactive setting, System.exitWith should not call _exit
195  * getProgName and getProgArgs need to be handled differently, etc.
196  *
197  * Warning: this flag is ignored by an awful lot of code.
198  */
199 #define INTERACTIVE
200
201 /* Turn bytecode interpreter support on/off.
202  */
203 #define INTERPRETER 1 
204
205 /* Turn on debugging output and some sanity checks
206  */
207 /*#define DEBUG*/
208
209 /* NB: LAZY_BLACKHOLING has been moved up to Stg.h where both Hugs and GHC can see it,
210  * and EAGER_BLACKHOLING has been introduced also.  KSW 1999-01.
211  */
212
213 /* Turn miniinterpreter on/off.
214  * 
215  * The mininterpreter is portable but slow - if you turn it off, 
216  * you'll probably need to provide some assembly language support
217  * for your architecture.
218  */
219 #define USE_MINIINTERPRETER 1
220
221 /* Turn registerisation on/off.
222  * 
223  * If you turn this off, you'll probably need to provide some
224  * assembly language support for your architecture.
225  */
226 #define NO_REGS
227
228
229 /* --------------------------------------------------------------------------
230  * Fancy features
231  * ------------------------------------------------------------------------*/
232
233 /* Define if T-REX; Typed Rows and EXtension should be enabled             */
234 /* Doesn't work in current system - I don't know what the primops do       */
235 #define TREX 0
236
237 /* Define if :xplain should be enabled                                     */
238 #define EXPLAIN_INSTANCE_RESOLUTION 0
239
240
241 /* Define if you want to run Haskell code through a preprocessor
242  * 
243  * Note that the :reload command doesn't know about any dependencies
244  * introduced by using #include so you must :load (not :reload) if
245  * you change any #included files (such as configuration files).
246  */
247 #define USE_PREPROCESSOR 1
248
249 /* Define if you want to time every evaluation. 
250  *
251  * Timing is included in the Hugs distribution for the purpose of benchmarking
252  * the Hugs interpreter, comparing its performance across a variety of
253  * different machines, and with other systems for similar languages.
254  *
255  * It would be somewhat foolish to try to use the timings produced in this
256  * way for any other purpose.  In particular, using timings to compare the
257  * performance of different versions of an algorithm is likely to give very
258  * misleading results.  The current implementation of Hugs as an interpreter,
259  * without any significant optimizations, means that there are much more
260  * significant overheads than can be accounted for by small variations in
261  * Hugs code.
262  */
263 /* #undef WANT_TIMER */
264
265
266 /* --------------------------------------------------------------------------
267  * Desugaring options
268  * 
269  * These options are mostly used for developing/debugging the system.
270  * Since they turn off required parts of the Haskell language, you'll
271  * probably need to modify Prelude.hs and the libraries if you change
272  * these flags.
273  * ------------------------------------------------------------------------*/
274
275 /* Define if single-element dictionaries are implemented by newtype.
276  * Should be turned on.  Mostly used to make it easier to find which
277  * bits of code implement this optimisation and as a way of documenting
278  * them.
279  */
280 #define USE_NEWTYPE_FOR_DICTS 1
281
282 /* Define if strings should be represented as normal C strings.
283  * Note that this doesn't work if the string contains '\0'
284  * and makes persistence problematic.
285  * Intended as a stop-gap measure until mutable byte arrays are available.
286  */
287 #define USE_ADDR_FOR_STRINGS 1
288
289 /* Define to include support for (n+k) patterns. 
290  * Warning: many people in the Haskell committee want to remove n+k patterns.
291  */
292 #define NPLUSK 1
293
294
295 /* --------------------------------------------------------------------------
296  * Debugging options (intended for use by maintainers)
297  * ------------------------------------------------------------------------*/
298
299 /* Define if debugging generated bytecodes or the bytecode interpreter     */
300 #define DEBUG_CODE 1
301
302 /* Define if you want to use a low-level printer from within a debugger    */
303 #define DEBUG_PRINTER 1
304
305 /* --------------------------------------------------------------------------
306  * Experimental features
307  * These are likely to disappear/change in future versions and should not
308  * be used by most people..
309  * ------------------------------------------------------------------------*/
310
311 /* In a plain Hugs system, most signals (SIGBUS, SIGTERM, etc) indicate
312  * some kind of error in Hugs - or maybe a stack overflow.  Rather than
313  * just crash, Hugs catches these errors and returns to the main loop.
314  * It does this by calling a function "panic" which longjmp's back to the
315  * main loop.
316  * If you're developing a GreenCard library, this may not be the right
317  * behaviour - it's better if Hugs leaves them for your debugger to
318  * catch rather than trapping them and "panicking".
319  */
320 #define DONT_PANIC 1
321
322
323 /* ----------------------------------------------------------------------- */