libera/commonlisp - IRC Chatlog
Search
15:18:43
jcowan
As for license changes: take a look at the license of Python some time. Most of it is junk DNA that is carried around by the requirement not to strip the license text.
15:28:05
jcowan
That we have so much overlap because nobody is willing to say "I will include stuff in this library for which I myself have no use"
15:38:47
Shinmera
A similar reason that I *do* see is that it often feels like getting changes into an existing project is more effort than just writing a new solution. Or in the very least, it is much less appealing to do so.
21:25:05
jackdaniel
when you have a somewhat large data structure that you know that it does not escape the dynamic extent
21:25:54
jackdaniel
of course the compiler may ignore that declaration whatsoever and go straight to the heap with it
21:26:31
dbotton
I think I am having difficult understanding then when it would be deallocated off the stack
21:27:44
Nilby
Yes. Dynamic extent says the thing won't be used after the function returns. The details of the exact optimization can change
21:28:47
jackdaniel
#2 is invalid (as Bike pointed out), but nothing will crash, because that data is not allocated on the stack
21:30:23
jackdaniel
some implementations may decide to ignore the declaration /unless/ they can formally prove that the value does not escape
21:30:46
jackdaniel
other implementations may trust you and then gleefully have a segmentation fault
21:35:04
jackdaniel
(defun xxx (a) (print a)) (defun yyy () (let ((foo (list 1 2))) (declare (dynamic-extent foo)) (xxx (list* 1 foo)))))
21:35:43
jackdaniel
the list named foo in yyy is available in xxx (and xxx is invoked in the dynamic extent of yyy), but foo is not available for xxx by name
21:38:41
jackdaniel
of course what I did is an undefined behavior, because print returns its argument, and I'm returning the result of xxx, but that's beside the point
21:42:04
Nilby
I don't want to add confusion, but print could call a print-object method that steals the object too.
21:43:38
dbotton
so if you are hinting dynamic-extent to compiler you should tell users of your function not to "steal" your object
21:44:55
jackdaniel
you should not let escape variables with dynamic extent to escape, in other words you should not call functions that may capture the variable outside of it
21:50:18
Nilby
jackdaniel: Sorry, I know you're highly versed in CLIM. Maybe even CLOG can do something similar.
21:51:02
jackdaniel
for example (block foobar (lambda () (return-from foobar))) ; -the returned function is defined in the lexical scope of the block, but escapes its dynamic extent (and invoking it will lead to a runtime error, unless you have a very peculiar implementation that travels in time)
21:55:53
dbotton
wonder if way to demo that graphically - should be able to show two time lines one for code and one for objects
21:57:36
jackdaniel
strictly speaking the user is not allowed to write print-object methods specialized on system classes, but the point still stands about the capture if we replace a list with make-instance 'foo