freenode/#sicl - IRC Chatlog
Search
19:25:41
beach
But what you see is constants used in the error messages of the argument-parsing code.
19:27:09
beach
Or rather, you see those constants being fetched from the static environment of the top-level function, and you see cells being allocated to store those constants, and you see those cells being stored in the static environment of the closure that is eventually created.
22:01:56
Bike
ran into something possibly interesting. When the compiler finds sequence function calls it doesn't know the types of the sequence arguments of, we have to do some kind of type testing at runtime. Sometimes it might make sense to have a different version for every type of sequence (lists, vectors of various element type and simplicity) but
22:01:57
Bike
sometimes that might get explosive, like when MAP has an indefinite or unknown number of arguments
22:02:29
Bike
in that case clasp uses a sequence iterator protocol that's roughly like the extensible protocol. i'm currently fixing clasp's to be the extensible protocol
22:03:28
Bike
the core of that protocol is make-sequence-iterator, which is a generic function that returns a bunch of values. the values represent the state of the iteration and also, what i didn't fully appreciate before, functions for doing the traversal
22:04:16
Bike
this means that in the body of the loop, you just call those functions, instead of including a type discrimination. avoiding the branch is like a 2x speedup in some quick tests, and that's clasp's dumb version
22:05:30
Bike
plus, in clasp's and sbcl's iterators, vectors are all treated the same, so you call a dispatching aref of some kind during the loop. but if you just specialized make-sequence-iterator for different vector types, the returned functions could be low level array accessors, without losing safety
22:10:41
Bike
...and then i guess we could teach the compiler a little about make-sequence-iterator, so that it's rewritten to include the functions in a way the compiler can see, if the type of the sequence is known. and then it just inlines those.