freenode/#sicl - IRC Chatlog
Search
3:23:33
Bike
the plan with hoisting eventually was to move it to later stages so that AST and HIR transformations can work with constants, right?
3:24:14
Bike
the transformations, i mean... i know heisig was doing something with the actual hoisting
3:26:16
Bike
hopefully not a function, since those can't be dumped. but yeah, something with a make-load-form method
3:26:33
Bike
i _think_ clasp is already set up to do hoisting in a later stage, it just doesn't most of the time
3:27:05
Bike
so i'm hoping i can work out how to write the transformations and then worry about the arrangement of the loader later
3:27:59
Bike
i'd like to fix the thing where e.g. (if (null x) ...) turns into (if (eq (if (eq x nil) t nil) nil) ...), it's kind of silly
8:40:58
jackdaniel
ECL now has stamps. They are not used yet for the fastgf, but I've fixed another issue by implementing them (so it will be easier later with fastgf)
9:38:35
jackdaniel
from less great notes I'm seriously considering declining to give the keynote talk at els, I have really little time for anything given we juggle the little one with my wife due to quarantine, and two weeks is just too short notice for me in the current situation
9:39:44
beach
I am certainly not going to participate. The talks are not the reason I go. But as an author I should attempt to record my own talks.
11:04:05
alandipert
jackdaniel i feel your pain re: juggling of little one. i'm gonna try to record a talk but i already know it's not gonna be great :\
13:12:33
Bike
we need to be able to do transformations that rely on actually having constants around.
13:13:23
beach
And we need type information at the HIR level for type inference and constant propagation.
13:13:54
beach
As I recall, we decided to keep the constant in HIR but also generate code to create it, at the AST level.
13:21:02
heisig
OK, what Bike says is that a compiler should be able to add and remove arbitrary constants at any time.
13:22:59
beach
It is much easier to deal with code for creating complicated constants at the AST level.
13:24:19
Bike
well the basic thing i want to be able to see the values of constants. like as far as I know right now there's hardly even a way to tell that a given input in HIR even is constant, let alone what its value is
13:26:25
Bike
i don't think we'll need to add new constants other than built in stuff, so i'm not too worried about that
13:27:48
Bike
we probably also want to break up constants, e.g. (let ((x constant)) (member y x)) could be reduced to a case
13:28:56
heisig
But now we have diverged from a discussion about hoisting to a discussion about CL type systems.
13:29:19
Bike
actually, for member you might want to introduce new list constants for the return value, and have them coalesced
13:50:12
Bike
or: (let ((x '(vector (unsigned-byte 8)))) (make-sequence x 14)) => (make-array 14 :element-type '(unsigned-byte 8))
13:53:45
heisig
Bike: In your examples, both the second argument to member and the first argument to make-sequence could be represented as an EQL type.
13:55:31
Bike
you're right about eql types. but like, how it's accomplished isn't so much my concern - cleavir cannot do these right now, which i think is really inadequate for an optimizing compiler.
13:55:51
Bike
in clasp I have them done at source level, but that means you need the literal constant in the make-sequence call or whatever - introducing the let binding inhibits it. that is dumb.
13:57:14
heisig
Sounds to me what we really need is a SICL module for manipulating Common Lisp types.
13:58:00
Bike
beach and i talked about that quite a while ago, but it would basically mean another customization layer, since implementations often extend the type system
14:00:05
heisig
All implementations do is to add a few subtypes here and there. I think it should be possible to write a library that works for everyone.
14:00:31
heisig
Also, I recall scymtym had some very good ideas on how such a library could look like.
14:02:45
heisig
Maybe I should talk to scymtym, and then take a week of vacation and write a prototype.
14:05:05
Bike
some of it's still lying around waiting to be incorporated into clasp. i just focused on doing typecase fast, so it doesn't need to e.g. precisely compute joins or meets, which is a pain to do
14:06:07
heisig
I feel motivated to work on such a library. The question is whether I find enough free time to write it.
14:07:51
Bike
https://github.com/Bike/typecase/blob/master/typecase.lisp let's see... yeah, array types, cons types, numeric ranges, and or not satisfies, classes
14:09:12
beach
For type stuff, including subtypep, we should pay attention to the research by Didier Verna, Jim Newton, et al.
14:10:04
Bike
my code here is based on the assumption that you have something like class numbers so you can distinguish the class of an object very quickly, which I don't think newton was doing
14:10:43
Bike
for everything beyond that my code is worse, though, so that would be where they come in
14:12:38
Bike
it probably is applicable. I don't remember all the details of newton's ELS presentation, but i think he was focused on different kinds of types from me
14:13:01
Bike
for this code I was focusing on a typecase that barely does anything fancy with and/or/not, but he was doing all that algebraic stuff
14:16:39
Bike
well, anyway. if constant propagation takes more thinking i should do something else, like CASE. I was thinking that, like IF, what we could do is have a multiway-branch-ast (or something) analogous to if-ast, and then e.g. a fixnum-case-ast or char-case-ast or etc as the tests
14:17:17
Bike
if they have immediate-inputs as inputs i can probably compile them efficiently without worrying about constants too much