source: trunk/third/librep/TODO @ 15762

Revision 15762, 7.6 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15761, which included commits to RCS files with non-trunk default branches.
Line 
1[ This is -*-Indented-Text-*- ]
2
3TODO list for librep
4********************
5
6Bugs are marked !, things that should be done soon are marked +,
7and more long-term ideas are marked -
8
9
10Outstanding bugs
11================
12
13 ! uses setlocale("LC_NUMERIC", "C") to make floating point I/O work,
14   need to reimplement this locally
15
16   [ this is only done temporarily now, but rep-gtk still has some
17     instances that can't be removed until librep 0.14 I guess.. ]
18
19 ! modules with `(set-binds)' config shouldn't inline constants?
20
21 ! #!key params can't be inlined by the compiler
22
23 ! non-top-level compiled defvar's aren't quite right
24
25 ! scheme define/lambda doesn't splice begin forms
26
27 ! the scheme module fails some of the guile test.scm cases
28
29 ! can't do numerator/denominator of flonums
30
31 ! the first level lookup of foo#bar isn't cached
32
33 ! interfaces aren't re-parsed when modules are reloaded
34
35 ! environment of macro expanders is not consistent
36
37   interpreted code closes macros in the usual lexical environment,
38   the compiler closes them in the *root-strcucture* since the
39   lexical environment of the compiled file doesn't exist
40
41   Xerox scheme closes all macros in the `initial environment', this
42   would provide consistency, but would break existing code
43
44 ! macro memoization loses
45
46   e.g. if same (eq) expression is expanded in different structures
47
48   OTOH, there is little or no chance of this ever happening
49
50 ! doesn't handle NaN or Inf in floats properly (at all)
51
52 ! Putting a breakpoint in a .jaderc file doesn't work correctly; the
53   debugger is entered, but the commands don't work
54
55 ! if load can't find the file, its error message is confusing
56   (especially if the named file does exist, but no suffixed file
57   exists)
58
59 ! non-fixnum numbers can't be dumped / dump totally broken re: modules
60
61 ! `random' only accepts its range as a fixnum
62
63   GMP 3 has suitable functions, but need to support GMP 2 (e.g. RH 6)
64
65 ! it's legal to do (set foo 42) where the contents of foo has a
66   lexical binding
67
68   this breaks: (let ((var 'loop))
69                  (let loop ((foo t))
70                    (set var print)
71                    (loop foo)))
72
73 + document in manual: current-utime, new read syntaxes
74
75 + deprecated:
76
77   * 0xNN and 0NN integer syntaxes [0.13+]
78   * define-value [0.13+]
79   * &optional and &rest (replaced by #!optional and #!rest) [0.13+]
80
81
82General programming tasks:
83==========================
84
85 + comparison of datums currently compares type id and contents
86
87   should be defined by programmer, e.g.:
88
89        (define-datum-comparer ID FUN)
90
91   by analogy with define-datum-discloser
92
93   (but do callers of rep_value_cmp () assume that it may GC?)
94
95 + avoid spurious init-bind and unbind instructions
96
97   (generated when lexical bindings aren't heap allocated)
98
99 + rename backquote* as quasiquote* -- helps scheme, doesn't affect rep
100
101 + add restricted load to gaol? (same directory only?)
102
103 + %make-structure shouldn't map names to structures itself
104
105   it's done this way to allow mutually recursive structures (debatable
106   itself) but really %make-structure should just create the thing
107   (with an optional name for printing)
108
109 - allow ML-like functors (parameterized modules)
110
111   the basic support is there. Can do:
112
113   (define (my-functor x)
114     (structure (export foo) (open rep)
115       (define (foo y) (+ x y))))
116
117   but there's currently no clean way to import the first-class
118   structure (without resorting to open-structures)
119
120   I think the way is to require the functor to implement a named
121   interface which is specified in the module signature:
122
123   (define-structure foo
124       (open rep
125             (functor (my-functor x) some-interface))
126       ...
127
128   `(my-functor x) would get evaluated in the environment containing
129   the define-structure form? Or in the environment created up to that
130   point?
131
132   The named-interface trick could also be useful for importing normal
133   modules (to avoid having to load them at compile time)
134
135   [ I have a first-stab at this, needs compiler support.. ]
136
137 - add a facility for dumping a set of structures, for later reloading
138
139 - move the gtk-independent parts of the rep-gtk glue generator and
140   support code to librep
141
142   [ I've rewritten the glue-code generator in an oo style so that it
143   can be easily extended. Need to rewrite the runtime support. Will do
144   this in time for GTK 2.0 ]
145
146 - add defadvice (port from elisp? other implementations?)
147
148 - Compiler could annotate output files with their dependences
149
150 - I/O shouldn't block all threads
151
152   wait_for_input () already groks threads, so I think the only problem
153   is the use of stdio/fd functions. How does stdio handle streams that
154   have been set non-blocking? Maybe reimplement basic stdio?
155
156   (there is now support for waking threads via polling)
157
158 - add regression tests
159
160 - scheme compilation is worse than rep compilation
161
162   should be able to make this a lot better, maybe not as good as rep
163   code (since the vm primitives are designed for that), but still a
164   lot better..
165
166   [ it's better now, but still room for improvement ]
167
168 - the gc sucks
169
170   is it possible to add a good (generational?) gc?
171
172   could sweeping be sped up by prefetching cache lines?
173
174   do lazy sweeping of block-allocated objects? (problem with cons mark bit?)
175
176   do mostly non-recursive marking? (mark stack)
177
178   [ tried this -- marginally slower than current method ]
179
180 - remove special forms (replacing them with macros) where both
181   possible and desirable
182
183   The current (July 2000) list of special forms is:
184
185   cond %define defvar lambda progn quote setq
186
187 - most subrs can't be called tail recursively (apply is special-cased)
188
189 - add a hygienic macro facility
190
191   this may be overkill? capture of introduced bindings can be avoided
192   using gensyms, capture of introduced free variables could be avoided
193   by introducing a way of tagging variable references with the
194   structure they need to be dereferenced in.
195
196   [ I have an experimental low-level hygienic macro implementation,
197     but it's a long way from being useful ]
198
199 - do JIT compilation of bytecode where profitable
200
201   there's now GNU lightning, a VCODE-like system, using C macros to do
202   portable runtime code generation
203
204   Only do this for _heavily_ used bytecode subrs. Measure this by
205   adding an extra vector slot, and counting the number of vm
206   instructions executed (and dividing by the length of the
207   code-string?)
208
209   Another option is to generate direct-threaded code from the bytecode
210   (and cache it). I have an attempt at this but it needs either (1) an
211   extra pass to detect labels, or (2) to maintain a strict mapping
212   between bytecode addresses and direct-code addresses
213
214   There's an interesting paper about automatically generating meta
215   instructions to suit individual instruction sequences, PLDI 98 or
216   something (check citeseer for it). Applied with reasonable success
217   to Caml interpreter
218
219 - Optimize compilation of case statements
220
221   1. handle constant keys
222
223   2. optimize the search (binary search if all clauses have same type
224      and are orderable?)
225
226 - Implement weak-pairs or equivalent
227
228   could use normal cons types for this, but allocate from a `weak'
229   freelist, then only gc has to differentiate between weak and
230   non-weak pairs
231
232 - Use two passes for `concat'; the first pass calculates the new
233   string's length, the second builds it
234
235 - Add more backends for accessing remote files
236
237   Make remote-rcp work properly, and add others (ssh, http, ..?)
238
239 - Make the compiler optimise its output
240
241   now the lisp is mostly lexically scoped, there should be much
242   more potential for aggressive optimisation
243
244
245Manual tasks:
246=============
247
248 + Document the error-mode and interrupt-mode variables
249
250 + Document the internals (i.e. the C interface)
Note: See TracBrowser for help on using the repository browser.