This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

So far, so good.


Hi everybody.

Here's some good news:  Guile is very close to compile with strict
typing.  To give a little more detail:

* On march, 27th there were 3330 compilation errors.  Now there are only
  143 compilation errors left.
* Of these 143 compilation errors,
  - 83 are due to the 'SCM value as case label' problem
  - 24 are due to errors in numbers.c, which are easy to fix, but I want
    to wait with it until the performance degradation problem is solved.
  - 20 are due to the 'SCM value as initializer' problem
  - 6 are in options.c.  The options code needs some cleanup, IMHO.
  - 5 are due to the fact, that generic functions are initialized
    with zero. (lines: eval.c 3573, objects.c 152, print.c 358, 613,
    procs.c 141)
  - 2 are tests of a SCM value agains zero in read.c (lines 203, 217).  I
    don't know if these tests make sense.
  - 2 pass C zero values as SCM parameters to narrow_stack in stacks.c
    (lines 497, 499).  Maybe it would be possible to use some valid scheme
    value here?
  - 1 is due to plain sick code in eval.c, line 1380.


1)
To solve the 'SCM value as case label' problem, it would be necessary to
provide a corresponding raw (i. e. unpacked) value for each SCM
value.  This could look as follows:

#define SCM_BOOL_T_WORD		SCM_MAKIFLAG (17)
#define SCM_BOOL_T 		SCM_PACK (SCM_MAKIFLAG (17))

In case labels, the SCM_BOOL_T_WORD macro would have to be used.  I don't
know if we want to go that way, or simply accept that we can not actually
produce an executable with strict typing enabled.


2)
The 'SCM value as initializer' problem could be solved (or left
unsolved) in a similar way.  A lot of these initializations are for
options.  Maybe for these cases a better solution could be found.


3)
The generic function issue:  As long as there is no generic function
defined, the corresponding SCM value is set to zero.  However, I have the
impression, that always if this value is tested and found to be zero, an
error is signalled.  Wouldn't it be better, to _always_ initialize the
generic function, such that the default if nothing fits would be the error
message?  Then, a lot of code like
  if (gf)
    scm_apply_generic (gf, scm_cons (proc, args));
  else
    scm_wrong_type_arg (who, i + 2, ve[i]);
would simply reduce to
  scm_apply_generic (gf, scm_cons (proc, args));
and there is always at least _one_ method for which the parameters fit,
namely the function which then signals the wrong type argument error.  It
shouldn't be a performance issue, since for the cases when no generic
function was defined, an error would be signalled anyway.

Just a (possibly stupid) idea.


4) Except for the numbers.c errors, it would be kind if others who are
more familiar with the corresponding parts of guile could take a look at
those.


Best regards
Dirk Herrmann



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]