0.6.8.6: applied MNA megapatch (will be edited shortly)
[sbcl.git] / TODO
1     Accumulation of half-understood design decisions eventually
2     chokes a program as a water weed chokes a canal. By refactoring
3     you can ensure that your full understanding of how the program
4     should be designed is always reflected in the program. As a
5     water weed quickly spreads its tendrils, partially understood
6     design decisions quickly spread their effects throughout your
7     program. No one or two or even ten individual actions will be
8     enough to eradicate the problem.
9        -- Martin Fowler, _Refactoring: Improving the Design
10           of Existing Code_, p. 360 
11 ===============================================================================
12 some things that I'd like to do in 0.6.x, in no particular order:
13 -------------------------------------------------------------------------------
14 PROBLEM:
15             The batch-related command line options for SBCL don't work
16         properly.
17             A small part of making them work properly is making sure that
18         verbose GC messages end up piped to error output.
19             Make sure that when the system dies due to an unhandled error
20         in batch mode, the error is printed successfully, whether
21         FINISH-OUTPUT or an extra newline or whatever is required.
22             Make sure that make.sh dies gracefully when one of the SBCLs
23         it's running dies with an error.
24 MUSING:
25             Actually, the ANSI *DEBUGGER-HOOK* variable might be a better
26         place to put the die-on-unhandled-error functionality.
27 FIX:
28         ??
29 -------------------------------------------------------------------------------
30 PROBLEM:
31             As long as I'm working on the batch-related command-line options,
32         it would be reasonable to add one more option to "do what I'd want",
33         testing standard input for non-TTY-ness and running in no-programmer
34         mode if so.
35 FIX:
36         ?? Do it.
37 -------------------------------------------------------------------------------
38 PROBLEM:
39             In order to make a well-behaved backtrace when a batch program
40         terminates abnormally, it should be limited in length.
41 FIX:
42         ?? Add a *DEBUG-BACKTRACE-COUNT* variable, initially set to 64,
43           to provide a default for the COUNT argument to BACKTRACE.
44 -------------------------------------------------------------------------------
45 PROBLEM:
46             I used CMU CL for years, and dozens of times I cursed the
47         inadequate breakpoint-based TRACE facility which doesn't work on
48         some functions, and I never realized that there's a wrapper-based
49         facility too until I was wading through the source code for SBCL.
50             Yes, I know I should have RTFM, but there is a lot of M..
51             (By the way, it would also be nice to have tracing behave
52         better with generic functions. TRACEing a generic function probably
53         shouldn't prevent DEFMETHOD from being used to redefine its
54         methods, and should perhaps trace each of its methods as well
55         as the generic function itself.)
56 FIX:
57         ?? possibility 1: Add error-handling code in ntrace.lisp to
58           catch failure to set breakpoints and retry using 
59           wrapper-based tracing.
60         ?? possibility 2: Add error-handling code in ntrace.lisp to
61           catch failure to catch failure to set breakpoints and output
62           a message suggesting retrying with wrapper-based breakpoints
63         ?? possibility 3: Fix the breakpoint-based TRACE facility so that
64           it always works.
65 -------------------------------------------------------------------------------
66 PROBLEM:
67             When cross-compiling host-byte-comp.lisp, I get bogus
68         warnings
69                 caught STYLE-WARNING:
70                   undefined function: %%DEFCONSTANT
71                 caught STYLE-WARNING:
72                   This function is undefined:
73                   %%DEFCONSTANT
74 MUSING:
75             The best way to clean this up would be as a side-effect of
76         a larger cleanup, making all the %%DEFFOO stuff use EVAL-WHEN
77         instead of IR1 magic.
78             There's probably some way to do it with a quick local hack too.
79 FIX:
80         ??
81 -------------------------------------------------------------------------------
82 PROBLEM:
83             My system of parallel build directories seems to add
84         complexity without adding value.
85 FIX:
86         ?? Replace it with a system where fasl output files live in the 
87           same directories as the sources and have names a la
88           "foo.fasl-from-host and "foo.fasl-from-xc".
89 -------------------------------------------------------------------------------
90 PROBLEM:
91             It might be good to use the syntax (DEBUGGER-SPECIAL *PRINT-LEVEL*)
92         etc. to control the in-the-debug-context special variables. Then we 
93         wouldn't have to pick and choose which variables we shadow in the
94         debugger.
95             The shadowing values could also be made persistent between
96         debugger invocations, so that entering the debugger, doing
97         (SETF *PRINT-LEVEL* 2), and exiting the debugger would leave
98         (DEBUGGER-SPECIAL *PRINT-LEVEL*) set to 2, and upon reentry to the
99         debugger, *PRINT-LEVEL* would be set back to 2.
100 FIX:
101         ??
102 -------------------------------------------------------------------------------
103 PROBLEM:
104             The :SB-TEST target feature should do something.
105 FIX:
106         ??
107 -------------------------------------------------------------------------------
108 PROBLEM:
109             I still haven't cleaned up the cut-and-paste programming in 
110                 * DEF-BOOLEAN-ATTRIBUTE, DELETEF-IN, and PUSH-IN
111                 * SB!SYS:DEF!MACRO ASSEMBLE and SB!XC:DEFMACRO ASSEMBLE
112 FIX:
113         ??
114 -------------------------------------------------------------------------------
115 PROBLEM:
116             We be able to get rid of the IR1 interpreter, which would
117         not only get rid of all the code in *eval*.lisp, but also allow us to
118         reduce the number of special cases elsewhere in the system. (Try
119         grepping for 'interpret' sometime.:-) Making this usable might
120         require cleaning up %DEFSTRUCT, %DEFUN, etc. to use EVAL-WHEN
121         instead of IR1 transform magic, which would be a good
122         thing in itself, but might be a fair amount of work.)
123 FIX:
124         ?? Delete, delete, delete.
125 -------------------------------------------------------------------------------
126 PROBLEM:
127             The hashing code is new and should be tested.
128 FIX:
129         ?? Enable the existing test code.
130 ===============================================================================
131 other known issues with no particular target date:
132
133 user manual including, at a minimum, updated versions of the
134 CMU CL user manual information on the compiler and the alien
135 interface
136
137 bugs listed on the man page
138
139 more regression tests
140
141 various bugs fixed in CMUCL since this code was forked off of it
142 ca. 19980801, since most of these haven't been fixed yet in SBCL
143
144 byte compilation of appropriate parts of the system, so that the
145 system core isn't so big
146
147 uninterning needed-only-at-init-time stuff after init is complete,
148 so that the system core isn't so big
149
150 Search for unused external symbols (ones which are not bound, fbound,
151 types, or whatever, and also have no other uses as e.g. flags) and
152 delete them. This should make the system core a little smaller, but
153 is mostly useful just to make the source code smaller and simpler.
154
155 The eventual plan is for SBCL to bootstrap itself in two phases. In
156 the first phase, the cross-compilation host is any old ANSI Common
157 Lisp (not necessarily SBCL) and the cross-compiler won't handle some
158 optimizations because the code it uses to implement them is not
159 portable. In the second phase, the cross-compilation host will be
160 required to be a compatible version of SBCL, and the cross-compiler
161 will take advantage of that to implement all optimizations. The
162 current version of SBCL only knows how to do the first of those two
163 phases, with a fully-portable cross-compiler, so some optimizations
164 are not done. Probably the most important consequence of this is that
165 because the fully-portable cross-compiler isn't very smart about
166 dealing with immediate values which are of specialized array type
167 (e.g. (SIMPLE-ARRAY (UNSIGNED-BYTE 4) 1)) the system sometimes has to
168 use unnecessarily-general array types internally.
169
170 adding new FOPs to provide something like CMU CL's FOP-SYMBOL-SAVE and
171 FOP-SMALL-SYMBOL-SAVE functionality, so that fasl files will be more
172 compact. (FOP-SYMBOL-SAVE used *PACKAGE*, which was concise but allowed
173 obscure bugs. Something like FOP-LAST-PACKAGE-SYMBOL-SAVE could have
174 much of the same conciseness advantage without the bugs.)
175
176 hundreds of FIXME notes in the sources from WHN
177
178 various other unfinished business from CMU CL and before, marked with 
179   "XX" or "XXX" or "###" or "***" or "???" or "pfw" or "@@@@" or "zzzzz"
180 or probably also other codes that I haven't noticed or have forgotten.
181
182 (Things marked as KLUDGE are in general things which are ugly or
183 confusing, but that, for whatever reason, may stay that way
184 indefinitely.)