freenode/#sicl - IRC Chatlog
Search
13:10:29
heisig
beach: To answer your question from yesterday - yes, sealable metaobjects can be used to implement binary number functions.
13:12:19
heisig
In fact, I think a lot of the functions in the CL package could be made generic that way.
13:16:39
heisig
Number and sequence functions are a natural fit. But arrays, streams and hash tables could also profit a lot from using that technique.
14:19:35
beach
Having given some thought to the latter two, I think they are too SICL-specific to be part of Cleavir, at least for now.
14:20:13
beach
So I should just bite the bullet and make SICL-specific systems for additional primops, AST classes, and instruction classes.
14:25:58
beach
The dynamic environment is in a lexical variable, so the primop and AST would return the value of that variable.
14:26:25
beach
The instruction would have an output that will be assigned to the current dynamic environment.
14:27:28
beach
So that I can write the function that augments the dynamic environment with a variable binding.
14:29:06
beach
(defun augment-with-special-variable (name value) (cons (make-instance 'special-variable-entry :name name :value value) (sicl-primop:dynamic-environment)))
14:29:34
Bike
seems a little circular, but i suppose you don't want to write out calls to make-instance in IR...
14:31:22
Bike
well, maybe more convoluted than circular? you have a bind instruction but it turns into a call, and the definition of that function needs this other instruction
14:32:07
beach
The bind-instruction exists because each implementation may bind variables differently.
14:32:38
beach
SICL uses deep binding, so it makes sense to put a special-variable entry on the dynamic environment.
14:33:09
beach
Doing so is a fairly complicated operation that would justify abstracting it to a function.
14:35:44
beach
I just add a HIR transformation that turns the BIND-INSTRUCTION into a function call.
14:35:47
Bike
have the function take a pointer to memory to fill or something... would be pretty weird in common lisp
14:37:11
Bike
Well you're talking about augment-with-special-variable putting the dynamic variable entry on the stack, right? The stack of the function using bind-instruction.
14:38:28
beach
Other things need to be allocated on the stack, so there may have to be some assembly code for the lowest level allocators, like cons-stack, allocate-instance-stack.
14:39:01
Bike
being able to stack allocate make-instance results would be a novel features among lisp implementations, i think. sbcl can't do it
14:39:14
Bike
maybe if you did the static optimization stuff so you don't need to actually call methods...
14:39:55
Bike
I mean in general you don't know what's allocated, since there can be methods on make-instance and allocate-instance.
14:43:34
heisig
I very much prefer the idea of making heap allocation as fast as possible and forgetting about all that dynamic extent stuff.
14:46:59
beach
Entries that have true dynamic extent would be allocated in the nursery, so whether we can make that fast enough depends on how frequent such allocation is and how fast the nursery garbage collector is.
14:56:04
beach
I see. But that was not the main concern when I did that. The main concern was to have very fine control over which definitions happen when during bootstrapping.
14:57:07
Shinmera
dx is good not just because of allocation speed but also because of data locality.
14:57:10
Bike
ah, yeah, it is honestly kind of confusing to read through like five whatever-support-c.lisp files. But you gotta do what you gotta do
14:58:14
beach
Once I have the bootstrapping procedure working, I might see what things can be regrouped.
15:00:54
Shinmera
beach: does the nursery also deallocate eagerly to preserve that locality in the face of many stack allocations and deallocations?
15:11:06
Shinmera
Needless to say I have, especially when dealing with huge code bases, or searching across all of my projects.
18:55:05
jackdaniel
if anyone is interested in ecl underpinnings then reading original kcl paper is highly recommended
19:14:49
shka_
i was wondering if you notices some parallels regarding clear style as described in the art of the style and programming