TEXT   3

bugs.txt

Guest on 20th July 2021 03:00:20 PM

  1. $Id: BUGS,v 1.14 setlorg Exp $
  2.  
  3. Free software (c) dB - see file COPYING for license (GPL).
  4.  
  5.  
  6. Known bugs in GNU SETL
  7. ----------------------
  8.  
  9. - PI should probably be built in, so you don't have to put
  10.   "CONST pi = 4 * ATAN 1" or whatever at the top of so many programs.
  11.  
  12. - It is odd that there is no WRITES or PRINTS to complement READS, but
  13.   not a show-stopper given STR and the semantics of '+' (implicit
  14.   conversion to string whenever at least one operand is a string).
  15.  
  16. - EXIT may be followed by loop header tokens as in good old CIMS SETL,
  17.   not an expression as in SETL2.
  18.  
  19. - In a few places, integers are not unbounded, but are limited to the
  20.   range of a C "long int".  I would be very interested to know if any
  21.   of these cases seem unreasonable to anybody - they tend to be things
  22.   like subscripts and replication factors, where memory constraints
  23.   impose a practical limit anyway, but also include the F, N, and L in
  24.   F..L and F,N..L expressions, where ease of implementation and the
  25.   weak demands of efficiency happen to pull in the same direction.
  26.   (You can easily work around this silly restriction, of course, simply
  27.   by iterating in a more moderate range and then mapping upward using
  28.   the regular integer arithmetic, which is unbounded.)
  29.  
  30. - The LALR(1) parser in 'setltran' tends not to give very helpful error
  31.   diagnostics.
  32.  
  33. - Run-time error reporting tends to point to the rightmost part of
  34.   larger expression (if any) in which the error occurs, rather than
  35.   pinpointing the true offender.
  36.  
  37. - Floating-point operations can produce numbers that print or are
  38.   converted by STR to "nan", "inf", or "-inf", but "nan" and "inf" are
  39.   treated as strings on input (by virtue of their having the form of
  40.   identifiers), and "-inf" is treated as an error.  This applies to
  41.   READ, READA, READS, GETB, VAL, and UNSTR.
  42.  
  43. - There is no direct way to get an effect like sprintf's "g" format
  44.   combined with precision control; FIXED is like "f", FLOATING is like
  45.   "e", and STR is like "g" but without the means to control the number
  46.   of significant digits.
  47.  
  48. - You can write atoms (created by NEWAT or copied) and convert them to
  49.   strings, but you can't read them nor create them via UNSTR or READS.
  50.   This is actually a deliberate design decision, but may be surprising
  51.   to some.
  52.  
  53. - FSIZE is not compatible with SETL2.  Also, it should probably be
  54.   extended to allow a stream designator (fd).
  55.  
  56. - There is no LSTAT, though for a symbolic link f, you can get that
  57.   information via READLINK f.
  58.  
  59. - Patterns that match long strings can fail to match.  For example,
  60.  
  61.     s1 := 'abc';
  62.     print(s1('a.*c'));
  63.     s2 := 'a'+9999*'b'+'c';
  64.     print(s2('a.*c'));
  65.  
  66.   prints abc on a line but then prints * (which stands for OM), rather
  67.   than the appropriate 10001-character string.  This is a deficiency
  68.   inherited from GNU regex-0.12.
  69.  
  70. - Forms like [-,x] are allowed in "lhs" positions but not in WR-only
  71.   actual arg positions (e.g., READ([-,x])), due to limitations in the
  72.   current LALR(1) parser.  The workaround is to use a variable name
  73.   such as 'dummy' in place of the hyphen (e.g., READ([dummy,x])).
  74.  
  75. - %s in FDATE format specs (standing for the 3-digit representation of
  76.   milliseconds within the second) conflicts with a (nonstandard) GNU
  77.   extension to strftime() meaning number of seconds since the beginning
  78.   of 1970.  But you can get the latter number directly as TOD DIV 1000.
  79.  
  80. - The macro processor treats "#" as a very special character (unary # is
  81.   an argument stringifier, and binary ## is a concatenator).  Thus you
  82.   are denied access to the cardinality operator and to radix denotations
  83.   within macro definitions.  For those who are sufficiently hard-core,
  84.   it is still possible to get a # to show up in the code emitted by a
  85.   macro by means of a truly horrible workaround, illustrated by
  86.  
  87.     #define f(op,arg) op##arg
  88.      ...
  89.     f(#,x)  -- emits #x !
  90.  
  91. - With some effort, you can nest a tuple deeply enough to cause C stack
  92.   overflow in the garbage collector, e.g.:
  93.  
  94.     t := [];
  95.     loop
  96.       t := [t];
  97.     end loop;
  98.  
  99.   Note that the time taken by this program is quadratic in the number
  100.   of loop iterations, in the current implementation.  The interpreter
  101.   will, however, segfault after perhaps half an hour or so, given a
  102.   stack size limit of 8MB.  You can of course change this on most POSIXy
  103.   systems.  For example, in the Bash shell, to make it 64MB, the prior
  104.   command "ulimit -s 65536" does the trick.
  105.  
  106.   As of this writing, I know of no way other than by creating such a
  107.   pathologically nested structure to get 'setl' to crash (in this case
  108.   with a SIGSEGV or SIGBUS) without issuing its own diagnostic.

Raw Paste


Login or Register to edit or fork this paste. It's free.