freenode/#sbcl - IRC Chatlog
Search
16:40:25
mfiano
This different printed representation of closures now means I have to go back and check lots of code I wrote in the last couple weeks, and to remember to check future code I write more closely. Wish that was mentioned in the release notes.
16:49:25
Krystof
Sorry. In general I would advise against using the non-readable printed representation of objects for anything programmatic
16:53:30
aeth
Does this change to CONSTANTLY improve FP performance? Does it compose with COMPLEMENT or does it call things twice?
17:02:41
mfiano
Krystof: I was not using it programmatically. When I see the printed representation as CLOSURE of an object in the inspector, I know to check carefully if I really want to close over the values or if it was a mistake I made. This change just violated the principle of least surprise.
17:03:21
mfiano
But, now I know inspect it further and can't take it's printed representation at face value.
17:32:44
luis
Krystof: I seem to have single method tracing working. It was just a bit tedious to ensure the gf is encapsulated once and only once if the user traces/untraces both the gf and one or more of its methods. I'll send the patch to the list soonish.
17:35:02
luis
I've also fixed a small bug with :WHEREIN tracing and generalised the :REPORT option to accept custom report functions in preparation for some SLIME goodies.
17:37:08
luis
I'll try and report non-local exits when using encapsulation since that seems straightforward. Hopefully there isn't a strong reason why that hasn't been done before.
18:11:00
luis
I might even be able restitch together CMUCL's labels/flets tracing. I can grab labels/flet with a small tweak to fun-debug-fun, but SBCL seems to inline simple non-recursive labels. Is there any way to suppress that when, say, debug = 3?
18:53:30
karlosz
luis: what kind of simple non-recusive labels? if it's a let conversion or assignment-conversion, the logic syhould be in locall.lisp
18:55:13
karlosz
if i recall correctly, there is definitely some logic to inhibit let-conversion already, but it might have gotten broken
22:56:16
karlosz
luis: ah yeah, since Y is only called once, the compiler will integrate Y directly. locall should have logic to inhibit that kind of "let-conversion" depending on policy. it must not be working
22:58:04
karlosz
if you want to frob the poliby look at this function: https://github.com/sbcl/sbcl/blob/5491c03a52633816a996961aeb1c4b548f063954/src/compiler/locall.lisp#L1182
23:00:49
karlosz
the reason why the compiler automatically inlines that function is because since it is only called once (more generally only returns to place), the compiler knows that inlining it will never increase code size
23:06:29
luis
karlosz: awesome, that works. Do you (policy clambda (or (= let-conversion 0) (= debug 3))) or somesuch would be reasonable? (> debug speed) maybe?
23:21:23
karlosz
luis: personally, i think inhibiting let-conversion on debug 3 is unobjectionable, but user-visible changes in policy probably deserve a mention
23:25:06
karlosz
luis: you might also want to port this bit from cmucl: https://gitlab.common-lisp.net/cmucl/cmucl/-/blob/master/src/compiler/locall.lisp#L1063 which basically inhibits tail conversion somehow
23:26:14
luis
karlosz: AIUI, let-conversion covers other things besides flet/labels, and in that case I would probably want to specifically control flet-conversion. We actually ship with (debug 3) precisely because it inhibits tail conversion.
23:27:32
karlosz
i.e. i don't think the ocmpiler inhibits local tail call optimization on any policy currently
23:28:42
karlosz
luis: modifiying that will only change things for FLET and LABELS. if you read the block comment above the supression function, it explains that it won't ever supress things for anonymous functionals
23:30:31
luis
My motivation here is to trace local functions, so I don't care about anonymous things.
23:33:47
karlosz
right, im just saying that that's how you get specific control over flet-conversion
23:34:08
karlosz
that is, you don't need to worry about accidentally changing let-conversion semantics for things that are anonymous if you change the policy there
23:52:54
luis
https://plaster.tymoon.eu/view/2238 yay, just need to print that local function frame a bit better :)
23:54:50
luis
oh, actually if I trace (flet y :in x) that works better. I'm confused why tracing (labels y :in x) worked at all
0:01:09
luis
oh right, because I have a bug and fun-debug-fun returned the main fun when it couldn't find the labels, doh.
3:32:20
pfdietz
You can disable the optimize that removes the flet by declaring the function notinline.