2 /* --------------------------------------------------------------------------
3 * Configuration options
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
9 * $RCSfile: options.h,v $
11 * $Date: 2000/03/10 18:28:26 $
12 * ------------------------------------------------------------------------*/
15 /* --------------------------------------------------------------------------
16 * Hugs paths and directories
17 * ------------------------------------------------------------------------*/
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.
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"...".
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
37 * "/usr/local/lib/hugs"
38 * "/usr/homes/JFHaskell/hugs"
41 * This value is ignored on Windows and Macintosh versions since
42 * it is assumed that the binary is installed in HUGSDIR.
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.
54 /* --------------------------------------------------------------------------
55 * User interface options
56 * ------------------------------------------------------------------------*/
58 /* Define if you want to use the "Hugs for Windows" GUI.
59 * (Windows 3.1 and compatibles only)
61 #define HUGS_FOR_WINDOWS 0
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)
68 #define PATH_CANONICALIZATION 0
70 /* Define if you want the small startup banner.
72 #define SMALL_BANNER 0
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").
78 #define REDIRECT_OUTPUT (!HUGS_FOR_WINDOWS)
81 /* --------------------------------------------------------------------------
83 * ------------------------------------------------------------------------*/
85 /* Define if T-REX; Typed Rows and EXtension should be enabled */
86 /* Doesn't work in current system - I don't know what the primops do */
89 /* Implicit Parameters */
92 /* Multi-instance resolution */
96 /* --------------------------------------------------------------------------
98 * ------------------------------------------------------------------------*/
100 #define NUM_SYNTAX 100
101 #define NUM_TUPLES 37
102 #define NUM_OFFSETS 1024
103 #define NUM_CHARS 256
107 #define CHAR_MASK 0xff
109 #define MINIMUMHEAP 19000
110 #define MAXIMUMHEAP 0
111 #define DEFAULTHEAP 350000
113 #define NUM_SCRIPTS 100
114 #define NUM_MODULE NUM_SCRIPTS
115 #define NUM_TYCON 400
116 #define NUM_NAME 16000
117 #define NUM_CLASSES 80
118 #define NUM_INSTS 600
119 #define NUM_TEXT 100000
121 #define NUM_TYVARS 4000
122 #define NUM_STACK 16000
123 #define NUM_DTUPLES 5
125 #define MAXPOSINT 0x7fffffff
126 #define MINNEGINT (-MAXPOSINT-1)
127 #define MAXHUGSWORD 0xffffffffU
129 #define minRecovery 1000
130 #define bitsPerWord 32
134 /* Define to force a fixed size (NUM_TYVARS) for the current substitution.
135 * Setting this flag places a limit on the maximum complexity of
136 * expressions handled by the typechecker. It is normally turned off
137 * but may be required for small machines/configurations.
139 #define FIXED_SUBST 0
141 /* Define this to allocate tables dynamically.
142 * This is currently just a memory saving trick, but this may be
143 * extended at a later stage to allow at least some of the tables
144 * to be extended dynamically at run-time to avoid exhausted space errors.
148 /* Should quantifiers be displayed in error messages.
149 * Warning: not consistently used.
151 #define DISPLAY_QUANTIFIERS 0
153 /* Flags to determine which raw representations and operations are available
155 * o if you turn everything on, you might end up with more then 256
156 * bytecodes: check the value of i_ccall (the lst bytecode) to check
157 * (JRS), 22apr99: I don't think any of the #undef'd ones will work
158 * without attention. However, standard Haskell 98 is supported
159 * is supported without needing them.
161 #undef PROVIDE_STABLE
162 #undef PROVIDE_FOREIGN
164 #undef PROVIDE_CONCURRENT
165 #undef PROVIDE_PTREQUALITY
166 #undef PROVIDE_COERCE
168 #define PROVIDE_COERCE 1
169 #define PROVIDE_PTREQUALITY 1
171 /* Enable a crude profiler which counts BCO entries, bytes allocated
172 and bytecode insns executed on a per-fn basis. Used for assessing
173 the effect of the simplifier/optimiser.
175 #undef CRUDE_PROFILING
177 /* Turn bytecode interpreter support on/off.
179 #define INTERPRETER 1
181 /* Turn on debugging output and some sanity checks
185 /* NB: LAZY_BLACKHOLING has been moved up to Stg.h where both Hugs and GHC can see it,
186 * and EAGER_BLACKHOLING has been introduced also. KSW 1999-01.
189 /* Turn miniinterpreter on/off.
191 * The mininterpreter is portable but slow - if you turn it off,
192 * you'll probably need to provide some assembly language support
193 * for your architecture.
195 #define USE_MINIINTERPRETER 1
197 /* Turn registerisation on/off.
199 * If you turn this off, you'll probably need to provide some
200 * assembly language support for your architecture.
205 /* Define if :xplain should be enabled */
206 #define EXPLAIN_INSTANCE_RESOLUTION 0
209 /* Define if you want to run Haskell code through a preprocessor
211 * Note that the :reload command doesn't know about any dependencies
212 * introduced by using #include so you must :load (not :reload) if
213 * you change any #included files (such as configuration files).
215 #define USE_PREPROCESSOR 1
217 /* Define if you want to time every evaluation.
219 * Timing is included in the Hugs distribution for the purpose of benchmarking
220 * the Hugs interpreter, comparing its performance across a variety of
221 * different machines, and with other systems for similar languages.
223 * It would be somewhat foolish to try to use the timings produced in this
224 * way for any other purpose. In particular, using timings to compare the
225 * performance of different versions of an algorithm is likely to give very
226 * misleading results. The current implementation of Hugs as an interpreter,
227 * without any significant optimizations, means that there are much more
228 * significant overheads than can be accounted for by small variations in
231 /* #undef WANT_TIMER */
234 /* --------------------------------------------------------------------------
237 * These options are mostly used for developing/debugging the system.
238 * Since they turn off required parts of the Haskell language, you'll
239 * probably need to modify Prelude.hs and the libraries if you change
241 * ------------------------------------------------------------------------*/
243 /* Define if single-element dictionaries are implemented by newtype.
244 * Should be turned on. Mostly used to make it easier to find which
245 * bits of code implement this optimisation and as a way of documenting
248 #define USE_NEWTYPE_FOR_DICTS 1
250 /* Define if strings should be represented as normal C strings.
251 * Note that this doesn't work if the string contains '\0'
252 * and makes persistence problematic.
253 * Intended as a stop-gap measure until mutable byte arrays are available.
255 #define USE_ADDR_FOR_STRINGS 1
258 /* --------------------------------------------------------------------------
259 * Experimental features
260 * These are likely to disappear/change in future versions and should not
261 * be used by most people..
262 * ------------------------------------------------------------------------*/
264 /* In a plain Hugs system, most signals (SIGBUS, SIGTERM, etc) indicate
265 * some kind of error in Hugs - or maybe a stack overflow. Rather than
266 * just crash, Hugs catches these errors and returns to the main loop.
267 * It does this by calling a function "panic" which longjmp's back to the
269 * If you're developing a GreenCard library, this may not be the right
270 * behaviour - it's better if Hugs leaves them for your debugger to
271 * catch rather than trapping them and "panicking".
276 /* ----------------------------------------------------------------------- */