02:07
<Chengzhong Wu>
Thanks, it looks good to me!
02:10
<littledan>
the slides give a good explanation. Presumably this is as a bonus, if people ask about it, right?
02:10
<Justin Ridgewell>
Yah
02:11
<Justin Ridgewell>
Supplemental slides if it's brought up
02:11
<littledan>
I think, when you're presenting this, you should give a nod to people like Chris and me, who would agree with you on substance but still say, "yeah this is dynamic scoping, and it's OK for the reasons you explain". It's OK for us to disagree about what words mean and would be silly to have an argument about that.
02:17
<Justin Ridgewell>
I'll be remote, but would appreciate you two chiming in when if we discuss
02:17
<littledan>
yeah if someone brings up "dynamic scoping" I'm happy to give my view
02:18
<Chengzhong Wu>
Absolutely!
02:50
<Kris Kowal>
My view is that dynamic scope is bad, but dynamic scope that can only be addressed lexically is not so bad. Like DeMorgan’s various laws, the pattern is more important than the specific application. An instance of that pattern is hygienic macros from Racket, which (in my meager understanding) address the bad kind of dynamic scope present in Lisp by making the gensyms on the stack addressable only lexically. But, I’ve gotten in trouble in these very halls for interpreting dynamic scope loosely! That said, I don’t mind going on the record for the first sentence of this message.
02:52
<littledan>
well I'd give the addendum that dynamic scope which is addressed only lexically can still be bad, if it's unstructured in the sense of letting you set the local value of a variable when it's ambiguous how "deep" in the scope stack you want to set it. (This was our experience in Factor!) This proposal avoids that pitfall as well.
02:53
<littledan>
anyway I would agree with the headline, "Dynamic scope is bad, but dynamic scope with [various properties] is not bad"
02:53
<Kris Kowal>
Right, as long as it’s superficial.
02:53
<littledan>
like you, I could babble unintelligibly for a while :)
02:53
<littledan>
we thought it was so elegant how the "name stack" was sort of parallel to the operand stack (for a RPN language)
02:54
<littledan>
it was propagated across coroutine resumption because call-cc simply copied all of the stacks!
02:54
<littledan>
much elegant, very orthogonal
02:54
<Kris Kowal>
and small enough to bootstrap a boot loader, i’m sure!
02:55
<littledan>
well, Factor isn't as well-suited to bootloaders as Forth... it needs a GC and such
02:55
<littledan>
though I hear people are running JVMs in their TrustZone or something so who knows
02:55
<Kris Kowal>
my positive experience with hybrid dynamic/lexical scope was with “Guten Tags”, but I don’t think I could ramble my way out of that bag…
02:56
<littledan>
my positive experience with hybrid dynamic/lexical scope was with “Guten Tags”, but I don’t think I could ramble my way out of that bag…
this is not very Googleable
02:56
<Kris Kowal>
such failed project
02:56
<littledan>
the thing is, the factor experience isn't actually hybrid, since the operand stack subsumes the need for lexical scope!
02:56
<Kris Kowal>
https://github.com/gutentags/gutentag
02:56
<littledan>
(though over time we made more and more use of a lexical scoping extension...)
02:58
<Kris Kowal>
https://github.com/gutentags/gutentag
In the list example, items:iteration, items is lexical and iteration is dynamic and shallow.
02:59
<littledan>
dynamic and shallow! this smells like partial continuations
02:59
<littledan>
that doc looks interesting
03:00
<littledan>
I think you can see the interplay of lexical and dynamic scoping in most modern web frameworks. everyone has a "context" API these days. However that needs to be cached and re-run against re-evaluating just part of the DOM tree, so AsyncContext doesn't model it so well (or does it??)
03:02
<Kris Kowal>
dynamic and shallow! this smells like partial continuations
partial continuations isn’t in my vocab but yes, probably an accurate description.
03:03
<littledan>
Sorry delimited continuations
03:04
<littledan>
Sorry it is an extremely high level analogy
03:04
<Kris Kowal>
Oh, I know that one. I don’t think I could make that leap on my own.