freenode/#sicl - IRC Chatlog
Search
14:06:30
Bike
oh, so for deftype you axe all the methods, put in a new one on T that just does the type predicate.
14:08:44
scymtym
so answering the original question, SBCL inserts SB-KERNEL::CACHED-TYPEP if the type is undefined and a SB-KERNEL:CLASSOID-CELL-TYPEP if a class-based is chosen for the type
14:10:31
scymtym
i don't see how the latter can work if the type is redefined in way that makes the class-based test inappropriate, but i haven't tried it
14:10:34
beach
Does it mean that SBCL takes advantage of the fact that types can not be redefined between compile time and run time? Other than classes.
14:17:11
beach
It might be necessary to invent a new type of generic function and new types of methods.
14:19:23
beach
Methods on compute-applicable-methods-using-classes, compute-discriminating-function, compute-effective-method, at least.
14:19:57
beach
Plus the description of how the call history is impacted. Clearing it will probably always work, but there might be smarter things to do.
14:20:45
beach
Like if you have classes FOO (), BAR (FOO), BAZ (BAR) and you redefine BAZ not to be a subclass anymore, you can leave entries on BAR in the call history.
14:22:34
Bike
Well i mean we can, right now, define (defgeneric foop (x) (:method ((x foo)) t) (:method (x) nil)), and it has to work and be sensitive to redefinitions of subclasses and so on.
14:23:23
beach
It doesn't matter much. People don't like to see "go read that other paper first, before you bother reading this one".
14:25:43
beach
The main claim though is that this technique is faster than what is currently done, while being more flexible about redefined types between compile time and run time.
14:27:08
Bike
as far as actual code goes i can get some numbers on how a generic function compares to a cpl search in clasp, at least
14:27:53
beach
And you can also do an estimate of the work involved in *any* implementation for both solutions.
14:29:07
Bike
yeah, i mean, it's a linear search rather than a binary search, though it's a bit complicated by the fact i imagine the class will usually pbe pretty close to the front of the cpl
14:34:02
beach
And, to get to the class precedence list, you need another generic-function call I would think.
14:34:50
beach
So put yourself in the situation of an implementation without the fast generic dispatch.
14:35:57
beach
So you might be looking at a dozen or so additional memory accesses for existing implementations.
14:36:54
jcowan
beach: in response to your question about how predicate-based (rather than type-based) generic function dispatch can be made efficient, I do require any such predicates to be pure and functional, and I may introduce the idea of a predicate being "too complex" in an implementation-specific way
14:37:19
jcowan
though to my mind, if you want to dispatch on the primality of an integer argument, you should be prepared to pay the price of it.
14:43:11
scymtym
the most complicated part was introducing lexical bindings for the match variables in the patterns
15:24:58
shka_
You were not kidding when you said that writing common lisp implementation in full common lisp makes it a lot simpler
15:28:48
beach
He is a very smart man. I would not have the wisdom to lower my expectation for political reasons.
15:30:00
beach
In his place, I would have made the wrong decision, and nobody would have been using my stuff.
15:34:09
beach
Free software is an established concept, so one can hope that it would be possible to pay more attention to things like security.
15:40:49
beach
He is basically explaining that there are extremely few people in my situation, i.e., who don't need grants, who already have tenure, who are not going to be promoted before retirement, so they can do what they want.
20:57:03
jcowan
If there had been a SBCL-class compiler for CL in 1987, then GCC-in-CL might have been feasible. But CMUCL was only running in MacLisp at that point.
20:58:27
jcowan
the earlier compiler was running on the Perq and on MIPS machines, but was certainly not suitable for writing a general purpose C compiler in, not to mention a portable one