freenode/#clasp - IRC Chatlog
Search
2:33:45
drmeister
I think this will fix the problem with multithreaded slime - but I haven't tested it yet with cclasp.
3:13:56
drmeister
(defclass foo () ((arga :initarg :arga :accessor arga) (argb :initarg :argb :accessor argb)))
4:25:25
drmeister
::notify Bike We aren't taking full advantage of these new fastgf optimized slot accessors. ECL's std-class-optimized-accessors are still using hash tables. This is revealed by profiling allocation of CLOS objects.
10:36:50
drmeister
::notify kpoek There are instructions about a symbolic link that you may need to use on OS X to get rid of those missing header file messages: https://github.com/drmeister/clasp/wiki/Clasp-0.5-Build-Instructions
12:42:08
Colleen
Bike: drmeister said 8 hours, 41 minutes ago: cclasp works with slime in :spawn mode - we are back in business.
12:42:08
Colleen
Bike: drmeister said 8 hours, 16 minutes ago: We aren't taking full advantage of these new fastgf optimized slot accessors. ECL's std-class-optimized-accessors are still using hash tables. This is revealed by profiling allocation of CLOS objects.
12:52:30
beach
I would like to make the following changes to Generate-AST, CST-to-AST, and AST-to-HIR:
12:52:43
beach
First, Generate-AST and CST-to-AST should not enter the AST corresponding to a variable into the environment. Instead, it should enter an instance of a new class, that we may call VARIABLE and which is not an AST (so it has no source information).
12:52:49
beach
Next, Generate-AST and CST-to-AST should create a new AST for each variable reference, and instead of the name of the variable, the AST should contain a reference to the unique VARIABLE instance. That way, each reference to a variable has its own source location.
12:52:50
beach
To make that work, some changes need to be made to AST-to-HIR, but I think they are fairly limited. It looks like FIND-OR-CREATE-LOCATION needs to be altered so that it uses the VARIABLE to look up the location, rather than using the AST directly.
12:54:51
beach
I should have said: Generate-AST and CST-to-AST should create a new instance of a LEXICAL-AST for each lexical variable reference.
12:57:25
beach
Unfortunately, this change will break all the CST-to-AST tests that I so painstakingly created. :(
12:58:08
beach
But the change is necessary so that we can keep correct source location for each variable reference.
12:58:32
Bike
I think right now we just put... symbols? cleavir env info? in lexical asts, so having dedicated variables makes more sense to me
12:59:43
Bike
so, in the paper i didn't see reference to when fastgf could be applied. can it only be used on direct instances of standard-generic-function, or is it just that for indirect instances we can only make a dispatching tree out of what we get from calls to compute-applicable-methods-using-classes?
13:02:33
beach
The MOP does not allow the result of compute-applicable-methods to be cached as I recall.
13:03:03
Bike
but we can do something like that for standard-generic-function since it's standard and methods can't be defined etc.
13:05:28
Bike
because it would just be caching on the actual objects, which wouldn't recur so much, i guess. a user could define a compute-applicable-methods method that uses identities different from classes or eql specializers.
13:06:42
Bike
anyway, the other thought i had was that it might make sense to compile effective methods directly into the discriminating function. i think that's /allowed/ anytime since nothing seems to state effective methods have to be functions and they aren't accessible, and i think it could be a good idea because most of the time they're pretty simple. any thoughts? i looked through sicl and it doesn't seem to do this.
13:08:20
beach
That ought to be possible, yes. There are many optimizations that I have not yet done in SICL.
13:08:31
drmeister
FYI Clasp's fastgf implementation does test for EQL specializers - and does check if the effective method function can be memoized here:
13:08:31
drmeister
https://github.com/drmeister/clasp/blob/dev/src/lisp/kernel/clos/closfastgf.lsp#L527
13:10:37
drmeister
https://github.com/drmeister/clasp/blob/dev/src/lisp/kernel/clos/closfastgf.lsp#L522
13:17:23
beach
That's not a good reason in my book. It distracts the maintainer and makes him or her look for a more profound reason, such as the existence of special tools.
13:18:49
Shinmera
I'm sure he cares, but is often too deep in things and busy with stuff to think about making thins well readable.
13:19:58
drmeister
What Shinmera said - I'm usually in a headlong rush to get things working because I'm working under extreme pressure - largely self imposed.
13:19:59
beach
Well, a large part of programming is being meticulous and pedantic. When I see messy comments or messy code, I don't get the impression of good quality code.
13:21:06
Shinmera
Some people tend to try and push cleaning things up to a later point in favour of quick progress in the moment. That doesn't mean they don't care about other people reading their code.
13:23:34
Shinmera
That's beside the point. I'm merely arguing that unclean code does not imply that they don't care.
13:27:04
Bike
well, if nothing else, i'm going to look over the fastgf code in the next few days to make adjustments, i can rewrite comments as i do
13:27:30
Bike
i tend to go through erasing #+(or) blocks we're not going to need and so on whenever i make changes in a file
13:28:17
Bike
but as far as not cleaning up though, i just noticed this yesterday and it's probably older than i am https://github.com/drmeister/clasp/blob/master/src/lisp/kernel/lsp/loop2.lsp#L127-L137
13:33:29
Bike
i think it was like, you'd go through the list normally, and then when you hit a cdr-coded end you go through like an array
13:35:20
Bike
i think the idea of copylist* was that if you copied a list you were going to rplacd the end of later, cdr coding didn't make sense, so you'd want to use a normal list for the copy
13:37:26
drmeister
Anyway Bike - I noticed that there are still slot accesses that are going through hash-tables - probably because the code I wrote doesn't apply the optimization to anything other than standard-reader-method.
13:38:48
drmeister
Also, the optimized accessors aren't fully inlined yet - I've been rearranging code to achieve that.
13:39:03
beach
I think CDR was defined to look what kind of cell the pointer points do. If it points to a CDR coded cell, then instead of making a memory read, it just adds 1 to the address.
13:41:08
drmeister
Also... quicklisp fails to build because I think one of the other optimized accessors is being generated - a CONS instead of an index for the slot. We talked about this one. I think we are about to find out what they are for.
13:41:55
beach
You can't use that technique for slots with allocation :CLASS if that is what you mean.
13:42:33
drmeister
Yeah - the ECL CLOS code is involved here as well, it has it's own way to optimize accessors. I don't want to break it because then I can't use ECL's dispatch during startup.
13:42:43
Shinmera
You theoretically could if you make sure to copy the value to all instances when it's updated.
13:43:34
drmeister
Got it - ok - I have code to deal with it but it's not fully operational yet because I didn't understand what it was supposed to do.
13:44:21
Shinmera
Speaking of that, how does the make-instances-obsolete/update-instance-for-redefined-class mechanism works? Does the instance itself check if the class has been updated?
13:44:54
drmeister
There's a code path for it that ends in a construction site and a sign that says "Figure out what you are supposed to do here".
13:45:01
Shinmera
If I recall what the CLHS says it's not specific about /when/ u-i-f-r-c is called.
13:45:30
beach
Shinmera: The class gets a new unique number, and all generic functions that dispatch on that class are invalidated.
13:46:02
beach
Shinmera: That way, as soon as an object is being used in a non-trivial way, it fails the dispatch and is updated accordingly.
13:47:40
drmeister
Shinmera: That's one of the really nice and only recently appreciated features (by me) of fastgf.
13:48:07
Shinmera
beach: Could the cache not miss for another reason? If so, wouldn't that incur unnecessary calls to u-i-f-r-c?
13:49:11
beach
Shinmera: This trick relies on the fact that, in order to access the contents of an object, some generic function must be called.
13:49:32
Shinmera
I used to keep explicit lists of weak pointers from the class to its instances before I realised I could use u-i-f-r-c for most of what I had to do.
13:51:08
specbot
standard-instance-access: http://metamodular.com/CLOS-MOP/standard-instance-access.html
13:54:15
Bike
i think we might still not support it on clasp, since someone in ECL there's an exported function with the effect
13:57:19
Bike
the first actual thing i should do once dev rebuilds is figure out source tracking for generic functions and methods
14:14:51
Bike
yeah. clasp tracks function source locations with, i think, a part of the macroexpansion
14:26:14
beach
OK, I think the best way is to eliminate Generate-AST first, so as to avoid redundant changes. For that, I need to retrofit some of the code I omitted in CST-to-AST, like inserting THE-ASTs and such.
14:26:51
beach
Also, I still have a call to EVAL in CST-to-AST, and that one still uses Generate-AST as I recall.
14:27:55
beach
I also need to provide some temporary compatibility in the form of a version of GENERATE-AST that calls CST-FROM-EXPRESSION and then CST-to-AST.