source: trunk/third/librep/TODO @ 17362

Revision 17362, 7.6 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17361, which included commits to RCS files with non-trunk default branches.
RevLine 
[15282]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
[15761]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
[15282]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 ! it's legal to do (set foo 42) where the contents of foo has a
62   lexical binding
63
64   this breaks: (let ((var 'loop))
65                  (let loop ((foo t))
66                    (set var print)
67                    (loop foo)))
68
69 + document in manual: current-utime, new read syntaxes
70
71 + deprecated:
72
73   * 0xNN and 0NN integer syntaxes [0.13+]
74   * &optional and &rest (replaced by #!optional and #!rest) [0.13+]
75
76
77General programming tasks:
78==========================
79
[15761]80 + comparison of datums currently compares type id and contents
81
82   should be defined by programmer, e.g.:
83
84        (define-datum-comparer ID FUN)
85
86   by analogy with define-datum-discloser
87
88   (but do callers of rep_value_cmp () assume that it may GC?)
89
90 + avoid spurious init-bind and unbind instructions
91
92   (generated when lexical bindings aren't heap allocated)
93
[15282]94 + rename backquote* as quasiquote* -- helps scheme, doesn't affect rep
95
96 + add restricted load to gaol? (same directory only?)
97
98 + %make-structure shouldn't map names to structures itself
99
100   it's done this way to allow mutually recursive structures (debatable
101   itself) but really %make-structure should just create the thing
102   (with an optional name for printing)
103
104 - allow ML-like functors (parameterized modules)
105
106   the basic support is there. Can do:
107
108   (define (my-functor x)
109     (structure (export foo) (open rep)
110       (define (foo y) (+ x y))))
111
112   but there's currently no clean way to import the first-class
113   structure (without resorting to open-structures)
114
115   I think the way is to require the functor to implement a named
116   interface which is specified in the module signature:
117
118   (define-structure foo
119       (open rep
120             (functor (my-functor x) some-interface))
121       ...
122
123   `(my-functor x) would get evaluated in the environment containing
124   the define-structure form? Or in the environment created up to that
125   point?
126
127   The named-interface trick could also be useful for importing normal
128   modules (to avoid having to load them at compile time)
129
130   [ I have a first-stab at this, needs compiler support.. ]
131
132 - add a facility for dumping a set of structures, for later reloading
133
134 - move the gtk-independent parts of the rep-gtk glue generator and
135   support code to librep
136
137   [ I've rewritten the glue-code generator in an oo style so that it
138   can be easily extended. Need to rewrite the runtime support. Will do
139   this in time for GTK 2.0 ]
140
141 - add defadvice (port from elisp? other implementations?)
142
143 - Compiler could annotate output files with their dependences
144
145 - I/O shouldn't block all threads
146
147   wait_for_input () already groks threads, so I think the only problem
148   is the use of stdio/fd functions. How does stdio handle streams that
149   have been set non-blocking? Maybe reimplement basic stdio?
150
151   (there is now support for waking threads via polling)
152
[17361]153   [ I have a patch that adds support for threads to be woken when
154   one of a set of fds is available for writing and reading. It
155   also has a blocking I/O function that suspends the thread while
156   it blocks.. ]
157
[15282]158 - add regression tests
159
[17361]160   [ partially done, there is a test framework now, but only a couple
161   of modules define tests ]
162
[15282]163 - scheme compilation is worse than rep compilation
164
165   should be able to make this a lot better, maybe not as good as rep
166   code (since the vm primitives are designed for that), but still a
167   lot better..
168
169   [ it's better now, but still room for improvement ]
170
171 - the gc sucks
172
173   is it possible to add a good (generational?) gc?
174
175   could sweeping be sped up by prefetching cache lines?
176
177   do lazy sweeping of block-allocated objects? (problem with cons mark bit?)
178
179   do mostly non-recursive marking? (mark stack)
180
181   [ tried this -- marginally slower than current method ]
182
183 - remove special forms (replacing them with macros) where both
184   possible and desirable
185
186   The current (July 2000) list of special forms is:
187
188   cond %define defvar lambda progn quote setq
189
190 - most subrs can't be called tail recursively (apply is special-cased)
191
192 - add a hygienic macro facility
193
194   this may be overkill? capture of introduced bindings can be avoided
195   using gensyms, capture of introduced free variables could be avoided
196   by introducing a way of tagging variable references with the
197   structure they need to be dereferenced in.
198
199   [ I have an experimental low-level hygienic macro implementation,
200     but it's a long way from being useful ]
201
202 - do JIT compilation of bytecode where profitable
203
204   there's now GNU lightning, a VCODE-like system, using C macros to do
205   portable runtime code generation
206
207   Only do this for _heavily_ used bytecode subrs. Measure this by
208   adding an extra vector slot, and counting the number of vm
[15761]209   instructions executed (and dividing by the length of the
210   code-string?)
[15282]211
212   Another option is to generate direct-threaded code from the bytecode
213   (and cache it). I have an attempt at this but it needs either (1) an
214   extra pass to detect labels, or (2) to maintain a strict mapping
215   between bytecode addresses and direct-code addresses
216
217   There's an interesting paper about automatically generating meta
218   instructions to suit individual instruction sequences, PLDI 98 or
219   something (check citeseer for it). Applied with reasonable success
220   to Caml interpreter
221
222 - Optimize compilation of case statements
223
224   1. handle constant keys
225
226   2. optimize the search (binary search if all clauses have same type
227      and are orderable?)
228
229 - Use two passes for `concat'; the first pass calculates the new
230   string's length, the second builds it
231
232 - Add more backends for accessing remote files
233
234   Make remote-rcp work properly, and add others (ssh, http, ..?)
235
236 - Make the compiler optimise its output
237
238   now the lisp is mostly lexically scoped, there should be much
239   more potential for aggressive optimisation
240
241
242Manual tasks:
243=============
244
245 + Document the error-mode and interrupt-mode variables
246
247 + Document the internals (i.e. the C interface)
Note: See TracBrowser for help on using the repository browser.