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]

Re: thanks



On Sun, 5 Dec 1999, Han-Wen Nienhuys wrote:
> as an aside, as the gh_ interface is more high-level, I expected it to
> do more typechecking, but was disappointed. Are there any thoughts on
> providing an interface that doesn't dump core when you pass it the
> wrong type of argument?

And Dirk Herrmann replied:
DH> The problem with this is, that if you have to use a different interface,
DH> you will have to change your code after debugging in order to get the best
DH> possible performance.  On the other hand, providing extensive type
DH> checking as a default within libguile (independent of whether this is done 
DH> in the gh_ or the scm_ part of the library) will also not be desired by
DH> many users.

One I read Han-Wen's post, I made the interpretation that he wanted
the existing gh_* interface to do typechecking on arguments,
period. While the solution you suggest sounds attractive (although I
would prefer using the macro NDEBUG from assert.h instead of a new
Guile-specific macro), it also sounds quite complex. I certainly would 
not volunteer my time to add this feature, but maybe I am lazy! :-)

Does anyone have experience with extensive typechecking with respect
to performance? I certainly would like the gh interface to do
typechecking, and I would expect that the performance would *not*
degrade linearly with the number of argument checks in libguile. 
Wouldn't many of the checks be removed by an optimizing compiler 
simply because they are superfluous? I mean, the compiler could
recognize that a type is already guaranteed due to identical checks
previously in the code.

	Lars

-- 
Lars Arvestad               Dept. of Numerical Analysis and Computing Science
                       Royal Institute of Technology (KTH), Stockholm, Sweden

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