Keynote: Delimited Continuations, Demystified by Alexis King | Lambda Days 2023

  Рет қаралды 7,264

Code Sync

Code Sync

11 ай бұрын

✨This talk was recorded at Lambda Days 2023. If you're curious about our upcoming event, check lambdadays.org ✨
Although delimited continuations are not a new idea, they have recently seen renewed interest from several programming language communities as a powerful tool for implementing schedulers and effect systems.
Unfortunately, there is a major remaining obstacle to their adoption, namely that most programmers find them utterly opaque. To help fix that, this talk provides an overview of what delimited continuations are, how they work, and why they’re useful from a perspective accessible to the working programmer.
Let's keep in touch! Follow us on:
Twitter: / lambdadays
LinkedIn: / lambda-days
Facebook: / lambdadays

Пікірлер: 21
@Swampdragon102
@Swampdragon102 11 ай бұрын
I think this is the first time I've fully grasped delimited continuations. Thanks!
@jpratt8676
@jpratt8676 7 күн бұрын
You know its likely to be a good talk when Simon Payton Jones is asking questions
@laughingvampire7555
@laughingvampire7555 2 ай бұрын
the best way to understand continuations is to learn continuation passing style, you can do continuations in any program that supports higher order functions, the problem is that people is scared away of CPS as something the compiler should do, then they get frustrated because they don't understand what the compiler is doing.
@laughingvampire7555
@laughingvampire7555 2 ай бұрын
don't say that is boring, say that is a simple mechanism that allows for powerful flow control
@LDRAGONFLYL
@LDRAGONFLYL Ай бұрын
44:17 people have CoW-ed memory pages when they fork() since time immemorial... Why not map those memory as CoW instead of copying pessimistically?
@jpratt8676
@jpratt8676 7 күн бұрын
That appears to make a lot of sense, but perhaps they almost always get mutated directly after?
@Verrisin
@Verrisin 2 ай бұрын
... so it is just like the do sugar for monads ... just more versatile and normal ...
@jpratt8676
@jpratt8676 7 күн бұрын
A lot more, but they also have performance implications that can be very helpful!
@TankorSmash
@TankorSmash 11 ай бұрын
This sounds a lot like the handlers in Unison
@jamiebertram9744
@jamiebertram9744 11 ай бұрын
They are implemented with delimited continuations I think.
@asdfghyter
@asdfghyter 8 ай бұрын
Yep, that is exactly the kind of effect system that this is intended for building
@LDRAGONFLYL
@LDRAGONFLYL Ай бұрын
59:10 because other programming languages are too deep into an unhealthy relationship with dependency injection, they can no longer conceptualize the beauty of proper one-shot delimited continuation 😅
@blacky7801
@blacky7801 11 ай бұрын
very clear explanation of a complex topic, the idea doesn't seem appealing tho. complicates the programmers model of program execution and messes with simple controll flow. hard pass for me. Edit: Thinking about it a bit more makes me more positive: They are an excellent notation to describe the wack control flow that language features like exceptions or exiting have.
@poscat0x04
@poscat0x04 6 ай бұрын
The point is that it is powerful enough to implement many features that are usually language level, such as generators, coroutines and algebraic effects.
@blacky7801
@blacky7801 6 ай бұрын
​@@poscat0x04 I really like this Dijkstra quote: "Our intellectual powers are rather geared to master static relations and our powers to visualize processes evolving in time are relatively poorly developed. For that reason we should do (as wise programmers aware of our limitations) our utmost to shorten the conceptual gap between the static program and the dynamic process, to make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible." I don't disagree that they are a very powerful technique, I just think that the sort of twisted evaluation that delimited continuations entail are far far away from its textual representation.
@poscat0x04
@poscat0x04 6 ай бұрын
@@blacky7801 Honestly I'm not buying into this handwavy anti-abstraction nonsence, even if it's said from dijkstra (after all he didn't provide any reason behind this judgement). The contemporary philosophy on programming/software engineering is that programming is all about managing complexity, which is done through abstraction.
@blacky7801
@blacky7801 6 ай бұрын
@@poscat0x04 I don't see where this quote is anti-abstraction at all? The article this quote is from is his famous "go to statement considered harmful" article in which he argues against the use of goto. He was a proponent of structured programming, a higher level of abstraction compared to the structureless programming that goto allows. The argument presented in the article is that go to makes tracking the progress of any process impossible. Tracking the progress of a function is of course vital to understanding its behaviour, as its part of the internal state. In a program consisting of only of assignment statements, it is easy to characterize the progress: by a single instruction pointer. In a program consisting of function calls, it is again easy to characterize the progress: by a callstack. Simple and predictable. However, in the case of a program containing goto statements it is impossible to reason about the progress of the process in the general case. Including it in a Language breaks the simple execution model present in structured programming. Thinking about it this way, adding delimited continuations to a language causes the same breaks to the simple reduction semantics. At any given step in the redduction it is impossible to determine the progress of it, as reduction rules containing delimited continuations can rewrite the past almost at will. There is no understanding the behaviour of a function if the continuation to be reduced can change under you feet at any moment. Delimited continuations are the opposite of managing complexity, they are introducing complexity in reduction where before there was simplicity.
@saltrocklamp199
@saltrocklamp199 4 ай бұрын
I've seen it argued that "un-delimited" continuations (like in Scheme) are much worse, and that delimited continuations are a better language primitive. You might also be interested in algebraic effect handlers, which as far as I understand is basically statically-typed delimited continuation. See for example the new OCaml effect system, or the Koka research language.
Just try to use a cool gadget 😍
00:33
123 GO! SHORTS
Рет қаралды 61 МЛН
Watermelon Cat?! 🙀 #cat #cute #kitten
00:56
Stocat
Рет қаралды 27 МЛН
ГДЕ ЖЕ ЭЛИ???🐾🐾🐾
00:35
Chapitosiki
Рет қаралды 10 МЛН
Alexis King on "Delimited Continuations, Demystified" @ZuriHac2023
1:15:33
OST – Ostschweizer Fachhochschule
Рет қаралды 4,3 М.
Delimited Continuations are all you need
1:05:25
Michigan TypeScript
Рет қаралды 2,6 М.
"Continuations on the Web and in your OS" by Jay McCarthy (2013)
40:08
Strange Loop Conference
Рет қаралды 2,4 М.
Uncle Bob LOVES Functional Programming | Prime Reacts
22:59
ThePrimeTime
Рет қаралды 112 М.
"Hackett: a metaprogrammable Haskell" by Alexis King
33:40
Strange Loop Conference
Рет қаралды 12 М.
Value Objects in Valhalla #JVMLS
51:42
Java
Рет қаралды 14 М.
🔥Идеальный чехол для iPhone! 📱 #apple #iphone
0:36
WWDC 2024 - June 10 | Apple
1:43:37
Apple
Рет қаралды 10 МЛН
Купил этот ваш VR.
37:21
Ремонтяш
Рет қаралды 226 М.
WWDC 2024 Recap: Is Apple Intelligence Legit?
18:23
Marques Brownlee
Рет қаралды 5 МЛН
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,6 МЛН