freenode/#clasp - IRC Chatlog
Search
13:39:08
beach
Progress! I can convert a CST corresponding to (function (lambda (x) x)) to an AST. Now working on (function (lambda (x) (declare (special x)) x)).
13:42:24
beach
Bike: At some later point I have a question for you about alien-declarations. You carefully pass them to the canonicalizer, and then they are ignored by it. I would think either not pass them at all, or use them to signal an error if some unknown declaration specifier is passed.
13:43:07
Bike
there was some code in cleavir-env that used an incorrect declaration by accident, and sbcl caught it but not cleavir.
13:47:56
Bike
in https://github.com/robert-strandh/SICL/blob/master/Code/Cleavir/Code-utilities/declarations.lisp#L71-L79 i mean.
13:47:59
beach
OK, I thought that the TYPE symbol had already been added. I must have been wrong about that.
13:48:43
Bike
still, i think a warning (or an error, which the implementation downgrades to a warning) would be preferable
13:49:49
beach
It is implementation-specific stuff, but I think there is a protocol function for it, no?
13:51:19
beach
OK, better add such a thing then. Say type-function, to be analogous to macro-function. I'll give it some thought.
13:51:35
beach
I need to look at what form such a declaration may take. Does it have to be a symbol?
13:53:07
Bike
type-function wouldn't be quite enough, unless you also want to hardcode CL types that don't necessarily expand into anything, and disallow implementation types that aren't also classes
13:58:35
beach
Well, implementations that allow that can not use Cleavir then, at least not to compile code with non-conforming type declarations.
13:59:09
beach
In other words, I am not planning to take that possibility into account. We have enough implementation-specific stuff as it is.
14:35:43
beach
I mean, it would be perfectly valid to write a bug report to the maintainer of such a library, asking him or her to add the word TYPE.
14:39:18
Shinmera
Given that I think (declare (some-type foo)) is bad style anyway, I think being strict is the right thing to do.
14:43:34
Bike
you'd get compatibility pushback. i mean, i agree too, but there's a lot of code with declare fixnum
15:22:45
Bike
the idea of doing special variable bindings by calling a function was in there before i touched cleavir. I did however go back and change it so that it doesn't have to be a function call
15:23:28
Bike
The way it was before, the generate-ast code for special variable bindings would directly generate a function call AST, to the fdefinition of call-with-variable-bound
15:23:42
Bike
so that would bypass the environment lookup of what kind of operator call-with-variable-bound is
15:24:06
Bike
So if you just have something like "every cleavir-primop symbol is a special operator" you might not have noticed it before?
16:06:48
Bike
do you set up the cleavir and sicl environments separately? i had the impression that you did.
16:07:18
beach
Possibly. I am too tired after a long day of work to think clearly. I'll deal with it tomorrow.
18:15:45
drmeister
How would we implement first class global environments? I just read the paper and it provides the protocol functions and says that symbol value slots and function slots are stored outside of the symbols in CONS cells (in SICL) and within a structure that represents the global environment.
18:16:47
drmeister
For thread local bindings for special variables I'm attaching a unique fixnum to each symbol so that it can index into thread local arrays of bindings - is it like that - but every symbol has a fixnum?
18:18:09
drmeister
I'm asking now because I'm thinking about putting Cando demos on the internet so people can fool around with them.
18:20:06
drmeister
For demos to specific people I can get away with what I have now. But a wider release - to develop "apps" to build different kinds of molecules using jupyter notebooks and then giving people access to those apps is precluded by not being able to sandbox Cando.
18:21:23
Bike
to get the function or value cell for a symbol you do kind of a hash lookup. but that's only necessary for actual global function and variable lookups, ie fdefinition and symbol-value
18:21:54
Bike
if you know the symbol at compile time you just refer to the cell in the compiled code (with load-time-value)
20:03:19
drmeister
I guess thread local bindings are handled the same as before - each symbol with thread local bindings is given a small integer index from a pool of indices that index into a thread local binding vector.
20:05:13
Bike
Like, if you have (foo 4) in your code, that gets compiled as something like (cleavir-primop:funcall (get-cell-function (load-time-value (lookup-function-cell 'foo))) 4)
20:05:30
Bike
so lookup-function-cell looks in whatever the present environment is at load time, and links in the right cell