| 1 |
This file contains suggestions for further work. |
| 2 |
See also https://sourceforge.net/p/clisp/feature-requests/ |
| 3 |
|
| 4 |
URGENT PROBLEMS |
| 5 |
=============== |
| 6 |
Should handle these soon. |
| 7 |
|
| 8 |
|
| 9 |
Inefficiency of class redefinition when old or new class is unfinalizable |
| 10 |
|
| 11 |
|
| 12 |
support perseverances also on write side |
| 13 |
change wr_by_array_iau8_buffered to use persev instead of persev_full |
| 14 |
|
| 15 |
|
| 16 |
Changes to Unicode standard |
| 17 |
(Bruno and Jörg discussing issues Nov. 2006) |
| 18 |
Eliminate surrogates D800-DFFF from characters |
| 19 |
"Surrogates do not represent characters" |
| 20 |
"there are not and will never be *surrogate characters* (i.e. encoded |
| 21 |
characters represented with a single surrogate code point)" |
| 22 |
Change: (code-char #xD800) -> NIL, and #\uD800 becomes illegal |
| 23 |
This is to be consistent and avoid problems with embedded string constants |
| 24 |
in .fas files, e.g. (defvar foo #.(string (code-char #xD800))) ; error |
| 25 |
Goal: CLISP shall never generate an illegal UTF sequence (unlike |
| 26 |
versions <= 2.41). Similarly, CLISP shall not construct a |
| 27 |
weird string e.g. by reading an illegal sequence. |
| 28 |
Conversion to and from binary signals error. |
| 29 |
Affects: UTF-8, UTF-7, UCS2, UCS4 and likely others. |
| 30 |
Unpaired surrogates shall signal error when reading (like iconv does). |
| 31 |
CODE-CHAR-LIMIT is preserved, but CODE-CHAR yields NIL for all |
| 32 |
surrogates because they don't stand on their own (they are considered |
| 33 |
an artefact of the days when 16 bit where hoped sufficient). |
| 34 |
Of course, valid sequences are not affected. Code #x10400 is represented as |
| 35 |
F0 90 90 80 in UTF-8 and as 01 D8 00 DC or D8 01 DC 00 in UTF-16. |
| 36 |
|
| 37 |
Not adressed here: "The two values FFFE and FFFF as well as the 32 |
| 38 |
values from FDD0 to FDEF represent noncharacters." |
| 39 |
|
| 40 |
|
| 41 |
Reading illegal UTF byte sequences |
| 42 |
Markus Kuhn has some recommendations |
| 43 |
http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt |
| 44 |
CLISP currently differs from these, c.f. bug#370 |
| 45 |
Should we follow these more closely? |
| 46 |
(ext:convert-string-from-bytes #(65 #xB5 66) |
| 47 |
(ext:make-encoding :charset "utf-8" :input-error-action #\Z)) |
| 48 |
"AB" (clisp src/encoding.d) |
| 49 |
(ext:convert-string-from-bytes #(65 #xB5 66) |
| 50 |
(ext:make-encoding :charset "\\utf-8" :input-error-action #\Z)) |
| 51 |
"AZB" (iconv) |
| 52 |
|
| 53 |
|
| 54 |
Embeddability: additional API in spvw.d; example. RFE#4 |
| 55 |
|
| 56 |
|
| 57 |
nested REQUIRE is broken |
| 58 |
<https://sourceforge.net/p/clisp/mailman/message/14013213/> |
| 59 |
suppose I have a library which consists of 10 files - which create |
| 60 |
packages, define macros &c. |
| 61 |
I create a special file foo.lisp: |
| 62 |
--- foo --- |
| 63 |
(load "foo0") |
| 64 |
(load "foo1") |
| 65 |
.... |
| 66 |
(load "foo9") |
| 67 |
(provide "foo") |
| 68 |
--- foo --- |
| 69 |
then (require "foo") will load the whole library, |
| 70 |
but since foo.lib is _empty_, this won't work: |
| 71 |
--- bar --- |
| 72 |
(require "foo") |
| 73 |
(defun bar () (foo:with-foo (...) ...)) |
| 74 |
--- bar --- |
| 75 |
when bar.lisp is compiled, the empty foo.lib is loaded and there is no |
| 76 |
package FOO, no macro WITH-FOO &c. |
| 77 |
to fix this we need to, first, replace LOAD with REQUIRE in foo.lisp, |
| 78 |
and, second, change c-REQUIRE to write the REQUIRE form into *.lib. |
| 79 |
unfortunately, this means that each foo?.lisp must PROVIDE "foo?" which |
| 80 |
is quite ugly. |
| 81 |
Alternatively, c-LOAD could write (LOAD "*.lib") into the LIB file. |
| 82 |
|
| 83 |
|
| 84 |
Review all macros and tighten the runtime interface of the macros. |
| 85 |
check-redefinition |
| 86 |
|
| 87 |
|
| 88 |
contagion warnings: engineering vs portability |
| 89 |
<https://sourceforge.net/p/clisp/mailman/message/14013280/> |
| 90 |
*warn-on-floating-point-contagion* engineering warning |
| 91 |
the user is doing something mathematically unsound |
| 92 |
*warn-on-floating-point-rational-contagion* "portability" warning |
| 93 |
we don't like the standard requirement |
| 94 |
since our ANSI mode makes these portability concerns non-existent, |
| 95 |
logically, either this variable should be removed, |
| 96 |
or every *...-ansi* variable should have a corresponding *warn-...* variable |
| 97 |
(e.g., warn on (pathname "foo:bar") and (print #\space)) |
| 98 |
or there should be a single variable *enable-portability-warnings* |
| 99 |
the last option is best: simple and inobtrusive. |
| 100 |
(setq *ansi* t) should also disable *enable-portability-warnings*. |
| 101 |
initially, *warn-on-floating-point-contagion* and *enable-portability-warnings* |
| 102 |
should be T. |
| 103 |
|
| 104 |
|
| 105 |
libopen should DWIM -- include libltdl and use lt_dlopenext(). |
| 106 |
Note: including libltdl is non-trivial and libtoolize requires configure.ac |
| 107 |
|
| 108 |
|
| 109 |
Better error checking in get-setf-expansion for long defsetf |
| 110 |
|
| 111 |
|
| 112 |
FFI: passing structs by value: |
| 113 |
http://clisp.org/impnotes/dffi.html#ffi-struct-arg |
| 114 |
foreign.d should signal an error when a struct is passed by value |
| 115 |
foreign1.lisp should emit C code for a wrapper function |
| 116 |
that passes the struct by pointer |
| 117 |
<https://sourceforge.net/p/clisp/mailman/message/12748866/> |
| 118 |
RFE#26 |
| 119 |
|
| 120 |
|
| 121 |
for Emacs: GC root macro, YETANOTHER macro |
| 122 |
[sds: what does this mean?] |
| 123 |
|
| 124 |
|
| 125 |
print-readably for interpreted closures and #<specdecl> ? |
| 126 |
|
| 127 |
|
| 128 |
Should reject invalid format string: |
| 129 |
> (format t "abc~,'*Sdef" '(a b c)) |
| 130 |
abc(A B C)def |
| 131 |
> (format t (formatter "abc~,'*Sdef") '(a b c)) |
| 132 |
abc*(A B C)def |
| 133 |
Similarly "abc~3W" |
| 134 |
how about a compile-time format string check to warn about |
| 135 |
(format t "~A" a b) and (format t "~A ~B ~C" a b) |
| 136 |
|
| 137 |
|
| 138 |
If you (TRACE generic-function) and then reload the file defining that |
| 139 |
function, you got an error saying that #<CLOSURE TRACED-xxx> is not a generic |
| 140 |
function. Now the function is silently untraced, which is just as bad. For |
| 141 |
non-generic functions, DEFUN untraces the function, but at least gives a |
| 142 |
warning. The desired behaviour is: |
| 143 |
1. no difference between non-generic and generic functions, |
| 144 |
2. a custom:*untrace-upon-redefinition* variable, default value nil, |
| 145 |
3. if custom:*untrace-upon-redefinition* is true, redefining a function |
| 146 |
removes the trace wrapper but gives a warning, |
| 147 |
4. if custom:*untrace-upon-redefinition* is false, redefining a function |
| 148 |
keeps the trace wrapper and replaces the "inner" function inside the |
| 149 |
wrapper. |
| 150 |
A documented API should be provided for the trace wrapper, so that profilers |
| 151 |
etc. can do the same as TRACE without needing to hack clisp's TRACE, COMPILE, |
| 152 |
DISASSEMBLE, DEFUN, DEFGENERIC. |
| 153 |
<https://sourceforge.net/p/clisp/mailman/message/13749303/> |
| 154 |
Such a def-fwrapper is what we need, so that profilers |
| 155 |
etc. that are ported to ACL can be ported to clisp with minimal effort. |
| 156 |
<http://www.franz.com/support/documentation/6.2/doc/fwrappers-and-advice.htm> |
| 157 |
|
| 158 |
|
| 159 |
clean up and modularize spvw.d (hasn't this been done already in 1998-07?) |
| 160 |
|
| 161 |
|
| 162 |
Add fast unicode attribute accessors (like CHAR-NUMERIC-P and CHAR-DECOMPOSE) |
| 163 |
[bruno] Agreed, this is a binding it my libunistring |
| 164 |
and augment the reader to return 168 from |
| 165 |
(let ((*read-base* 16)) |
| 166 |
(read-from-string |
| 167 |
(concatenate 'string |
| 168 |
(string #\MATHEMATICAL_BOLD_CAPITAL_A) |
| 169 |
(string #\MATHEMATICAL_BOLD_DIGIT_EIGHT)))) |
| 170 |
[bruno] better not. It was argued in comp.lang.lisp that the behaviour of |
| 171 |
the Lisp reader should remain based on the traditional notion of |
| 172 |
"digit". (ANSI CL is ambiguous in its definition of "digit". Unexpected |
| 173 |
behaviour in this area can lead to security issues.) |
| 174 |
|
| 175 |
|
| 176 |
error recovery RFE#12 |
| 177 |
The ability not to lose the computation on error is |
| 178 |
crucial for any serious task. |
| 179 |
Therefore, we need to be able to recover from ALL errors. |
| 180 |
There are two independent issues here: |
| 181 |
1. "retry" restart on i/o, see |
| 182 |
<https://sourceforge.net/mailarchive/message.php?msg_id=7607066> |
| 183 |
2. "return-from" restart that will return the specified |
| 184 |
values from the given function on the stack. we |
| 185 |
already have that in interpreted functions, but we must |
| 186 |
also have it in compiled functions. |
| 187 |
<https://sourceforge.net/p/clisp/mailman/message/13045168/> |
| 188 |
|
| 189 |
|
| 190 |
GENERATIONAL_GC on Cygwin bug#238 |
| 191 |
the mmap() autoconf test fails but maybe one can work around it? |
| 192 |
|
| 193 |
|
| 194 |
GC/Memory Management: |
| 195 |
1. Better post-mortem on segfault RFE#27 |
| 196 |
<https://sourceforge.net/p/clisp/mailman/message/13750185/> |
| 197 |
2. More GC generations as a build-time option RFE#28 |
| 198 |
3. Better TIME/ROOM GC statistics reporting (per generation stats) RFE#29 |
| 199 |
<https://sourceforge.net/p/clisp/mailman/message/13750176/> |
| 200 |
<https://sourceforge.net/p/clisp/mailman/message/13750180/> |
| 201 |
<https://sourceforge.net/p/clisp/mailman/message/13750187/> |
| 202 |
4. Ability to "tenure" a specific object (with all its references!) RFE#30 |
| 203 |
or the whole current heap (also untenure the object). |
| 204 |
|
| 205 |
|
| 206 |
local function (LABEL/FLET) calls waste heap (COPY-CLOSURE). |
| 207 |
use STACK instead? |
| 208 |
|
| 209 |
|
| 210 |
LAUNCH/RUN-PROGRAM: |
| 211 |
CLISP has now 6 built-ins for launching external executables: |
| 212 |
SHELL, EXECUTE, MAKE-PIPE-*-STREAM, LAUNCH. |
| 213 |
We need to have just _one_ such built-in, with many more options, |
| 214 |
like CMUCL's RUN-PROGRAM |
| 215 |
<http://common-lisp.net/project/cmucl/doc/cmu-user/extensions.html#toc46> |
| 216 |
We now have LAUNCH which is a good start. More work is needed. |
| 217 |
[bruno]: |
| 218 |
A possible outcome is just two facilities: |
| 219 |
1) A type PROCESS, which describes the result of an asynchronous launch, |
| 220 |
and a function which returns a process. (Similar to the Java API. The |
| 221 |
.NET API, where you set the input parameters through an object, is |
| 222 |
more confusing.) This is powerful but difficult to use. |
| 223 |
2) A simple to use facility which doesn't produce a PROCESS object, but |
| 224 |
rather returns stream(s) directly. Like RUN-PROGRAM with fewer options. |
| 225 |
SHELL, EXECUTE, MAKE-PIPE-*-STREAM can then become shorthands for facility #2. |
| 226 |
Of course, facility #2 should be based on facility #1, otherwise porting and |
| 227 |
testing becomes twice as time consuming. |
| 228 |
[sds]: (1) is an overkill, (2) is not needed if (1) is simplified: |
| 229 |
when :WAIT is T (synchronous launch), the return value is the exit code. |
| 230 |
when :WAIT is NIL (asynchronous), the return values are streams, and |
| 231 |
the number and type of the return values is determined by the |
| 232 |
:INPUT and :OUTPUT arguments. |
| 233 |
This is Lisp, not C or Java, and the return type can depend on arguments! |
| 234 |
(this, of course, can be implemented via several internal functions |
| 235 |
which even use a _C_ struct clisp_process, but the user does not need that) |
| 236 |
|
| 237 |
|
| 238 |
Debugger: |
| 239 |
- Think about the function call traces on the STACK and SP. Which stack |
| 240 |
should be used for which purpose? |
| 241 |
- Turn the <n> entries of show-stack into normal entries, with equal rights |
| 242 |
as the other entries. Remove the <n>, as it's no information. |
| 243 |
* actually, these entries specify control flow (function calls) |
| 244 |
rather than local data (the other entries), they are "headers", |
| 245 |
so they should be printed differently and counted separately |
| 246 |
- Devise a better variety of stack traces, maybe one without args and one with |
| 247 |
args? |
| 248 |
|
| 249 |
|
| 250 |
MAYBE |
| 251 |
===== |
| 252 |
|
| 253 |
Still have to think about these, whether they are good ideas or not. |
| 254 |
|
| 255 |
|
| 256 |
Try to increase the string size limit, to get rid of |
| 257 |
"*** - string too long: desired length 6553600 exceeds the supported maximum |
| 258 |
length" errors |
| 259 |
instead, the string size limit just went down! bug#271 |
| 260 |
|
| 261 |
|
| 262 |
Add highlight/underline/etc. capability to the output side of *terminal-io*. |
| 263 |
|
| 264 |
|
| 265 |
Optimize REPLACE so that (replace v v :start1 10 :end1 30 :start2 0 :end2 20) |
| 266 |
doesn't cons. (vectors only, not lists) |
| 267 |
|
| 268 |
|
| 269 |
Having two different handlings of Ctrl-C (once as a serious-condition, once |
| 270 |
directly through tast_break(), bypassing ERROR and SIGNAL) is horrible. |
| 271 |
Introduce a class of SERIOUS-CONDITION and then remove BATCHMODE-BREAK-DRIVER. |
| 272 |
|
| 273 |
|
| 274 |
FFI: Actually support :language :cc/:gcc by passing appropriate flags |
| 275 |
to the avcall/vacall macros. The default should be the same compiler |
| 276 |
as the one used to compile clisp. |
| 277 |
|
| 278 |
|
| 279 |
Looks at GCL CLCS (debugger.lsp top-patches.lsp condition-definitions.lsp) |
| 280 |
whether it contains something clisp could profit from. |
| 281 |
|
| 282 |
|
| 283 |
More CLtL2 compliance: |
| 284 |
; List of X3J13 votes that may be implemented in CLISP |
| 285 |
; |
| 286 |
; Number: from CLtL2, Index of X3J13 Votes. |
| 287 |
; Status: indicates whether CLISP currently supports code that makes use of |
| 288 |
; this vote. |
| 289 |
; |
| 290 |
; Number Title Status Files affected |
| 291 |
; |
| 292 |
; <85> FORMAT & pretty print yes format.lisp |
| 293 |
; no: ~E, ~F, ~G, ~$ also bind *PRINT-BASE* to 10 and *PRINT-RADIX* to NIL |
| 294 |
; <110> LOAD & objects no loadform.lisp |
| 295 |
; <127> package function consistency no package.d |
| 296 |
; <129> pathname: component value no pathname.d |
| 297 |
; <133> pathname: subdirectory list no pathname.d |
| 298 |
; <134> pathname: symbol no pathname.d, stream.d |
| 299 |
; <136> pathname: unspecific component no pathname.d |
| 300 |
; <139> pretty-print interface no xp.lisp |
| 301 |
; <153> REMF & destruction: unspecified no for NRECONC list.d |
| 302 |
; yes for anything else |
| 303 |
|
| 304 |
|
| 305 |
The completion in user2.lisp does bad things with respect to upper case and |
| 306 |
lower case of symbols. Assume the symbols |TMP|, |TMP structure class| |
| 307 |
are interned. Then type a tab in the following situations: |
| 308 |
> (symbol-plist '\Tmp |
| 309 |
> 'tm |
| 310 |
> '| |
| 311 |
|
| 312 |
|
| 313 |
Optimize the compiler or the LOOP expander so that |
| 314 |
(macroexpand '(loop for (a b c) = (multiple-value-list (foo)))) |
| 315 |
contains |
| 316 |
(MULTIPLE-VALUE-SETQ (A B C) (FOO)) |
| 317 |
|
| 318 |
|
| 319 |
NOT TO DO |
| 320 |
========= |
| 321 |
|
| 322 |
These have been in my mind, but are probably bad ideas. |
| 323 |
|
| 324 |
|
| 325 |
upgrade to newest CLN, but still big-endian and without gmp |
| 326 |
|
| 327 |
intgcd |
| 328 |
|
| 329 |
* Speed up the functions `cl_I gcd (const cl_I&, const cl_I&)' and |
| 330 |
`cl_I xgcd (const cl_I&, const cl_I&, cl_I*, cl_I*)' by a factor |
| 331 |
of 1.5. Simple trick. |
| 332 |
Why is there no cl_gcd_double_threshold in xgcd, only in gcd?? |
| 333 |
|
| 334 |
lfloat |
| 335 |
|
| 336 |
* Speed up multiplication and division of large long-floats by small integers. |
| 337 |
|
| 338 |
realtran |
| 339 |
|
| 340 |
* Speed up the internal computation of ln(2) and ln(10) by about 20%. |
| 341 |
|
| 342 |
* Speed up the computation of exp (for 1000 digits or more) by about 10%. |
| 343 |
|
| 344 |
* Speed up the computation of the elementary transcendental functions: |
| 345 |
exp, sinh, cosh, asinh, atanh (for 100 digits) by about 30%, |
| 346 |
log (for 100 digits) by about 25%, |
| 347 |
sin, cos (for 1000 or 10000 digits) by about 20%, |
| 348 |
asin, acos, atan (for 1000 digits) by about 25%. |
| 349 |
|
| 350 |
* Speed up the computation of pi, e, exp, log, sin, cos, tan, sinh, cosh, tanh, |
| 351 |
asin, acos, atan, asinh, acosh, atanh. |
| 352 |
All of them are now computed with asymptotically fast algorithms, of |
| 353 |
bit complexity O(log(N)^2*M(N)) = O(N^(1+epsilon)) for N digits. |
| 354 |
|
| 355 |
It's not worth the effort: Most people really interested in fast numerics are |
| 356 |
already using CLN, NTL, or a similar library. CLISP is already the champion |
| 357 |
among the Common Lisp implementations regarding bignum performance. |
| 358 |
|
| 359 |
|
| 360 |
Block the signals SIGHUP SIGPIPE SIGTERM SIGXCPU SIGXFSZ during GC, and |
| 361 |
when they occur outside of GC, do a quit(1); . |
| 362 |
|
| 363 |
Programs that deal too much with signals tend to be unfriendly. I hate |
| 364 |
programs which stay alive when I try to kill them. |
| 365 |
|
| 366 |
|
| 367 |
CLtL2 issue |
| 368 |
; <162> sharp-comma confusion no io.d |
| 369 |
|
| 370 |
Backward compatibility to CLtL2. Doesn't cost much. |
| 371 |
|
| 372 |
|
| 373 |
CLtL2 issue |
| 374 |
; <174> syntactic environment access no |
| 375 |
|
| 376 |
It never made it into ANSI CL. |
| 377 |
|
| 378 |
|
| 379 |
CLtL2 issue |
| 380 |
; <176> :TEST-NOT, -IF-NOT no sequence.d, list.d |
| 381 |
|
| 382 |
It's a bad idea because REMOVE-IF-NOT is a kind of "positive filter", which |
| 383 |
is more confusing when expressed as REMOVE of COMPLEMENT. Also, COMPLEMENT |
| 384 |
is harder to understand than XXX-IF-NOT because COMPLEMENT is a function |
| 385 |
returning a function. |
| 386 |
|
| 387 |
;; Local Variables: |
| 388 |
;; mode: bug-reference |
| 389 |
;; bug-reference-url-format: clisp-bug-reference-url-format |
| 390 |
;; End: |