freenode/#clasp - IRC Chatlog
Search
18:37:28
drmeister
Hmmm, I added specialized vectors and they aren't being recognized as subtypes of 'vector.
18:39:51
drmeister
I'm relieved - it's breaking ironclad which is breaking cl-jupyter - but it's not some scary function calling thing.
18:43:16
drmeister
I have a complicated multistep procedure to add specialized vector/arrays and it may not yet completely mesh with what the ECL subtypep needs.
19:25:20
drmeister
None of my new specialized array classes are being recognized with (subtypep xxx 'vector) or (subtypep xxx 'array)
19:31:47
drmeister
If anyone has suggestions of how to tie these specialized array classes into the type system so that subtypep works with them - I'd very much appreciate the help.
19:32:31
drmeister
Generic function dispatch with the specialized arrays won't work because (subtypep (class-of arg) 'vector) isn't returning the correct result.
20:13:30
drmeister
It means I still have to weave 'core:simple-vector-int8-t into the SUBTYPEP framework
20:47:17
Bike
'foo and (find-class 'foo) should be identical as far as any type related function is concerned, if the class exists.
20:56:43
drmeister
Adding those classes to hierarchy.lisp was sufficient to get GF dispatch to work properly.
20:58:11
drmeister
The question is then how to make subtypep work. If I told subtypep that these classes are equivalent to 'vector and 'array - I think that might be enough.
20:59:09
Bike
if you tell it a specialized array class is identical to vector it will give wrong answers.
20:59:50
drmeister
Right - what if it says that a specialized array class with one dimension was an array but didn't say it was a vector?
21:00:35
drmeister
Each type (int32, int16 etc) that I have a specialized array on has three new classes.
21:01:11
Bike
But one of those classes includes all specialized arrays with that specialization, including non-vectors?
21:01:24
drmeister
The md-array-xxx and simple-array-xxx are subtypes of array and if DIM=1 subtypes of vector
21:02:20
Bike
"array" refers to a particular set of objects, which includes non-vectors, so array is not a subtype of vector
21:02:55
Bike
if md-array-fixnum is the set of all arrays that are specialized to FIXNUM, md-array-fixnum is not a subtype of vector
21:05:23
Bike
a type is a set of objects. a class is an object that is sometimes identified with a type.
21:05:33
drmeister
An md-array-fixnum can represent an array of fixnums with any rank - those are all subtypes of 'array. It it has rank = 1 is it not a subtype of 'vector?
21:06:26
Bike
that class (or the type identified with it) contains some objects that are vectors, and some that are not.
21:06:43
Bike
since it contains objects that are not vectors, the class/type can't be a subtype of vector.
21:13:10
drmeister
https://github.com/drmeister/clasp/blob/dev/src/lisp/kernel/lsp/predlib.lsp#L1506
21:17:10
Bike
it looks like it canonicalizes types. and for classes it calls register-class. that does i think find-registered-tag to find "classes which belong to the core type system of LISP (ARRAY, NUMBER, etc)"
21:21:45
Bike
that would work except simple-vector doesn't work like that. it would be (simple-array byte32 (*)) i think.
21:51:54
drmeister
I hope it means that (subtypep 'core:simple-vector-byte8-t 'vector) will now return T
21:52:56
drmeister
https://github.com/drmeister/clasp/blob/dev/src/lisp/kernel/lsp/predlib.lsp#L1252
3:46:23
Bike
i wrote eliminate-superfluous-temporaries again. on a big function it takes ~55 ms and reduces the number of variables 43%, and the time for mark-dynamic-extent by about the same fraction. so i should probably see about testing it thoroughly for incorporation
3:47:59
beach
Sounds good. I hope you used the correct definition of "superfluous", unlike what I did in the first version.
3:49:07
Bike
well basically what it does is, it looks at all inputs to all instructions, and if the instruction is dominated by an assignment to an input, it replaces that input with whatever the input to the assignment is.
3:49:35
Bike
so i think it's correct. i actually made it dumber than it could be because i figured it would be enough (and was apparently correct)