1
00:00:01,080 --> 00:00:03,440
Welcome to Happy Path 
Programming. 

2
00:00:03,760 --> 00:00:08,720
I'm Bruce Eckel. 
I'm James Ward, welcome everyone

3
00:00:08,720 --> 00:00:10,440
to happy path programming. 
We're. 

4
00:00:10,440 --> 00:00:12,600
Back after a while because 
you've been traveling. 

5
00:00:12,800 --> 00:00:17,680
It's just, you know, that's the 
life of developer advocate on 

6
00:00:17,680 --> 00:00:18,560
the road. 
Do they? 

7
00:00:18,560 --> 00:00:20,440
Still do that? 
They still do the developer 

8
00:00:20,440 --> 00:00:23,240
advocate thing, huh? 
Yeah, you know, now I just try 

9
00:00:23,240 --> 00:00:26,360
to convince agents. 
I see you don't. 

10
00:00:26,520 --> 00:00:28,000
You don't have to interact with 
actual. 

11
00:00:28,000 --> 00:00:31,960
People now I'm really a agent 
advocate, OK, yeah, yeah. 

12
00:00:32,159 --> 00:00:35,640
But but, you know, the human 
connection going to in person 

13
00:00:35,640 --> 00:00:40,360
events is actually become, I 
think, more valuable because we,

14
00:00:40,400 --> 00:00:45,040
I don't know, we as humans like 
to connect in in person. 

15
00:00:45,360 --> 00:00:47,560
Nice. 
And here we are on a room. 

16
00:00:47,560 --> 00:00:51,120
Well, we're together. 
But our guest today, SUNY, Soon,

17
00:00:51,120 --> 00:00:52,800
soon, soon. 
SUNY. 

18
00:00:52,960 --> 00:00:55,720
Danish right And so? 
What's your last name? 

19
00:00:56,680 --> 00:01:02,680
Table, Yeah, TEPEL, that's 
that's not easier either. 

20
00:01:02,680 --> 00:01:04,959
So it's yeah, it's a real tough 
one. 

21
00:01:05,120 --> 00:01:06,920
Sorry about. 
That sorry, my Danish is not 

22
00:01:07,200 --> 00:01:09,600
awesome, but we've got a good 
one because. 

23
00:01:09,760 --> 00:01:11,400
So a quick little background 
story. 

24
00:01:11,400 --> 00:01:16,080
So this was like 3 weeks ago you
and I were got together on our 

25
00:01:16,080 --> 00:01:20,240
weekly get together. 
I was actually in town and yeah,

26
00:01:20,240 --> 00:01:24,120
tech, our tech night and which 
used to be a book night and now 

27
00:01:24,120 --> 00:01:26,440
it's just now it's. 
Like I'm not sure what it is 

28
00:01:26,440 --> 00:01:28,240
anymore. 
We're, we're still figuring that

29
00:01:28,240 --> 00:01:30,440
out, still figuring that out. 
But we. 

30
00:01:30,560 --> 00:01:32,560
Have we officially given up on 
TypeScript? 

31
00:01:33,200 --> 00:01:37,600
I know nobody wants to do it so.
I, I we. 

32
00:01:37,800 --> 00:01:42,080
The book feels so close, like 
maybe that's I'm imagining it 

33
00:01:42,200 --> 00:01:45,840
like the hard parts were kind of
done maybe versus like just 

34
00:01:45,880 --> 00:01:49,520
really we could just but I kind 
of want to finish the TypeScript

35
00:01:49,760 --> 00:01:52,800
effect on our programming book. 
OK, maybe I just do I. 

36
00:01:52,800 --> 00:01:54,520
Mean just. 
We could just think. 

37
00:01:54,520 --> 00:01:56,040
You and Bill are done with 
TypeScript. 

38
00:01:57,160 --> 00:02:01,040
I don't want to know about it 
but any more than I have. 

39
00:02:01,400 --> 00:02:04,880
But the the pros could be done 
mostly with Claude I think. 

40
00:02:05,880 --> 00:02:07,320
And it would probably still have
value. 

41
00:02:07,520 --> 00:02:10,759
Oh yeah, yeah, I think so. 
So we'll see on that. 

42
00:02:10,759 --> 00:02:14,800
But OK, so we were together, you
and I and we're like, let's just

43
00:02:14,800 --> 00:02:19,400
ask the AI what the if it can 
find anything related to effect 

44
00:02:19,400 --> 00:02:22,760
oriented programming in Python, 
because you've been doing a lot 

45
00:02:22,760 --> 00:02:27,200
of Python, you've been updating 
coming back to thinking in 

46
00:02:27,200 --> 00:02:29,280
Python Your your book that you 
Yeah. 

47
00:02:29,280 --> 00:02:32,960
There's a little bit of story 
behind that because I started it

48
00:02:32,960 --> 00:02:37,440
in 2008 and I abandoned it. 
Like I wrote a blog post to sing

49
00:02:38,040 --> 00:02:39,800
I, This is why I'm not doing 
this book. 

50
00:02:39,920 --> 00:02:42,040
It's just, I don't know what 
what I said. 

51
00:02:42,040 --> 00:02:46,840
It was too hard, I guess. 
And then a couple months ago I 

52
00:02:46,840 --> 00:02:49,840
thought, well, let's just see 
what Claude can do with it. 

53
00:02:49,840 --> 00:02:54,400
And then I started pouring all 
of my presentations at Pycon and

54
00:02:54,400 --> 00:02:57,280
other, you know, all the 
research that I'd done, I'd 

55
00:02:57,280 --> 00:03:00,960
poured it into it and I said, 
OK, you know, put this in and 

56
00:03:01,080 --> 00:03:04,440
all the stuff from the design 
patterns work. 

57
00:03:05,120 --> 00:03:09,400
And I just kept adding to it and
it kept doing a good job. 

58
00:03:09,400 --> 00:03:14,080
And the tooling, it did a really
excellent job for me for. 

59
00:03:14,080 --> 00:03:16,680
Tooling. 
You actually have the code and 

60
00:03:16,680 --> 00:03:20,000
then you have it run and then 
you capture the output and which

61
00:03:20,000 --> 00:03:22,560
is validation. 
Yes, Oh yeah, everything. 

62
00:03:22,560 --> 00:03:25,520
So everything is run and 
validated and run through all 

63
00:03:25,520 --> 00:03:28,040
the type checkers and. 
Because it sure is annoying when

64
00:03:28,040 --> 00:03:30,360
there's code in a book or 
anywhere. 

65
00:03:30,400 --> 00:03:33,160
Without it, you know any kind of
example code and then it doesn't

66
00:03:33,160 --> 00:03:35,480
actually work. 
Oh, yeah, like, yeah, that's, 

67
00:03:35,480 --> 00:03:38,320
that's basic. 
And then I had it do this thing 

68
00:03:38,320 --> 00:03:41,200
that I've been wanting forever 
and I have made multiple 

69
00:03:41,200 --> 00:03:44,880
attempts at it, which is to put 
the output directly in the 

70
00:03:44,880 --> 00:03:48,160
listings. 
And I know you can do that with 

71
00:03:48,680 --> 00:03:51,440
doc test, but it just looked too
ugly to me. 

72
00:03:51,960 --> 00:03:55,280
And so and it did it and it 
works, right. 

73
00:03:55,280 --> 00:03:57,560
And if there's any little 
hiccups, it fixes it. 

74
00:03:58,160 --> 00:04:01,080
It's like, yeah, I couldn't. 
I would never have been able to 

75
00:04:01,080 --> 00:04:04,680
write this book and certainly 
never have made it to where I 

76
00:04:04,680 --> 00:04:09,160
wanted to. 
So that said, we saw we started 

77
00:04:09,160 --> 00:04:12,720
looking at your library. 
Well, we, so the AI helped us 

78
00:04:12,720 --> 00:04:15,280
find it. 
Oh yes, we, I don't know. 

79
00:04:15,520 --> 00:04:17,519
We, you know, probably could 
have just searched Google or 

80
00:04:17,519 --> 00:04:22,079
something, but but I don't know.
But anyway, we're like, we asked

81
00:04:22,079 --> 00:04:24,760
AI like help us find some things
that are kind of effect oriented

82
00:04:24,760 --> 00:04:30,840
in the Python world. 
And for me, I, I'm kind of, I've

83
00:04:30,840 --> 00:04:33,680
always been kind of a Python 
skeptic because, you know, I got

84
00:04:33,680 --> 00:04:37,680
total functional programming 
pilled and, and so there wasn't 

85
00:04:37,680 --> 00:04:42,800
really the effect oriented stuff
in Python that I, that I, that 

86
00:04:42,800 --> 00:04:44,840
would make me want to use 
Python. 

87
00:04:46,200 --> 00:04:49,040
And so, so we're like, hey, you 
know, let's see what's out 

88
00:04:49,440 --> 00:04:51,960
there. 
And then we found stateless so. 

89
00:04:52,520 --> 00:04:57,000
We found Stateless and then 
Monday, because I knew we had 

90
00:04:57,000 --> 00:05:01,800
this podcast coming up, I 
thought, well, I need to spend 

91
00:05:01,800 --> 00:05:04,840
time looking at this. 
And I started looking at the 

92
00:05:04,840 --> 00:05:10,000
documentation and I thought, why
don't I just have Claude write 

93
00:05:10,000 --> 00:05:12,840
me a chapter? 
We'll just put it tentatively, 

94
00:05:12,840 --> 00:05:16,920
put it at the end of the book, 
and this is Thinking in Python 

95
00:05:17,240 --> 00:05:20,240
And you can find it at Thinking 
on in python.com. 

96
00:05:20,760 --> 00:05:24,080
I'm not saying it's done, but 
it's still it's usable. 

97
00:05:24,520 --> 00:05:26,720
It's usable. 
Yes, I'm there. 

98
00:05:26,840 --> 00:05:30,800
There needs work on it. 
But I mean, yeah, you know, it's

99
00:05:30,800 --> 00:05:33,440
workable the way it is. 
So you've got a few chapters 

100
00:05:33,480 --> 00:05:36,120
that kind of lead up to 
stateless and then and then 

101
00:05:36,120 --> 00:05:38,520
there's a stateless. 
There's a whole section on 

102
00:05:38,520 --> 00:05:41,720
functional programming. 
And then right before Stateless,

103
00:05:42,240 --> 00:05:45,800
initially the generators were in
the stateless chapter and then I

104
00:05:45,880 --> 00:05:48,400
broke them out because turns out
that's easy to do. 

105
00:05:48,840 --> 00:05:50,640
You just tell it to do that and 
it does it. 

106
00:05:51,440 --> 00:05:55,040
And so there's a generators like
where it goes into depth because

107
00:05:55,040 --> 00:05:58,640
Stateless uses generators very 
intimately. 

108
00:05:59,040 --> 00:06:03,640
And then now there are two 
chapters, one which is the 

109
00:06:03,840 --> 00:06:06,680
stateless introduction and the 
other is Stateless in practice, 

110
00:06:06,680 --> 00:06:13,240
which has as many examples as I 
could pull from the effect 

111
00:06:13,240 --> 00:06:16,560
oriented programming book and 
other things. 

112
00:06:16,560 --> 00:06:20,560
And so, yeah, it's a whole, it's
a whole deal, but I have not 

113
00:06:20,560 --> 00:06:26,160
combed through it and, you know,
rewritten the, the the stuff 

114
00:06:26,200 --> 00:06:28,440
that. 
You haven't deslopified it yet. 

115
00:06:29,280 --> 00:06:34,320
Well, I mean, everything works 
and the prose is, you know, 

116
00:06:34,320 --> 00:06:37,560
tolerable. 
But I often come and I find some

117
00:06:37,560 --> 00:06:39,800
sentence, I'm going, what does 
this mean? 

118
00:06:39,800 --> 00:06:45,080
And then it will, it will fix it
and it will then go explain why 

119
00:06:45,440 --> 00:06:48,960
the, you know, there was a 
dangling pronoun or something. 

120
00:06:49,000 --> 00:06:53,320
And it explains that why the 
sentence didn't work, why it was

121
00:06:53,320 --> 00:06:55,520
confusing and but then it fixes 
it. 

122
00:06:55,760 --> 00:06:57,600
So I haven't done all that with 
this. 

123
00:06:58,000 --> 00:07:02,160
Yeah, but. 
So for soon, tell us about what 

124
00:07:02,160 --> 00:07:04,360
is stateless this library that 
we've been. 

125
00:07:04,360 --> 00:07:06,080
But also, what's your 
background? 

126
00:07:06,080 --> 00:07:09,320
Where, where, like where did you
go to school and how did you end

127
00:07:09,320 --> 00:07:11,320
up? 
And yeah. 

128
00:07:11,400 --> 00:07:14,200
Definitely, yeah. 
And thanks for that chapter in 

129
00:07:14,600 --> 00:07:17,520
thinking in Pythons 2. 
I think that is 2 chapters. 

130
00:07:17,520 --> 00:07:20,200
Yeah, I think that is that's 
probably the most comprehensive 

131
00:07:20,200 --> 00:07:25,040
documentation that exists on 
this library so far, even more 

132
00:07:25,040 --> 00:07:26,920
comprehensive than what's in the
read me. 

133
00:07:26,920 --> 00:07:29,600
So that that that was 
entertaining to see. 

134
00:07:29,600 --> 00:07:31,520
I mean, I skimmed through it. 
I didn't read it. 

135
00:07:32,120 --> 00:07:34,160
I mean, I only told you. 
End to end tonight. 

136
00:07:34,640 --> 00:07:37,040
Yeah. 
But nothing stood out to me so 

137
00:07:37,040 --> 00:07:38,800
far. 
I think it looked, it looked 

138
00:07:39,000 --> 00:07:40,760
pretty convincing. 
So yeah, right. 

139
00:07:40,880 --> 00:07:45,840
Good job with that so far. 
But yeah, my background is it's 

140
00:07:45,840 --> 00:07:51,880
kind of mixed. 
I, my education is, is mixed 

141
00:07:51,880 --> 00:07:56,640
also partly as a software 
engineer from the IT University 

142
00:07:56,640 --> 00:08:00,520
of Co Maiden. 
And then I did my masters in 

143
00:08:00,520 --> 00:08:06,160
kind of data science, very 
focused on natural language 

144
00:08:06,160 --> 00:08:08,920
processing at the University of 
Copenhagen after that. 

145
00:08:09,960 --> 00:08:13,360
And that was, that was something
like 10 years ago that I, that I

146
00:08:13,360 --> 00:08:15,480
did that. 
And then I've been working as a 

147
00:08:15,480 --> 00:08:20,560
kind of very hands on data 
scientist, sometimes natural 

148
00:08:20,560 --> 00:08:24,960
language type engineer at 
various companies, but mostly at

149
00:08:24,960 --> 00:08:29,040
startups and scale UPS where 
part of that job description was

150
00:08:29,040 --> 00:08:33,200
also data analysis and data 
engineering. 

151
00:08:34,120 --> 00:08:36,520
So that's. 
That's the reason through. 

152
00:08:36,840 --> 00:08:39,120
Yeah, I've been doing a lot of 
Python, yeah, for sure. 

153
00:08:39,520 --> 00:08:44,480
But also in periods a lot of 
Scala, which is where I I was 

154
00:08:44,480 --> 00:08:51,440
exposed to CEO which really 
caught my attention as something

155
00:08:51,440 --> 00:08:54,680
that proved to be very useful 
for writing real business 

156
00:08:54,680 --> 00:08:58,080
applications. 
Was that your first exposure to 

157
00:08:58,080 --> 00:09:01,800
effect? 
I mean, I, I probably saw some 

158
00:09:01,800 --> 00:09:05,880
Haskell code in, in university, 
but I never really applied it to

159
00:09:05,880 --> 00:09:09,080
any real problems. 
And I don't think I really got 

160
00:09:09,080 --> 00:09:12,840
it the, the, the like the 
benefits of it. 

161
00:09:12,840 --> 00:09:15,760
When I, when I saw it in 
university, it wasn't really 

162
00:09:15,760 --> 00:09:20,920
until I, I really tried it in 
practice with CEO that, that 

163
00:09:20,920 --> 00:09:23,600
the, the penny sort of dropped 
for me off. 

164
00:09:23,600 --> 00:09:26,360
Why is it? 
What is actually the, the 

165
00:09:26,520 --> 00:09:28,960
tangible benefits of a system 
like this? 

166
00:09:29,960 --> 00:09:33,520
I mean, I'd also have some 
experience hobby level with Elm 

167
00:09:33,520 --> 00:09:38,120
that I enjoyed a lot where you 
get some of the same benefits in

168
00:09:38,120 --> 00:09:42,280
a more limited or maybe less 
flexible way, very intentionally

169
00:09:42,280 --> 00:09:46,360
by by even. 
I think so. 

170
00:09:46,440 --> 00:09:50,200
Yeah, Elma is such a good way 
for people to like start to dip 

171
00:09:50,200 --> 00:09:54,480
their toe into the waters of of 
effect training, programming 

172
00:09:54,760 --> 00:09:59,160
things, you know, had, you know,
immutability and, you know, a 

173
00:09:59,160 --> 00:10:01,320
lot of the. 
Did it have effects? 

174
00:10:01,320 --> 00:10:02,400
I thought it was just 
functional. 

175
00:10:03,160 --> 00:10:04,400
Maybe. 
Maybe. 

176
00:10:04,400 --> 00:10:07,040
It's basically it's a functional
reactive system, right? 

177
00:10:07,040 --> 00:10:13,000
So the effects are managed by 
you meeting some value that the 

178
00:10:13,000 --> 00:10:16,480
effects system handles and then 
you it produces a new state that

179
00:10:16,480 --> 00:10:19,920
you yeah that you need to. 
Yes, I guess in some ways it is 

180
00:10:19,920 --> 00:10:23,600
a factory in it. 
But it didn't seem obvious when 

181
00:10:23,600 --> 00:10:26,640
I was reading. 
It was just like. 

182
00:10:27,640 --> 00:10:32,280
But there is like a runtime that
is, that is handling essentially

183
00:10:32,280 --> 00:10:36,760
mutations and, well, the 
updates, the workflow of of page

184
00:10:36,760 --> 00:10:39,520
updates and stuff. 
So yeah, that'd be interesting. 

185
00:10:39,600 --> 00:10:43,400
We'll have to have Evan on and 
ask him if it's truly effect 

186
00:10:43,400 --> 00:10:45,000
oriented and get his thoughts on
that. 

187
00:10:45,000 --> 00:10:47,920
But bit cool. 
So you got some Helm, you got 

188
00:10:47,920 --> 00:10:53,680
some Scala, Zeo and and then 
also like Python in the day job.

189
00:10:54,040 --> 00:10:57,520
And so at what point were you 
like I should build an effect 

190
00:10:57,520 --> 00:11:01,480
system for Python? 
So that was when my job 

191
00:11:01,480 --> 00:11:04,280
description changed enough that 
Scala wasn't really a 

192
00:11:04,280 --> 00:11:07,080
substantial part of my 
day-to-day job and I was really 

193
00:11:07,080 --> 00:11:09,160
missing that experience in 
Python. 

194
00:11:09,920 --> 00:11:14,320
And so I thought, well, why not 
just try to pour CEO into 

195
00:11:14,320 --> 00:11:18,320
Python? 
And so I had an adventure with 

196
00:11:18,320 --> 00:11:22,240
that which was not super 
successful, I would say, because

197
00:11:22,240 --> 00:11:26,840
it turns out that well, the 
experience of doing monadic 

198
00:11:26,840 --> 00:11:30,240
stuff in a language that doesn't
have to notation and for 

199
00:11:30,240 --> 00:11:32,160
comprehension is just not very 
nice. 

200
00:11:33,120 --> 00:11:37,960
And also. 
The people that say like Zeo, at

201
00:11:38,200 --> 00:11:41,960
least the the model for Zeo is 
not easily ported to other 

202
00:11:41,960 --> 00:11:44,080
languages. 
One of the primary reasons why 

203
00:11:44,080 --> 00:11:48,440
is the lack of higher kind of 
types in some of these in other 

204
00:11:48,440 --> 00:11:50,360
languages. 
So I don't know if that was part

205
00:11:50,360 --> 00:11:53,400
of what you ran into there. 
Well, actually that was part of 

206
00:11:53,400 --> 00:11:57,720
the reason why I thought that 
Zeo was a good model for Python 

207
00:11:57,720 --> 00:12:01,000
because Zeo does not actually 
depend on higher kind of types 

208
00:12:01,000 --> 00:12:06,880
for most of its bag of tricks. 
So you can get pretty far with 

209
00:12:06,880 --> 00:12:10,120
that representation without 
higher kind of types, right? 

210
00:12:10,120 --> 00:12:14,600
And Python for the audience 
members that are not intimate 

211
00:12:14,600 --> 00:12:17,600
with the Python type system does
not have higher kind of types. 

212
00:12:18,400 --> 00:12:22,480
So that was part of the reason I
had dabbled in other types of 

213
00:12:22,480 --> 00:12:25,480
monad frameworks for Python 
before and I always came back 

214
00:12:25,480 --> 00:12:29,280
to, well, without higher kind of
types, it's just not really 

215
00:12:29,280 --> 00:12:32,400
practical to do effect 
composition type stuff. 

216
00:12:32,520 --> 00:12:37,800
But in Co you don't actually 
need higher kind of types for 

217
00:12:37,800 --> 00:12:41,000
effect compositions. 
And so I thought, well, maybe 

218
00:12:41,000 --> 00:12:44,520
this would would work out. 
And from a typing perspective, 

219
00:12:44,520 --> 00:12:47,600
it worked out great. 
But just from an ergonomics 

220
00:12:47,600 --> 00:12:52,240
perspective, and I guess also 
partly for a, for a performance,

221
00:12:52,240 --> 00:12:55,040
from a performance perspective, 
it didn't work out that great 

222
00:12:55,040 --> 00:12:58,480
because of trampolining and 
Python turns out to be kind of 

223
00:12:58,480 --> 00:13:03,000
expensive and because function 
calling in in Python is 

224
00:13:03,000 --> 00:13:06,280
expensive. 
So it was just not a a very 

225
00:13:06,280 --> 00:13:12,840
great experience All in all. 
But then it's at some point I 

226
00:13:12,840 --> 00:13:17,280
tried to fix the ergonomic story
by doing this trick that other 

227
00:13:17,280 --> 00:13:20,160
people have done when doing 
monetic stuff in Python, which 

228
00:13:20,160 --> 00:13:23,480
is, which is to use generators 
to introduce a kind of do 

229
00:13:23,480 --> 00:13:27,800
notation in Python. 
So the way that that works is 

230
00:13:27,800 --> 00:13:31,320
that you have a Yeah, this is a 
common thing in a lot of 

231
00:13:31,320 --> 00:13:37,080
libraries that that tries to do 
either types or other types of 

232
00:13:37,080 --> 00:13:40,760
limited monad stuff in Python is
that you have a decorator that 

233
00:13:41,200 --> 00:13:43,800
expects a function that returns 
a generator. 

234
00:13:43,800 --> 00:13:47,560
And then that will basically 
interpret the the values that 

235
00:13:47,560 --> 00:13:50,720
are being generated. 
And then it sends it back in 

236
00:13:50,720 --> 00:13:53,400
with a with a in a closure 
basically. 

237
00:13:53,600 --> 00:13:56,320
But then while I was doing that,
it occurred to me that you can 

238
00:13:56,320 --> 00:13:59,080
actually, you actually don't 
need the closure at all when 

239
00:13:59,080 --> 00:14:02,280
you're using generators because 
a generator is a Co routine. 

240
00:14:03,200 --> 00:14:07,240
And so you can use the Co 
routine as a way of suspending 

241
00:14:07,240 --> 00:14:10,280
and resuming computation rather 
than the closure. 

242
00:14:11,040 --> 00:14:14,760
And that turned out to be a real
powerful simplification that 

243
00:14:14,760 --> 00:14:17,920
just made the whole machinery 
click in a much nicer way than 

244
00:14:18,200 --> 00:14:21,560
if you try to do closure based 
stuff in in Python. 

245
00:14:21,560 --> 00:14:23,760
I think. 
So the generator. 

246
00:14:23,800 --> 00:14:28,800
We come with a handler, right? 
I mean a handler like they have 

247
00:14:28,800 --> 00:14:33,480
in some of the native algebraic 
algebraic effect. 

248
00:14:33,600 --> 00:14:37,640
Well, I would I would more 
phrase it as the the the 

249
00:14:37,640 --> 00:14:43,680
generator plays the same role as
the closure does in traditional 

250
00:14:43,680 --> 00:14:47,400
monadic systems, right? 
So in any effectful system, you 

251
00:14:47,400 --> 00:14:51,960
need some way of suspending the 
computation and allow the effect

252
00:14:51,960 --> 00:14:56,880
system to interpret whatever 
operation it is that you're you 

253
00:14:56,880 --> 00:15:00,600
want to make. 
And then once the result of 

254
00:15:00,600 --> 00:15:04,040
interpreting that operation is 
ready, you need to resume the 

255
00:15:04,040 --> 00:15:06,160
computation with that result, 
right? 

256
00:15:06,880 --> 00:15:14,640
And in in functional languages 
that use monadic style, you 

257
00:15:14,640 --> 00:15:17,720
usually do that with a closure. 
Yeah, yeah. 

258
00:15:18,240 --> 00:15:21,520
So it's basically, it's 
basically like, it's like a 

259
00:15:21,520 --> 00:15:25,520
continuation passing style, 
right where you you write. 

260
00:15:26,240 --> 00:15:28,680
So bind is basically 
continuation passing style, 

261
00:15:28,680 --> 00:15:30,520
right? 
You supply bind with a function 

262
00:15:30,520 --> 00:15:33,120
that represents the rest of the 
computation. 

263
00:15:33,960 --> 00:15:36,680
And so the trick that I'm doing 
is stateless is I'm just saying,

264
00:15:36,680 --> 00:15:39,840
well, if you're using Co 
routines, you can just use the 

265
00:15:39,840 --> 00:15:44,120
Co routine to represent the rest
of the computation directly. 

266
00:15:44,120 --> 00:15:46,560
You don't actually need the 
closure. 

267
00:15:47,360 --> 00:15:48,960
Yeah. 
There's some trade-offs with 

268
00:15:48,960 --> 00:15:51,040
that that are placing the 
continuation. 

269
00:15:51,640 --> 00:15:54,200
Yes, exactly right. 
OK. 

270
00:15:54,400 --> 00:15:57,760
Yeah. 
And then you get the generator 

271
00:15:57,760 --> 00:16:02,760
syntax gives you the ergonomics 
that that feel better than if 

272
00:16:02,760 --> 00:16:06,400
you didn't have generator 
syntax, it would like you could 

273
00:16:06,400 --> 00:16:09,920
probably have the runtime 
handled. 

274
00:16:09,960 --> 00:16:13,040
I mean, maybe you just go back 
to thunks or whatever, but but 

275
00:16:13,040 --> 00:16:16,480
the ergonomics just wouldn't be 
very nice to work with. 

276
00:16:17,200 --> 00:16:20,320
Yeah, it's like you get rid of 
the whole all the problems that 

277
00:16:20,320 --> 00:16:22,960
you have with callbacks and 
continuation passion style, 

278
00:16:22,960 --> 00:16:27,040
which is basically just, you 
know, a story as all this time 

279
00:16:27,040 --> 00:16:30,000
and very familiar to anybody 
who's worked with a sink await 

280
00:16:30,000 --> 00:16:33,920
before a sink await basically 
when everything was callbacks, 

281
00:16:33,920 --> 00:16:36,560
right? 
That's just not a very nice way 

282
00:16:36,560 --> 00:16:39,080
to write or read code, generally
speaking. 

283
00:16:39,080 --> 00:16:42,800
And I think it's part of the 
reason why do notation and for 

284
00:16:42,800 --> 00:16:46,080
comprehension exists in the 1st 
place is that you need some type

285
00:16:46,080 --> 00:16:50,960
of sugar to make it palatable in
languages like Haskell and and 

286
00:16:50,960 --> 00:16:53,000
Scala. 
So that's exactly right that 

287
00:16:53,000 --> 00:16:55,400
you. 
Look imperative, but when it's 

288
00:16:55,400 --> 00:16:57,880
really like, not traditional 
imperative. 

289
00:16:58,480 --> 00:17:03,240
Yes, exactly. 
Or at least yield and resumable 

290
00:17:03,960 --> 00:17:08,240
without the the usual noise in 
an but with the imperative 

291
00:17:08,240 --> 00:17:12,680
style. 
Yeah, yeah, yeah. 

292
00:17:12,680 --> 00:17:16,000
So you you were like, hey, I 
think this could work on top of 

293
00:17:16,000 --> 00:17:20,240
generators and and started 
building stateless and real 

294
00:17:20,240 --> 00:17:23,359
quick to hop back. 
Was your Zeo attempts under 

295
00:17:23,359 --> 00:17:26,440
stateless or was that a whole 
another repo or something? 

296
00:17:26,440 --> 00:17:29,360
Just I'm curious if there's a 
historical artifact we could, 

297
00:17:29,720 --> 00:17:32,840
you know, go look at just to see
how how that experiment turned 

298
00:17:32,840 --> 00:17:34,320
out. 
Yeah, there is. 

299
00:17:34,320 --> 00:17:38,560
It's a, it's another repo under 
my GitHub handle, also called 

300
00:17:38,680 --> 00:17:40,760
Pfun. 
Pfun. 

301
00:17:40,760 --> 00:17:43,760
It was kind of a yeah. 
It was a missed opportunity, 

302
00:17:43,760 --> 00:17:44,920
actually. 
Obviously it should have. 

303
00:17:44,920 --> 00:17:46,880
It should have called. 
It should have been called PO. 

304
00:17:46,920 --> 00:17:51,440
Obviously somehow that name 
slipped me at the time. 

305
00:17:53,320 --> 00:17:57,400
Yeah, PO would have been good. 
So cool. 

306
00:17:57,400 --> 00:18:00,280
That'll be fun to go Splunk 
through P fun. 

307
00:18:01,120 --> 00:18:04,120
So then then when you when you 
had the realization that 

308
00:18:04,120 --> 00:18:08,640
generators could be the basis 
for the ergonomics of of effect 

309
00:18:08,640 --> 00:18:13,120
training system and Python, that
was the the creation of the 

310
00:18:13,120 --> 00:18:17,760
stateless library. 
Yes, but then I also started 

311
00:18:17,760 --> 00:18:20,560
researching a little bit and 
turns out this is not really a a

312
00:18:20,560 --> 00:18:22,960
new idea exactly. 
Actually people have been doing 

313
00:18:22,960 --> 00:18:28,120
this for a while so so it was 
interesting to see that other 

314
00:18:28,120 --> 00:18:32,000
people had the same idea. 
Just I don't know that anything 

315
00:18:32,000 --> 00:18:36,160
exists in Python that uses this 
technique specifically. 

316
00:18:37,360 --> 00:18:40,120
And the the technique with the 
generators or the technique 

317
00:18:40,120 --> 00:18:43,080
that's the more kind of 
algebraic approach, or both? 

318
00:18:44,040 --> 00:18:46,440
The technique with the with the 
generators. 

319
00:18:47,040 --> 00:18:51,200
So I should say that that 
stateless is essentially it is 

320
00:18:51,200 --> 00:18:54,120
an algebraic effect system. 
I think it's fair to call it 

321
00:18:54,120 --> 00:18:58,280
that, but it works essentially 
the same as an algebraic effect 

322
00:18:58,280 --> 00:19:01,240
system built on a monadic 
representation. 

323
00:19:02,120 --> 00:19:05,960
So it's not algebraic effects in
the same way I think as it is in

324
00:19:05,960 --> 00:19:10,560
Ocaml or COCA or some of these 
languages that have algebraic 

325
00:19:10,560 --> 00:19:13,720
effects natively. 
But it is more similar to the 

326
00:19:13,720 --> 00:19:18,600
style that you have in Haskell 
with the if, even though I'm not

327
00:19:18,600 --> 00:19:20,560
super familiar with that, but 
the. 

328
00:19:20,600 --> 00:19:23,200
Freestyle. 
Yes, yes, exactly. 

329
00:19:24,120 --> 00:19:30,560
So what kind of limitations do 
you run in to using the 

330
00:19:30,560 --> 00:19:37,360
generator approach? 
The main 1 is that unlike unlike

331
00:19:37,360 --> 00:19:43,120
A continuation function or like 
a closure, a generator is a one 

332
00:19:43,120 --> 00:19:48,800
shot computation, so you can 
only resume it at most once. 

333
00:19:50,920 --> 00:19:53,680
So that means that there are 
some effects that you can't 

334
00:19:53,680 --> 00:19:57,960
express with this representation
that you can express in a normal

335
00:19:58,600 --> 00:20:01,800
monadic system. 
And that would be something like

336
00:20:01,800 --> 00:20:05,240
the list effects or like a 
choice effect where you have a 

337
00:20:05,240 --> 00:20:10,920
non determinism or you want to 
run the same computation on 

338
00:20:10,920 --> 00:20:12,960
multiple inputs. 
You can't do that with 

339
00:20:12,960 --> 00:20:16,520
generators because that would 
require you to rewind the 

340
00:20:16,520 --> 00:20:19,480
generator to a previous state 
and replay it basically. 

341
00:20:21,240 --> 00:20:24,600
And I don't know if that is 
technically impossible, but at 

342
00:20:24,600 --> 00:20:27,760
least that's not how Python 
generators. 

343
00:20:28,040 --> 00:20:32,240
Are built. 
So in the in the case of let's 

344
00:20:32,240 --> 00:20:35,640
say a repeat like in because 
you. 

345
00:20:35,640 --> 00:20:40,720
Have a repeat. 
Like how how you would how you 

346
00:20:40,720 --> 00:20:44,160
would do a repeat or a retry on 
a generator. 

347
00:20:44,960 --> 00:20:46,480
Yeah. 
So that, that brings me to kind 

348
00:20:46,480 --> 00:20:49,120
of the other limitation of 
generators is that they are, 

349
00:20:50,000 --> 00:20:54,280
they are stateful objects. 
That's so the name stateless is 

350
00:20:54,280 --> 00:20:57,720
actually kind of tongue in cheek
because it's it's a joke on the 

351
00:20:57,720 --> 00:21:01,720
fact that I'm trying to build a 
purely effect functional effect 

352
00:21:01,720 --> 00:21:05,960
system on a mechanism that is 
inherently stateful, which seems

353
00:21:05,960 --> 00:21:10,800
like a crazy thing to do. 
But the way that I get around it

354
00:21:10,800 --> 00:21:15,160
is that I use decorators, which 
is another Python concept quite 

355
00:21:15,160 --> 00:21:19,080
extension extensively. 
So most places where I need to 

356
00:21:19,080 --> 00:21:24,240
manipulate a generator, I don't 
accept a generator objects 

357
00:21:24,360 --> 00:21:29,040
directly. 
I instead accept a function that

358
00:21:29,040 --> 00:21:32,360
can produce a generator that I 
then decorate, and then you can 

359
00:21:32,360 --> 00:21:34,160
supply the arguments to that 
function. 

360
00:21:34,640 --> 00:21:38,280
So that means that the generator
that stateless is manipulating 

361
00:21:38,280 --> 00:21:42,600
is not something that you as a 
user of the library get to hold 

362
00:21:42,600 --> 00:21:45,920
a reference to. 
So that makes the whole thing 

363
00:21:46,960 --> 00:21:50,480
essentially referentially 
transparent, even though I'm 

364
00:21:50,480 --> 00:21:52,960
working with immutable objects 
underneath. 

365
00:21:53,920 --> 00:21:57,640
Yeah, so you so let's just take 
a example of a repeat. 

366
00:21:57,640 --> 00:22:01,000
You'll have a repeat function 
and you can't just give it an 

367
00:22:01,000 --> 00:22:04,400
instance of a generator because 
it would only be able to do that

368
00:22:04,400 --> 00:22:06,680
repeat once, which wouldn't make
sense. 

369
00:22:07,000 --> 00:22:12,360
So instead you like thunk the 
parameter to repeat so that you 

370
00:22:12,360 --> 00:22:16,600
can then recreate the generator 
on each iteration. 

371
00:22:17,200 --> 00:22:18,400
Yes. 
And then rerun. 

372
00:22:19,360 --> 00:22:23,120
Yeah, that's so. 
Let me ask, this is just a 

373
00:22:23,120 --> 00:22:28,760
thought, but do you think there 
could be such a thing like this 

374
00:22:28,760 --> 00:22:32,960
would require a PEP or 
something, but as a repeatable 

375
00:22:32,960 --> 00:22:35,560
generator? 
In other words, could we either 

376
00:22:35,800 --> 00:22:40,360
add a repeatable generator to 
Python or modify the existing 1 

377
00:22:41,240 --> 00:22:44,480
so that it could be repeatable? 
Is that practical or is that? 

378
00:22:45,520 --> 00:22:47,680
It's a good question. 
I actually don't know how 

379
00:22:47,680 --> 00:22:52,080
generators are really 
implemented in C Python, but 

380
00:22:52,080 --> 00:22:55,080
what I imagine it is it is it's 
some kind of stack frame with 

381
00:22:55,080 --> 00:23:00,640
some kind of state that tells 
you where in the code you are at

382
00:23:01,080 --> 00:23:03,640
and then when you send a new 
value to it, it resumes and 

383
00:23:03,640 --> 00:23:05,720
until it reads another yield 
point. 

384
00:23:06,560 --> 00:23:10,040
So I think I can't think of a 
reason why it should be 

385
00:23:10,040 --> 00:23:15,040
technically impossible to do it.
I imagine it's probably pretty 

386
00:23:15,040 --> 00:23:17,720
hairy stuff to get into and see,
but. 

387
00:23:18,480 --> 00:23:21,080
Well. 
I can't imagine a reason why it 

388
00:23:21,080 --> 00:23:23,120
should be impossible. 
Yeah. 

389
00:23:23,120 --> 00:23:24,840
I really doubt that it's going 
to happen though. 

390
00:23:25,200 --> 00:23:30,280
But hey, Stranger Things. 
Stranger things never happened 

391
00:23:30,320 --> 00:23:33,680
in this language, yeah. 
There's got to be other uses in 

392
00:23:33,680 --> 00:23:37,560
Python more generally for this 
beyond the world of FX it seems 

393
00:23:37,560 --> 00:23:41,320
like like. 
Well, I mean, so the story of 

394
00:23:41,560 --> 00:23:44,720
the story and the terminology of
generators and Co routines in 

395
00:23:44,720 --> 00:23:50,600
Python is kind of a complicated 
one because basically Python 

396
00:23:50,600 --> 00:23:56,520
today has both terms in in play 
because the async IO framework 

397
00:23:56,520 --> 00:24:02,840
in Python uses Co routines. 
And so they have essentially the

398
00:24:02,840 --> 00:24:05,360
same problem, right? 
That you cannot await a Co 

399
00:24:05,360 --> 00:24:08,760
routine more than once because 
it's the same kind of mechanism,

400
00:24:08,760 --> 00:24:14,200
right? 
But I mean, a generator is also 

401
00:24:14,200 --> 00:24:16,960
a Co routine. 
You just don't call it that in 

402
00:24:17,080 --> 00:24:20,520
everyday Python speak because 
that would be confusing because 

403
00:24:20,520 --> 00:24:23,560
they're used for different 
things And it used to be that 

404
00:24:23,560 --> 00:24:25,480
they could sort of be used 
interchangeably. 

405
00:24:25,480 --> 00:24:28,320
Or at least you could supply a 
normal generator to a sync IO 

406
00:24:28,320 --> 00:24:33,400
also, that's frowned upon now. 
I think it's you get some kind 

407
00:24:33,400 --> 00:24:35,480
of deprecation warning if you 
try to do it. 

408
00:24:35,720 --> 00:24:39,240
I think it still technically 
works, but yeah. 

409
00:24:39,240 --> 00:24:42,480
Yeah, for a while they were 
thinking of oh, maybe we can use

410
00:24:42,480 --> 00:24:46,480
generators as Co routines for 
async IO Co routines. 

411
00:24:46,480 --> 00:24:49,720
Yeah, but then they. 
It's interesting. 

412
00:24:49,840 --> 00:24:53,520
There's a meta concept here that
I've seen in a lot of different 

413
00:24:53,520 --> 00:24:58,040
languages, which is you've got a
Co routine that is the like 

414
00:24:58,400 --> 00:25:01,920
single operation, single result 
kind of thing. 

415
00:25:02,200 --> 00:25:04,840
And then you have something 
stream oriented as well. 

416
00:25:05,040 --> 00:25:09,440
And the two are usually totally 
different APIs for good reasons.

417
00:25:09,680 --> 00:25:14,240
Some languages put the like 
code, the Co routine, the single

418
00:25:14,280 --> 00:25:18,800
operation thing on top of the 
stream one and just only read, 

419
00:25:19,000 --> 00:25:22,760
you know, 1 result out of the 
stream, which ends up having 

420
00:25:22,760 --> 00:25:24,840
some performance challenges down
the road. 

421
00:25:25,080 --> 00:25:29,080
But, but so there's these two 
different concepts and in 

422
00:25:29,080 --> 00:25:31,960
Python, the way that I look at 
generator is that it's kind of 

423
00:25:31,960 --> 00:25:35,640
like the stream API that exists 
in some of these other systems 

424
00:25:36,040 --> 00:25:38,720
because you, you, you know, 
you've got essentially a stream 

425
00:25:38,720 --> 00:25:42,160
of inputs, a stream of outputs, 
maybe a final result that comes 

426
00:25:42,160 --> 00:25:46,400
out of this thing. 
And so see, I can, I can see 

427
00:25:47,920 --> 00:25:52,200
similarities in these AP is to, 
to what we've done in so many 

428
00:25:52,200 --> 00:25:56,400
other languages. 
But maybe, you know, you're like

429
00:25:56,400 --> 00:25:59,960
probably decades of iterations, 
you know, through the Co 

430
00:25:59,960 --> 00:26:05,400
routines API and and the 
generator API, not the ability 

431
00:26:05,400 --> 00:26:09,000
to like look like pull away and 
be like, OK, what are the what 

432
00:26:09,000 --> 00:26:13,440
are the fundamental things 
underneath this right that that 

433
00:26:13,680 --> 00:26:16,560
could create AI don't know 
better, more flexible 

434
00:26:16,560 --> 00:26:24,760
foundation. 
So back to the limitations, can 

435
00:26:24,760 --> 00:26:30,520
you OK, there's I guess there's 
a couple of things like I think 

436
00:26:30,520 --> 00:26:37,680
your retry is doesn't, does it 
not allow, I don't know, fall 

437
00:26:37,680 --> 00:26:41,400
backs and jittering, is that 
what they call it and? 

438
00:26:41,680 --> 00:26:44,680
Oh, like the schedule? 
Scheduling and stuff like that. 

439
00:26:45,040 --> 00:26:47,680
And is that something that you 
can add and you just haven't 

440
00:26:47,680 --> 00:26:53,320
done yet? 
But also, I guess the other kind

441
00:26:53,320 --> 00:26:59,080
of bigger question is we've 
looked at some of the newer 

442
00:26:59,080 --> 00:27:05,440
languages that are designed for 
AI generation and well, we've 

443
00:27:05,440 --> 00:27:07,320
looked at the ones that have 
effects in them. 

444
00:27:07,720 --> 00:27:11,760
And one of the things that they 
have done mostly has they 

445
00:27:11,760 --> 00:27:16,320
haven't provided all of these 
library things because the AI 

446
00:27:16,320 --> 00:27:20,480
can generate that code. 
So it doesn't need special, you 

447
00:27:20,480 --> 00:27:24,320
know, human oriented libraries. 
And I'm wondering as we move 

448
00:27:24,320 --> 00:27:28,840
more and more into that, how 
much of that stuff do you 

449
00:27:28,840 --> 00:27:33,120
actually need to do versus 
because I mean the code is more 

450
00:27:33,120 --> 00:27:37,120
and more just going to be AI 
generated versus what the AI can

451
00:27:37,120 --> 00:27:39,360
just generate for you. 
Does that make? 

452
00:27:39,360 --> 00:27:44,000
Sense yeah, I think so I mean 
it's I think it's a very 

453
00:27:44,000 --> 00:27:48,920
complicated question actually 
because there are factors when 

454
00:27:48,920 --> 00:27:51,320
we're when we're talking about 
AI and a fixed systems that I 

455
00:27:51,320 --> 00:27:53,800
feel like are pulling in 
different directions. 

456
00:27:55,600 --> 00:28:03,560
So one of them is that AI 
agents, they feed on feedback. 

457
00:28:03,600 --> 00:28:07,080
And I think one of the great 
benefits of effect systems is 

458
00:28:07,080 --> 00:28:11,520
that you get to import more 
stuff into your type system like

459
00:28:11,520 --> 00:28:15,360
dependencies and errors and 
asynchronicity and a ton of 

460
00:28:15,360 --> 00:28:19,000
other stuff. 
And in principle that would 

461
00:28:19,000 --> 00:28:20,200
allow. 
You to catch. 

462
00:28:21,040 --> 00:28:24,120
Yeah, it basically makes your 
type check are able to catch 

463
00:28:24,120 --> 00:28:27,040
problems that it would not 
otherwise be able to catch, 

464
00:28:27,040 --> 00:28:29,440
right. 
And I think that can be very 

465
00:28:29,520 --> 00:28:32,800
powerful as a feedback mechanism
for AI agents. 

466
00:28:34,080 --> 00:28:38,600
That's a. 100% been my 
experience is that my AI can 

467
00:28:38,600 --> 00:28:43,440
iterate so much faster when I'm 
using effect systems because 

468
00:28:44,120 --> 00:28:49,320
everything becomes quickly 
evident about what valid states 

469
00:28:49,400 --> 00:28:51,880
actually are. 
And so I've been moving 

470
00:28:51,880 --> 00:28:55,920
incredibly fast when I'm working
on effect oriented code with my 

471
00:28:55,920 --> 00:29:00,280
AI and and I see the difference 
when I go to non effect oriented

472
00:29:00,280 --> 00:29:04,480
code. 
There's the longer iterations to

473
00:29:04,480 --> 00:29:07,760
get to validated state, longer 
and. 

474
00:29:07,760 --> 00:29:11,120
More that's interesting because 
I think on the flip side of that

475
00:29:11,120 --> 00:29:15,560
is that is familiarity, right? 
That effect oriented programming

476
00:29:15,560 --> 00:29:18,640
is probably not exactly over 
represented in the training data

477
00:29:18,640 --> 00:29:21,400
for most AI agents, right? 
So if you have an. 

478
00:29:22,000 --> 00:29:25,080
AI like the skills like I've 
got, you know, the the skills 

479
00:29:25,080 --> 00:29:28,200
that I wrote, I've got, I give 
it the documentation for the 

480
00:29:28,200 --> 00:29:33,040
effect system like you probably 
put your put the the GitHub repo

481
00:29:33,040 --> 00:29:36,640
for stateless into your AI. 
So then it understood, you know,

482
00:29:36,640 --> 00:29:38,280
had access to to be able to 
understand. 

483
00:29:38,280 --> 00:29:41,480
Well, it went and combed through
everything, yeah. 

484
00:29:41,640 --> 00:29:44,320
So like, you're right, like base
models, there's not a lot of 

485
00:29:44,320 --> 00:29:48,160
good, you know, heavy weights 
towards effect oriented 

486
00:29:48,160 --> 00:29:50,880
programming. 
But if you augment your AI with 

487
00:29:50,920 --> 00:29:52,760
the right information, Oh yeah, 
once. 

488
00:29:52,760 --> 00:29:56,640
It went through your library, it
just started getting stuff 

489
00:29:56,640 --> 00:29:58,360
right. 
Yeah. 

490
00:29:58,520 --> 00:29:59,680
So. 
So maybe it's not. 

491
00:29:59,680 --> 00:30:02,200
It's less of an issue than you 
might think if you can just. 

492
00:30:02,720 --> 00:30:05,880
I think because there's so much 
Python code out there, whereas 

493
00:30:05,880 --> 00:30:11,120
the ZO code, well, when it was 
also earlier, but it wasn't, 

494
00:30:11,320 --> 00:30:14,040
yeah, that that was much rockier
of an experience. 

495
00:30:14,040 --> 00:30:17,400
But this, I mean, my build 
system is also, you know, it was

496
00:30:17,400 --> 00:30:19,120
also running everything through 
that. 

497
00:30:19,120 --> 00:30:22,640
So that was a benefit. 
But what I saw come out the 

498
00:30:22,640 --> 00:30:27,160
other end was just like, yeah. 
There's actually a benefit to a 

499
00:30:27,160 --> 00:30:31,000
project like Stateless, which is
probably not very heavy in the 

500
00:30:31,000 --> 00:30:35,120
models yet because then there's 
nothing to confuse it at this 

501
00:30:35,120 --> 00:30:37,480
point, right? 
Like, like you, you give it the,

502
00:30:37,560 --> 00:30:40,840
the repo for Stateless and it's 
like, OK, that's where I find 

503
00:30:40,840 --> 00:30:42,800
all of the truth about this 
thing. 

504
00:30:42,960 --> 00:30:45,440
Whereas, you know, if Stateless 
has been around for five years 

505
00:30:45,440 --> 00:30:48,360
or, you know, as long as Zeo, 
then it starts to stumble on 

506
00:30:48,360 --> 00:30:51,240
like, oh, what's actually right?
What's actually the right 

507
00:30:51,240 --> 00:30:53,120
knowledge that I should be using
here? 

508
00:30:53,320 --> 00:30:55,800
Because it's got all the old 
stuff and then it doesn't really

509
00:30:55,800 --> 00:30:58,040
know how to distinguish the old 
stuff from the new stuff. 

510
00:30:58,360 --> 00:31:01,480
And so I've had to like build 
skills, Zeo to be like, like 

511
00:31:01,480 --> 00:31:04,880
just you do it this way because 
that's the new way. 

512
00:31:05,120 --> 00:31:06,320
But of course the model doesn't 
know. 

513
00:31:06,320 --> 00:31:08,840
That's the new way. 
So I don't think we let you 

514
00:31:08,840 --> 00:31:11,240
finish answering that previous 
question. 

515
00:31:11,960 --> 00:31:13,440
About. 
But it would be an interesting 

516
00:31:13,440 --> 00:31:16,880
experiment to run right to to 
have some kind of toy problem, 

517
00:31:16,880 --> 00:31:20,080
say, OK, try to solve it with 
just plain old Python And then 

518
00:31:20,080 --> 00:31:24,120
try to solve it using stateless.
And then try to measure how many

519
00:31:24,120 --> 00:31:27,840
iterations do those actually 
take to to make it green and how

520
00:31:27,840 --> 00:31:30,440
many errors they do. 
Does does does then actually 

521
00:31:30,440 --> 00:31:35,520
ship in the end also so? 
There is another question. 

522
00:31:35,800 --> 00:31:43,600
So with Zeo and a lot of effect 
libraries, they one of the 

523
00:31:43,600 --> 00:31:48,160
things that they do is they go, 
OK, well, your normal print you 

524
00:31:48,160 --> 00:31:50,440
can't use anymore. 
You have to use our print, which

525
00:31:50,440 --> 00:31:55,920
is, you know, the effect 1 and I
and you haven't done that. 

526
00:31:55,920 --> 00:31:59,840
You you said OK, we you know you
can just use the normal library.

527
00:31:59,920 --> 00:32:03,000
Well, so the way that I think 
it's about stages at this point 

528
00:32:03,000 --> 00:32:06,440
is that the repository now 
provides kind of the core 

529
00:32:06,440 --> 00:32:09,160
functionality, but it doesn't 
really provide you with like a 

530
00:32:09,160 --> 00:32:13,480
standard library of stuff that 
you can use out-of-the-box. 

531
00:32:13,480 --> 00:32:20,000
You kind of have to define. 
If you want a real console type 

532
00:32:20,000 --> 00:32:24,160
that represents console in the 
abstract, then you have to write

533
00:32:24,160 --> 00:32:26,600
it yourself basically. 
And same for a lot of other 

534
00:32:26,600 --> 00:32:31,880
stuff. 
But I think if, if the Python 

535
00:32:31,880 --> 00:32:37,160
community at large starts to get
interested in in this type of of

536
00:32:37,160 --> 00:32:40,400
the style of programming, I hope
that that would mean a 

537
00:32:40,400 --> 00:32:44,560
proliferation of different 
libraries that you can install 

538
00:32:44,560 --> 00:32:49,280
that kind of gives you give you 
good integration with file 

539
00:32:49,280 --> 00:32:52,880
reading and fast API and some of
the other popular libraries out 

540
00:32:52,880 --> 00:32:55,160
there, right. 
So yeah. 

541
00:32:55,560 --> 00:32:58,880
Yeah, I think you're right. 
It's like the once you create 

542
00:32:58,880 --> 00:33:01,760
the right foundations that are 
effect oriented, building the 

543
00:33:01,760 --> 00:33:04,800
library because a system around 
that now at this point is 

544
00:33:04,840 --> 00:33:08,840
trivial like and creating 
wrappers around, you know, 

545
00:33:08,840 --> 00:33:13,640
whatever libraries that you 
would want to be affectified. 

546
00:33:14,840 --> 00:33:18,160
But I did find out a stumbling 
point when I was first trying to

547
00:33:18,160 --> 00:33:21,880
struggle with Zeo was it's like 
all of a sudden it's like, well,

548
00:33:21,960 --> 00:33:25,720
all of these extra libraries 
that you have to use instead. 

549
00:33:25,720 --> 00:33:29,400
And I didn't know why. 
And I mean, it's just 

550
00:33:29,400 --> 00:33:32,960
interesting to see that Oh yeah,
it's relatively straightforward 

551
00:33:32,960 --> 00:33:38,960
to to use the standard library 
with stateless. 

552
00:33:39,920 --> 00:33:41,560
I mean, you have to do a little 
bit more, but. 

553
00:33:42,440 --> 00:33:45,240
Yeah, I mean, one fun trick that
I actually I have been meaning 

554
00:33:45,240 --> 00:33:49,160
to document it is that if you 
use protocols to express your 

555
00:33:49,160 --> 00:33:54,480
dependencies, you can actually 
wire up your protocol to match 

556
00:33:54,480 --> 00:33:58,320
the shape of the module. 
And then you can actually inject

557
00:33:58,320 --> 00:34:01,080
the imported standard library 
module directly. 

558
00:34:01,080 --> 00:34:05,640
And your type checker will 
actually verify that the module 

559
00:34:05,640 --> 00:34:08,360
shape matches the protocol that 
you that you wrote. 

560
00:34:08,880 --> 00:34:11,920
So you can get started pretty 
quickly with very little 

561
00:34:11,920 --> 00:34:15,920
overhead I think, which is a 
nice little feature of Python 

562
00:34:15,920 --> 00:34:18,199
that it has so great support for
duct typing. 

563
00:34:18,199 --> 00:34:22,679
Right that. 
Yeah, yeah, I think the, I think

564
00:34:22,679 --> 00:34:26,080
that the two chapters make use 
of that. 

565
00:34:26,679 --> 00:34:28,880
One of the questions I had on 
that which we were looking at in

566
00:34:28,880 --> 00:34:32,960
our our book night this week was
that there didn't seem to be 

567
00:34:33,960 --> 00:34:37,400
support or something in the 
variance system. 

568
00:34:37,400 --> 00:34:42,440
Oh, the covariance variance. 
And so in the your protocol 

569
00:34:42,440 --> 00:34:48,280
example, you had to like do a 
cast to get it to to the right 

570
00:34:48,280 --> 00:34:49,639
type. 
And and I think you even 

571
00:34:49,639 --> 00:34:53,199
document this on like subtypes. 
You have to you have to like 

572
00:34:53,600 --> 00:34:59,160
lower the the lower into the the
type that you that's required. 

573
00:35:00,160 --> 00:35:02,640
Yeah, it depends a little bit on
the type checker that you use, 

574
00:35:02,640 --> 00:35:05,360
because they don't really behave
the same. 

575
00:35:05,600 --> 00:35:09,520
So again, for the parts of your 
audience that are not well worse

576
00:35:09,520 --> 00:35:14,240
than Python, in Python types are
just annotation on Python code 

577
00:35:14,240 --> 00:35:18,000
and that means that there isn't 
like one list type checker with 

578
00:35:18,320 --> 00:35:20,760
well defined behavior. 
There are different type 

579
00:35:20,760 --> 00:35:24,560
checkers that most of the time 
agree on how inference and stuff

580
00:35:24,560 --> 00:35:26,360
like that should work, but not 
always. 

581
00:35:27,800 --> 00:35:31,680
So in Pyrite for example, even 
though you if you annotate 

582
00:35:31,680 --> 00:35:34,680
something with it's super type, 
it is still treated as it's 

583
00:35:34,680 --> 00:35:38,440
subtype in in certain context 
and that leads to type errors 

584
00:35:38,440 --> 00:35:39,880
when you're working with 
stateless. 

585
00:35:41,000 --> 00:35:42,760
So to get around that I've 
provided this. 

586
00:35:43,480 --> 00:35:48,280
I use pyrites mostly when OH. 
Because I've been using tie. 

587
00:35:50,040 --> 00:35:52,400
Yeah, I've, I haven't tested tie
in a while. 

588
00:35:52,400 --> 00:35:54,440
I think it's probably gotten a 
lot better. 

589
00:35:54,440 --> 00:35:59,000
But what I found is that the 
style of inference in Pyrite 

590
00:35:59,000 --> 00:36:04,240
just works really well with the 
types of expectations that 

591
00:36:04,240 --> 00:36:06,240
Stateless has about how 
inference should work, 

592
00:36:06,240 --> 00:36:11,560
especially around union types, 
which are used very extensively 

593
00:36:11,560 --> 00:36:14,920
in Stateless. 
So it's it's kind of important 

594
00:36:14,920 --> 00:36:18,960
for the experience of using 
Stateless that your your type 

595
00:36:18,960 --> 00:36:22,840
checker is good at inferring 
union types. 

596
00:36:22,840 --> 00:36:25,720
And it's a little bit 
unfortunate that my PIE, which 

597
00:36:25,720 --> 00:36:29,920
is a very popular type checker, 
is not very good at union types 

598
00:36:29,920 --> 00:36:34,720
in general because it tends to 
infer a super type of a union 

599
00:36:34,720 --> 00:36:38,920
instead of preserving the union,
which leads to some some 

600
00:36:38,920 --> 00:36:42,920
problems here and there. 
Yeah, I I kind of gave up on my 

601
00:36:42,920 --> 00:36:47,200
pie self. 
Is that general in the Python 

602
00:36:47,200 --> 00:36:47,840
community? 
The. 

603
00:36:47,880 --> 00:36:52,600
Well, it was the original 1 and 
it feels like it, I mean, my 

604
00:36:52,600 --> 00:36:56,120
impression is it doesn't really 
keep up as well as some of the 

605
00:36:56,120 --> 00:36:58,520
others. 
And I just, I just kind of 

606
00:36:58,520 --> 00:37:03,320
committed to tie because I, I 
guess I trust Astral for 

607
00:37:03,320 --> 00:37:07,080
whatever reason and it's and 
it's fast and yeah, and they've 

608
00:37:07,080 --> 00:37:11,320
been progressing a lot so. 
Have you had any issues with the

609
00:37:11,520 --> 00:37:13,640
union types? 
I don't think so. 

610
00:37:13,640 --> 00:37:16,480
Specifically, I don't I. 
Think PSI does the same thing 

611
00:37:16,480 --> 00:37:21,160
that pyrite does. 
So it they do not unify types 

612
00:37:21,160 --> 00:37:24,800
into their super type in the 
same way that my π does, they 

613
00:37:24,800 --> 00:37:28,360
they take the same route as 
Pyrite does, which I think is. 

614
00:37:29,000 --> 00:37:30,600
Preserving the algebra or 
something. 

615
00:37:31,720 --> 00:37:34,280
Yes. 
So it's like it's it's keeping 

616
00:37:34,280 --> 00:37:37,920
the more specific type in most 
cases, which I think is what you

617
00:37:37,920 --> 00:37:42,280
want most of the time unless you
specifically annotate it as 

618
00:37:42,280 --> 00:37:46,520
something else, right then which
is then the other problem that I

619
00:37:46,520 --> 00:37:49,280
have with Pyrite that they, they
then do not respect those 

620
00:37:49,280 --> 00:37:53,480
annotations always, which is 
which creates other problems. 

621
00:37:53,480 --> 00:37:56,760
But that's why this utility type
exists, which is basically just 

622
00:37:56,760 --> 00:38:04,360
the identity function, but which
can with type safety tell your 

623
00:38:04,360 --> 00:38:07,720
type checker that you actually 
need to interpret this type as 

624
00:38:07,720 --> 00:38:12,000
it's super type in this context.
Is that the type as or what it 

625
00:38:12,000 --> 00:38:13,520
what you have a name for it you 
know it's. 

626
00:38:13,520 --> 00:38:17,040
Called as type I think. 
As type as was closed just 

627
00:38:17,040 --> 00:38:22,560
backwards, yeah. 
And that you have to do that to 

628
00:38:23,040 --> 00:38:25,360
because the inference is 
insufficient. 

629
00:38:25,360 --> 00:38:27,040
Or what was the reason for the 
as type? 

630
00:38:27,720 --> 00:38:32,880
So the way that handling, we 
haven't obviously haven't talked

631
00:38:32,880 --> 00:38:36,680
about that now I'm realizing, 
but so the way that stateless 

632
00:38:36,680 --> 00:38:40,320
works is that you yield these 
operations that I call abilities

633
00:38:40,320 --> 00:38:45,440
that then get handled by up, up 
the call stack basically and 

634
00:38:45,440 --> 00:38:48,040
much the same way that exception
handling works. 

635
00:38:50,040 --> 00:38:53,800
And then the type inference 
there works such that when you 

636
00:38:53,800 --> 00:38:58,680
handle an ability, that ability 
is eliminated from the effect 

637
00:38:58,680 --> 00:39:02,680
type so that that it tells you 
that you can, it tells you when 

638
00:39:02,680 --> 00:39:05,400
you've handled all the abilities
that needs to be handled in 

639
00:39:05,400 --> 00:39:07,840
order to run the effect, 
basically, Yeah. 

640
00:39:07,920 --> 00:39:10,920
And in order for that. 
Inference like your run, your 

641
00:39:10,920 --> 00:39:15,320
run function takes essentially 
an effect, but that effect can't

642
00:39:15,320 --> 00:39:18,160
have any pending abilities like 
all. 

643
00:39:18,280 --> 00:39:20,240
All abilities have to be 
resolved to actually. 

644
00:39:20,560 --> 00:39:23,400
And that's like type system 
enforced, right? 

645
00:39:23,520 --> 00:39:25,720
Yeah, well, I think you've. 
Got an example? 

646
00:39:25,880 --> 00:39:29,000
Yes, yeah. 
Well, when you have pending 

647
00:39:29,000 --> 00:39:31,040
abilities. 
Yeah, it's cool. 

648
00:39:31,080 --> 00:39:35,720
So the the issue with that today
is that that requires union 

649
00:39:35,720 --> 00:39:37,720
subtraction at the type level, 
right? 

650
00:39:37,720 --> 00:39:40,680
Because you have some kind of 
union type of operations that in

651
00:39:40,680 --> 00:39:43,240
effect depends on. 
Now you're handling maybe a 

652
00:39:43,240 --> 00:39:45,520
subset of them. 
Now your type checker has to 

653
00:39:45,520 --> 00:39:49,440
figure out that these types 
actually correspond to a subset 

654
00:39:49,440 --> 00:39:51,280
of the union that you have in 
your effect. 

655
00:39:51,720 --> 00:39:55,480
And so what's left is then the 
resulting effect type, right? 

656
00:39:56,400 --> 00:39:59,960
And that kind of works by 
accident today in Pyrite where 

657
00:39:59,960 --> 00:40:04,200
it it checks it's, it checks the
type exactly, including type 

658
00:40:04,200 --> 00:40:07,320
parameters. 
So it won't work with subtypes. 

659
00:40:07,320 --> 00:40:10,960
It, it can't figure out that 
let's say that you have some 

660
00:40:10,960 --> 00:40:14,040
abstract type called console and
now you have a mock console. 

661
00:40:14,080 --> 00:40:16,960
It can't figure out that mock 
console is actually an instance 

662
00:40:16,960 --> 00:40:19,200
of console. 
So supplying this here should 

663
00:40:19,200 --> 00:40:21,160
actually eliminate that 
dependency. 

664
00:40:21,880 --> 00:40:27,360
So it's specifically on the 
elimination of types where where

665
00:40:27,360 --> 00:40:30,400
the the subtypes confuse the 
type checker. 

666
00:40:31,040 --> 00:40:32,320
Yes, exactly. 
Yeah. 

667
00:40:32,560 --> 00:40:34,640
So it's probably I'm pretty I'm 
hoping that the. 

668
00:40:35,200 --> 00:40:37,120
Thing to solve in the type 
checker. 

669
00:40:37,920 --> 00:40:40,240
Yes. 
But I think I hope that we will 

670
00:40:40,240 --> 00:40:42,640
eventually have some of the same
mechanisms that they have in 

671
00:40:42,640 --> 00:40:47,920
TypeScript that you can use to 
address this type of behavior. 

672
00:40:47,920 --> 00:40:50,640
And there is actually a pip 
called type manipulation. 

673
00:40:51,440 --> 00:40:57,640
I think it's is it 828 or 
something like that? 

674
00:40:58,560 --> 00:41:01,720
I can't remember the exact 
number, but it's it's it that 

675
00:41:01,720 --> 00:41:04,840
would allow a lot of these 
problems to be handled at the 

676
00:41:04,840 --> 00:41:07,600
library level instead of in the 
type checker level. 

677
00:41:07,840 --> 00:41:10,760
Of course, the type checker 
needs to actually implement that

678
00:41:10,760 --> 00:41:19,280
pip in order for that to work, 
but so I'm not sure. 

679
00:41:19,280 --> 00:41:21,720
I think it's it's still being 
discussed. 

680
00:41:21,720 --> 00:41:24,960
It's certainly not accepted yet,
and I also imagine that there is

681
00:41:24,960 --> 00:41:28,760
quite a lot of controversy 
around it, because it is. 

682
00:41:29,920 --> 00:41:33,120
It does make the type system in 
Python quite a lot more 

683
00:41:33,240 --> 00:41:38,760
complicated than it is today, 
which I think many people feel 

684
00:41:38,760 --> 00:41:41,920
goes against the spirit of the 
Python type system, which I can 

685
00:41:41,920 --> 00:41:45,200
also appreciate. 
But for status specifically, it 

686
00:41:45,200 --> 00:41:47,400
would be a really powerful and 
useful thing. 

687
00:41:48,480 --> 00:41:52,240
So I, I sent you, one of the 
questions that I sent you was 

688
00:41:52,240 --> 00:41:57,440
about the annotated. 
And, and of course this is a 

689
00:41:57,440 --> 00:41:59,520
totally different direction than
you've taken. 

690
00:41:59,800 --> 00:42:05,880
But it occurred to me that the 
annotated feature would allow 

691
00:42:06,120 --> 00:42:11,720
you, somebody to express a type 
system the way they wanted to 

692
00:42:11,720 --> 00:42:14,440
like, you know, maybe look like 
a native type system. 

693
00:42:14,760 --> 00:42:18,360
It would require a separate 
annotation processor. 

694
00:42:18,360 --> 00:42:22,840
You wouldn't be able to use the,
the regular type checker by 

695
00:42:22,840 --> 00:42:25,920
itself to solve this. 
I don't know if you thought 

696
00:42:25,920 --> 00:42:28,720
about that or looked into it at 
all or something, but you know, 

697
00:42:28,720 --> 00:42:31,480
I just kind of clicked in my 
head. 

698
00:42:33,600 --> 00:42:37,520
I did give it some thought and 
I, I arrived that I think it's 

699
00:42:37,520 --> 00:42:39,840
the same place that you arrived 
that is that. 

700
00:42:41,920 --> 00:42:43,400
Well, there, there. 
I think there are two ways you 

701
00:42:43,400 --> 00:42:48,080
could go about doing that. 
One would be to just have it as 

702
00:42:48,360 --> 00:42:51,360
annotations that are that are 
like effect tagging. 

703
00:42:51,360 --> 00:42:55,480
So they have no real consequence
for the type checking 

704
00:42:55,480 --> 00:42:57,920
essentially. 
And they have no real, they are,

705
00:42:57,920 --> 00:43:02,040
of course, they'd have no 
runtime consequences because 

706
00:43:02,360 --> 00:43:04,720
type annotations never do in 
Python. 

707
00:43:06,600 --> 00:43:12,000
I mean, I, I think that a lot of
the power of a fixed systems 

708
00:43:12,000 --> 00:43:17,080
comes exactly from importing 
more information into the type 

709
00:43:17,080 --> 00:43:20,760
system. 
And so I, I'm not sure that that

710
00:43:20,760 --> 00:43:23,840
would be very worthwhile. 
I think you would want to have 

711
00:43:23,840 --> 00:43:29,000
some kind of static analysis 
tied to that annotation one way 

712
00:43:29,000 --> 00:43:31,840
or the other. 
And then I think you're kind of 

713
00:43:32,720 --> 00:43:36,200
probably half or even a whole 
step towards writing a 

714
00:43:36,200 --> 00:43:39,560
completely new type checker to 
compete with the existing ones. 

715
00:43:41,920 --> 00:43:47,280
So I'm, I, I'm, I don't know if 
there is much to be gained from 

716
00:43:47,280 --> 00:43:53,000
doing that other than you would 
have complete freedom to to 

717
00:43:53,000 --> 00:43:56,360
define the semantics and the 
inference exactly as you want it

718
00:43:56,360 --> 00:44:02,800
for and a fixed system, right? 
But yeah, but I mean in 

719
00:44:02,920 --> 00:44:06,960
stateless specifically, I've, I 
mean in Stateless specifically, 

720
00:44:06,960 --> 00:44:09,880
I've tried to as much as 
possible integrate with the 

721
00:44:09,880 --> 00:44:13,240
tools that exist already. 
So an example of that is the 

722
00:44:13,280 --> 00:44:17,840
async integration, which 
actually uses the async IO 

723
00:44:17,840 --> 00:44:23,000
library for it's async handling.
And I felt that that was 

724
00:44:23,000 --> 00:44:28,360
preferable to writing a totally 
new async mechanism that would 

725
00:44:28,360 --> 00:44:33,720
compete with async IO, even 
though it turned out to be 

726
00:44:33,720 --> 00:44:36,200
pretty hairy to get that 
integration actually working. 

727
00:44:36,200 --> 00:44:40,720
Because, yeah, I actually 
thought that it would be easy 

728
00:44:40,720 --> 00:44:44,440
given that generators are Co 
routines and a sync IO also 

729
00:44:44,440 --> 00:44:47,480
works on Co routines. 
But it just turns out that a 

730
00:44:47,480 --> 00:44:50,640
sync IO have very different 
expectations about what can be 

731
00:44:50,640 --> 00:44:53,600
yielded and what is being sent 
back. 

732
00:44:54,440 --> 00:44:57,240
So because the generator is 
probably not thread safe, right?

733
00:44:57,240 --> 00:45:00,440
Like it's a state machine, but 
they probably don't do any locks

734
00:45:00,640 --> 00:45:02,840
in internally in a generator or 
something. 

735
00:45:03,520 --> 00:45:07,320
No, but I actually don't think 
that Co routines are thread safe

736
00:45:07,800 --> 00:45:10,560
either. 
So the ones that sync IO uses 

737
00:45:10,560 --> 00:45:13,320
internally. 
So that that's probably a 

738
00:45:13,320 --> 00:45:15,920
solvable problem. 
Yeah, Yeah, exactly. 

739
00:45:17,320 --> 00:45:19,000
Yeah. 
But also the state of the Co 

740
00:45:19,000 --> 00:45:20,800
routine itself is not thread 
safe. 

741
00:45:21,360 --> 00:45:25,280
I think so. 
That's where things probably get

742
00:45:25,440 --> 00:45:31,520
dicey, but you did create an 
adapter to adapt from async IO 

743
00:45:31,640 --> 00:45:35,280
constructs into your effect 
realm. 

744
00:45:35,280 --> 00:45:37,040
Yes. 
And that was actually a major 

745
00:45:37,040 --> 00:45:39,560
redesign of the whole thing 
because originally I had 

746
00:45:39,760 --> 00:45:42,360
attempted to provide only the 
effects that CEO provides. 

747
00:45:42,360 --> 00:45:45,560
So that is type safe dependency 
injection and type safe error 

748
00:45:45,560 --> 00:45:48,640
handling. 
But in order to do this trick 

749
00:45:48,640 --> 00:45:52,440
with a sync IO that I do, which 
is that you're allowed to also 

750
00:45:52,760 --> 00:45:56,480
yield Co routines. 
In order to do that and not lie 

751
00:45:56,480 --> 00:46:00,920
about what can actually be 
yielded in the types, I had to 

752
00:46:00,920 --> 00:46:06,000
allow you to yield more or less 
arbitrary values. 

753
00:46:06,400 --> 00:46:08,800
So I do have one type 
constraints on what can be 

754
00:46:08,800 --> 00:46:12,560
yielded and that is that it's it
has to be a subtype of this 

755
00:46:12,560 --> 00:46:14,640
ability type that I was talking 
about before. 

756
00:46:15,800 --> 00:46:19,000
And that's there really only for
type inference reasons that that

757
00:46:19,000 --> 00:46:21,400
just makes the type inference 
work better that the types are 

758
00:46:21,400 --> 00:46:25,440
not totally unconstrained. 
But then I can have a wrapper 

759
00:46:25,440 --> 00:46:29,240
around and a sync IO Co routine 
that is like an ability called 

760
00:46:29,240 --> 00:46:32,680
async, which is really just a 
wrapper around the the Co 

761
00:46:33,680 --> 00:46:38,640
routine from a sync IO itself. 
And then my effects interpreter 

762
00:46:38,640 --> 00:46:44,600
can just defer to the async IO 
interpreter whenever it sees and

763
00:46:44,600 --> 00:46:49,440
a sync IO Co routine. 
So it's kind of a hack I think, 

764
00:46:49,440 --> 00:46:53,480
but it does it does provide a 
something like a bridge between 

765
00:46:53,480 --> 00:46:57,960
the two Co routine. 
It actually feels more like like

766
00:46:57,960 --> 00:47:03,800
a Keo or like a algebraic effect
approach in that that you would 

767
00:47:03,800 --> 00:47:07,160
have an ability for a sync. 
And that's, that's exactly what 

768
00:47:07,160 --> 00:47:09,480
Keo does, if you're you're 
familiar with that one. 

769
00:47:10,200 --> 00:47:10,800
Yeah. 
And it's. 

770
00:47:10,800 --> 00:47:14,320
Exactly what stateless does too.
Yeah, I think it does too. 

771
00:47:14,320 --> 00:47:16,760
The only thing is that it needs 
to be special cased for 

772
00:47:16,760 --> 00:47:19,320
different reasons. 
So it's the one ability that you

773
00:47:19,320 --> 00:47:22,920
don't need to handle before 
supplying it to run, because run

774
00:47:22,920 --> 00:47:25,360
will actually. 
Has its own handle that for 

775
00:47:25,600 --> 00:47:29,880
async yeah, or it handles it for
use the async IO interpreter. 

776
00:47:29,880 --> 00:47:33,120
In those cases I have. 
To say, I like your naming too. 

777
00:47:33,880 --> 00:47:37,760
I mean like the needs and 
abilities and you know, it's 

778
00:47:37,760 --> 00:47:41,800
like when supply, yeah. 
And it's just like, yeah, it's 

779
00:47:41,800 --> 00:47:44,040
much more. 
I feel like it's more intuitive,

780
00:47:44,040 --> 00:47:46,920
more Pythonic maybe? 
So yeah, thank you. 

781
00:47:47,000 --> 00:47:50,120
I mean, I did try to put a lot 
of attention into the naming 

782
00:47:50,120 --> 00:47:52,840
also. 
It also stole a lot of it from 

783
00:47:52,840 --> 00:47:54,840
other, other places. 
But yeah, yeah. 

784
00:47:54,840 --> 00:47:58,800
So abilities I actually stole 
from at the abilities 

785
00:47:59,160 --> 00:48:01,080
terminology I actually stole 
from Unison. 

786
00:48:01,880 --> 00:48:04,440
Which ultimately is the first 
place where I heard the the 

787
00:48:04,440 --> 00:48:08,720
ability terminology. 
And now there's capabilities. 

788
00:48:08,720 --> 00:48:11,240
Scala now has capabilities. 
Oh, which? 

789
00:48:11,240 --> 00:48:13,720
What's the difference between an
ability and a capability? 

790
00:48:13,880 --> 00:48:16,920
I I'm constantly confused by 
Scala. 

791
00:48:17,360 --> 00:48:20,480
I can't. 
I can't say I ever really slowly

792
00:48:20,480 --> 00:48:23,320
understood it. 
I wonder semantically what the 

793
00:48:23,320 --> 00:48:25,680
difference between ability and 
capability is, and if that has 

794
00:48:25,680 --> 00:48:30,560
any difference in like abilities
versus capabilities and effect 

795
00:48:30,560 --> 00:48:34,200
systems. 
Anyways, no, we were talking 

796
00:48:34,200 --> 00:48:37,800
about how we were. 
I don't know, curious why you 

797
00:48:37,800 --> 00:48:42,440
didn't adopt the ZEO terminology
for things, but then also 

798
00:48:42,880 --> 00:48:45,040
grateful that you didn't at the 
same time. 

799
00:48:45,080 --> 00:48:49,040
Yeah. 
I mean, I think, I think at one 

800
00:48:49,040 --> 00:48:53,680
point I also considered calling 
effect IO, but I because that's 

801
00:48:53,680 --> 00:48:55,880
essentially what they do in, in 
Co, right. 

802
00:48:55,880 --> 00:48:59,240
I mean, there's AC there, but 
that's kind of just a marketing 

803
00:48:59,240 --> 00:49:03,800
I think. 
But I, I felt like that was too 

804
00:49:03,800 --> 00:49:06,400
specific for what I was trying 
to do with this library. 

805
00:49:06,400 --> 00:49:09,000
It's not really limited to IO, 
right? 

806
00:49:09,000 --> 00:49:12,080
It's also dependency injection 
and and error handling and 

807
00:49:12,600 --> 00:49:16,080
asynchronicity and a lot of 
other stuff really that you 

808
00:49:16,080 --> 00:49:20,520
would want to express as a as an
effect rather than than 

809
00:49:20,520 --> 00:49:24,560
something that just constrained 
to IO, even though a lot of the 

810
00:49:24,560 --> 00:49:26,800
time that is what it what you're
using it for, right? 

811
00:49:27,680 --> 00:49:31,400
Yeah, it's the most common use 
case, but but the I guess the 

812
00:49:32,040 --> 00:49:36,040
the intention of algebraic 
effects is that it can be 

813
00:49:36,040 --> 00:49:37,880
anything. 
Yeah, and I. 

814
00:49:38,000 --> 00:49:41,000
Don't have to be. 
It doesn't have to be about IOI.

815
00:49:41,000 --> 00:49:46,320
Personally found it kind of 
confusing the focus on IO and 

816
00:49:46,320 --> 00:49:50,120
because of is this just IO and 
you know and then when you go no

817
00:49:50,120 --> 00:49:53,320
it doesn't seem like it. 
So that I think it's nicer to 

818
00:49:53,320 --> 00:49:58,400
not over focus on IO even though
yes, it's mostly used for that. 

819
00:49:59,200 --> 00:50:02,280
But at the same time, there's, 
there's kind of a Zeo. 

820
00:50:03,920 --> 00:50:07,600
Well, a lot of your, the things 
you think about are IO and, and 

821
00:50:07,600 --> 00:50:10,240
thus A Zeo. 
Then there's Z stream and then 

822
00:50:10,240 --> 00:50:12,800
there's ZSTM. 
And then there's like, like 

823
00:50:12,800 --> 00:50:17,360
there ends up being many 
different, like monetic data 

824
00:50:17,360 --> 00:50:21,320
types that represent effects, 
different types of effects. 

825
00:50:21,600 --> 00:50:27,400
And so there's a bit of a hidden
complexity that you get into 

826
00:50:28,200 --> 00:50:32,560
that's not immediately apparent.
But then when you go into like 

827
00:50:32,560 --> 00:50:36,720
Kyo or or an algebraic effect 
system, it's like there can be 

828
00:50:36,720 --> 00:50:39,560
many different types of effects.
And let's just give that to you 

829
00:50:39,560 --> 00:50:41,760
up front. 
And that's much more useful to 

830
00:50:41,760 --> 00:50:44,400
me, yeah. 
And they can all compose. 

831
00:50:44,560 --> 00:50:50,880
And that's in In the Zeo world, 
the the there is no implicit 

832
00:50:50,880 --> 00:50:53,120
composition across the different
effect types. 

833
00:50:54,720 --> 00:51:00,000
And So what is the main 
composition mechanism in 

834
00:51:00,280 --> 00:51:03,560
stateless? 
The main composition mechanism 

835
00:51:03,560 --> 00:51:07,800
is union types, which is 
actually why you don't need 

836
00:51:07,800 --> 00:51:11,720
higher kind of types to 
represent effects in in 

837
00:51:11,720 --> 00:51:15,680
stateless. 
So if when you need to depend on

838
00:51:15,680 --> 00:51:20,800
multiple effects, it's basically
just adding a new ability to 

839
00:51:20,800 --> 00:51:26,320
your effect type. 
So which is to say is adding a 

840
00:51:26,320 --> 00:51:30,520
new type of operation that this 
generator can yield now. 

841
00:51:31,120 --> 00:51:35,160
And that's the. 
Algebraic part, that is the 

842
00:51:35,440 --> 00:51:38,640
well, that's a big part of the 
algebraic part, yeah. 

843
00:51:39,800 --> 00:51:42,760
The other part of the algebraic 
part is that you didn't get to 

844
00:51:42,760 --> 00:51:46,160
supply your own handler for the 
effects also. 

845
00:51:46,240 --> 00:51:51,440
And that also happens with an 
algebra where you can handle a 

846
00:51:51,440 --> 00:51:56,080
subset of the the operations 
that were yielded and then you 

847
00:51:56,080 --> 00:51:59,440
would need to handle the rest of
the operation somewhere else. 

848
00:52:00,200 --> 00:52:03,800
And that is then subtracted from
this union type again, right? 

849
00:52:03,800 --> 00:52:09,000
So, so part of the the algebraic
effects story is usually also 

850
00:52:09,000 --> 00:52:13,760
that you get to control how many
times your computation is 

851
00:52:13,760 --> 00:52:17,720
resumed in your interpreter, 
which is not something that you 

852
00:52:17,720 --> 00:52:20,400
usually get with traditional MTL
style monads, right? 

853
00:52:20,400 --> 00:52:25,600
So you have in the IO monad, it 
will it will basically always 

854
00:52:25,600 --> 00:52:28,680
resume the computation with when
the result is ready. 

855
00:52:28,680 --> 00:52:32,360
Same for reader monad. 
But in algebraic effects 

856
00:52:32,360 --> 00:52:36,320
systems, you get to decide at 
the interpreter level whether or

857
00:52:36,320 --> 00:52:39,560
not you want to actually resume 
the computation. 

858
00:52:39,880 --> 00:52:43,680
Which continuation? 
Yes, exactly. 

859
00:52:44,120 --> 00:52:46,840
So that means that you get to 
express things like error 

860
00:52:46,840 --> 00:52:51,280
handling and other things with 
the same abstraction because you

861
00:52:51,280 --> 00:52:53,760
can say, well, that was actually
an error now. 

862
00:52:53,760 --> 00:52:56,280
So that means that I should not 
resume the computation. 

863
00:52:58,080 --> 00:53:00,440
Yeah. 
Yeah, I think Q has a similar 

864
00:53:00,440 --> 00:53:07,720
approach of of errors are are 
just I don't know if you want to

865
00:53:07,720 --> 00:53:11,640
handle errors or aborts. 
Those are represented as as 

866
00:53:12,160 --> 00:53:15,200
dependencies. 
And so then you need to decide 

867
00:53:15,200 --> 00:53:17,760
how you want to handle those 
things. 

868
00:53:17,800 --> 00:53:22,520
Yeah, it's similar. 
It's cool. 

869
00:53:22,600 --> 00:53:26,520
So what's what's next? 
You still still working on 

870
00:53:26,520 --> 00:53:30,560
Stateless and moving it forward 
and what's what's what's on the?

871
00:53:31,560 --> 00:53:35,960
I think for now, kind of the the
core library of it is sort of 

872
00:53:36,240 --> 00:53:40,880
done until there are new 
opportunities to improve what's 

873
00:53:40,880 --> 00:53:43,160
there when whenever the language
evolves. 

874
00:53:43,640 --> 00:53:47,920
So one thing that I want to 
improve is the async story, but 

875
00:53:47,920 --> 00:53:51,560
I don't think that that's really
possible unless another pip that

876
00:53:51,560 --> 00:53:54,800
I'm watching closely lands which
would allow you to do yield from

877
00:53:54,800 --> 00:53:58,360
inside of asynchronous or async 
functions. 

878
00:53:59,480 --> 00:54:03,440
So if if that happens, then that
means that I can basically build

879
00:54:03,440 --> 00:54:09,480
my status interpreter on top of 
the Python Co routines instead 

880
00:54:09,480 --> 00:54:13,800
of deferring to them when you 
need to do something 

881
00:54:13,800 --> 00:54:15,920
asynchronous. 
So that means that you could you

882
00:54:15,920 --> 00:54:19,520
could use yield from whenever 
you want to do something with 

883
00:54:19,520 --> 00:54:22,920
stateless and you can use a 
weight whenever you need to do 

884
00:54:22,920 --> 00:54:25,680
something with a sync IO in the 
same function. 

885
00:54:26,120 --> 00:54:29,760
And I think that would be way 
more ergonomic probably than 

886
00:54:29,760 --> 00:54:32,880
what you have today, even though
you didn't kind of lose this 

887
00:54:33,520 --> 00:54:37,160
async as an as a just another 
ability type thing. 

888
00:54:37,680 --> 00:54:41,480
I think it's more easy to follow
what's happening because async 

889
00:54:41,480 --> 00:54:43,960
is it's already kind of baked 
into stateless, right? 

890
00:54:43,960 --> 00:54:47,200
So it's not like you that would 
also be the case. 

891
00:54:47,200 --> 00:54:51,560
If you start mixing async and 
yield from statements directly, 

892
00:54:51,640 --> 00:54:55,840
then you can't really separate 
the async effect from all other 

893
00:54:55,840 --> 00:54:57,480
effects. 
It kind of it's baked into the 

894
00:54:57,480 --> 00:55:00,840
generator, right? 
But that's already the case. 

895
00:55:00,840 --> 00:55:03,160
So I feel like I would not 
really lose anything there. 

896
00:55:03,760 --> 00:55:07,520
And then the other thing is to 
try to, if this type 

897
00:55:07,520 --> 00:55:11,440
manipulation pipelines try to 
simplify or improve the 

898
00:55:11,440 --> 00:55:16,240
experience with type or 
inference across different type 

899
00:55:16,240 --> 00:55:18,800
checkers and actually improve 
another thing that we didn't 

900
00:55:18,800 --> 00:55:22,160
touch upon either, which is that
errors have kind of their own 

901
00:55:22,160 --> 00:55:29,120
separate typed hole in the 
effects type in stateless, which

902
00:55:29,120 --> 00:55:31,600
is a weird thing because you 
would expect that it could just 

903
00:55:31,600 --> 00:55:36,320
be another ability to support. 
Right together. 

904
00:55:37,120 --> 00:55:40,320
Yeah, exactly. 
But the reason it's not like 

905
00:55:40,320 --> 00:55:43,600
that is, is basically also 
because of type inference that 

906
00:55:43,600 --> 00:55:46,400
it just doesn't really the the 
type. 

907
00:55:46,840 --> 00:55:50,480
The union subtraction part 
doesn't really work with major 

908
00:55:50,480 --> 00:55:53,760
type triggers if you do that for
various reasons. 

909
00:55:55,800 --> 00:56:00,920
So but if we could get something
like the type union exclude 

910
00:56:00,920 --> 00:56:05,240
operator from typescripts and 
that's part of this pip, then I 

911
00:56:05,240 --> 00:56:09,920
would be able to basically unify
the concept of errors with the 

912
00:56:09,920 --> 00:56:14,520
abilities concept. 
And I think that would be easier

913
00:56:14,520 --> 00:56:18,040
to teach story about errors than
it is today. 

914
00:56:18,560 --> 00:56:22,720
It's not really clear why you 
need a separate abstraction for 

915
00:56:22,720 --> 00:56:27,120
that, but and the truth is you 
don't only for type inference 

916
00:56:27,120 --> 00:56:30,320
purposes. 
Interesting. 

917
00:56:30,360 --> 00:56:31,960
Well, yeah, that'd be. 
Cool. 

918
00:56:31,960 --> 00:56:36,680
So so the short answer is I 
think what you don't especially 

919
00:56:36,680 --> 00:56:40,480
anything to do right now. 
I mean if there is anything to 

920
00:56:40,480 --> 00:56:44,600
do right now, it's to build more
integrations with existing 

921
00:56:44,600 --> 00:56:51,160
libraries like Fast API or or 
some other library that would 

922
00:56:51,280 --> 00:56:54,920
make it easier for people to 
start using it in in practice or

923
00:56:54,920 --> 00:56:59,920
maybe building like a POST. 
Press for library integrations 

924
00:56:59,920 --> 00:57:02,520
into stateless. 
Like what are those side 

925
00:57:02,520 --> 00:57:04,720
effecting libraries you use 
most? 

926
00:57:05,960 --> 00:57:08,520
I started this on Monday. 
OK. 

927
00:57:09,520 --> 00:57:11,720
Just like outside of outside of 
stateless, what are? 

928
00:57:11,720 --> 00:57:14,280
I don't know, you'd probably 
have a better idea than I do. 

929
00:57:14,520 --> 00:57:16,480
I mean file system maybe would 
be. 

930
00:57:17,120 --> 00:57:20,800
I guess, yeah, I don't, Yeah, 
I'm not. 

931
00:57:21,360 --> 00:57:23,960
I don't know. 
I don't, I don't have an answer 

932
00:57:23,960 --> 00:57:27,600
to that still. 
I'm still trying to figure out 

933
00:57:27,880 --> 00:57:32,160
the effect stuff. 
So I'm I'm I'm tailing behind. 

934
00:57:32,160 --> 00:57:35,240
You could just start using it 
for air handling things. 

935
00:57:35,360 --> 00:57:38,600
Oh yeah, that would be 
interesting to I I don't know if

936
00:57:38,600 --> 00:57:43,600
I covered or we I I should say 
we because it's mostly clawed 

937
00:57:43,600 --> 00:57:45,920
and then me coming up cleaning 
things up. 

938
00:57:46,240 --> 00:57:51,240
So I'm pretty sure we covered 
maybe just using it for handling

939
00:57:51,240 --> 00:57:56,160
or at least maybe I should show 
that, you know, I'm, I'm sure 

940
00:57:56,160 --> 00:57:58,920
all these questions will come up
as I work on these chapters. 

941
00:57:58,960 --> 00:58:02,240
Yeah. 
But as you said, you're a little

942
00:58:02,240 --> 00:58:06,400
less than a weekend, too. 
Oh yeah, this whole new world. 

943
00:58:06,800 --> 00:58:11,520
Yeah, but I mean, so you feel 
like it's, I mean, it seems to 

944
00:58:11,520 --> 00:58:16,720
me like the core of it is usable
and and it seems like you feel 

945
00:58:16,720 --> 00:58:18,880
that way too. 
Yeah. 

946
00:58:18,880 --> 00:58:22,680
I mean it is still early days 
and I don't know that obviously 

947
00:58:22,680 --> 00:58:26,400
there aren't millions of people 
using it in production. 

948
00:58:26,400 --> 00:58:30,960
So I'm sure that there are also 
ergonomic problems or a box that

949
00:58:30,960 --> 00:58:33,520
will show up with if enough 
people start using it. 

950
00:58:33,520 --> 00:58:36,440
So in in that sense there would 
be work to do. 

951
00:58:36,440 --> 00:58:41,720
But in the testing that I've 
done, and I've tried to do it 

952
00:58:43,360 --> 00:58:47,880
fairly rigorously, it seems to 
me that the core of it is is 

953
00:58:47,880 --> 00:58:51,360
ready for use and it in fact I 
am using it in production where 

954
00:58:51,360 --> 00:58:54,160
I work now and it hasn't caused 
any problems so far, so. 

955
00:58:55,560 --> 00:58:58,120
That's huge. 
I would encourage other brave 

956
00:58:58,120 --> 00:59:01,520
souls to try the same. 
Maybe don't do it for the most 

957
00:59:01,520 --> 00:59:05,240
critical part of your 
application, but I think that's 

958
00:59:05,240 --> 00:59:09,240
what it takes for for stuff like
this to evolve right is to get 

959
00:59:09,240 --> 00:59:10,480
used in practice. 
So. 

960
00:59:11,200 --> 00:59:14,160
Well, yeah. 
And also I'm, I'm hoping that 

961
00:59:14,160 --> 00:59:16,640
it'll raise the visibility of 
it. 

962
00:59:16,640 --> 00:59:23,200
I mean, certainly because I, I 
know it was a year or so ago I 

963
00:59:23,200 --> 00:59:29,680
asked Guido and Barry Warsaw if 
they knew anything about effect 

964
00:59:29,680 --> 00:59:33,640
systems and they didn't. 
So hopefully we'll be. 

965
00:59:34,320 --> 00:59:36,760
Kind of elevating we have some 
educating to do we. 

966
00:59:36,760 --> 00:59:39,200
Have some educating to do. 
And I'm hoping that, you know, 

967
00:59:39,200 --> 00:59:44,160
once this book is what I feel 
like ready to publicize, maybe 

968
00:59:44,160 --> 00:59:47,640
it'll open some eyes. 
Yeah. 

969
00:59:47,720 --> 00:59:49,280
This. 
Fun. 

970
00:59:49,320 --> 00:59:51,280
Yeah. 
My goal with all this is like 

971
00:59:51,400 --> 00:59:54,160
let's help developers build 
better software. 

972
00:59:54,160 --> 00:59:57,920
Well, yeah, once you see it, 
once you see, oh, I'm calling 

973
00:59:57,920 --> 01:00:00,080
other functions and I don't know
what they do. 

974
01:00:00,480 --> 01:00:03,800
And there's no tracking of this.
And it's just like, well, it's 

975
01:00:03,800 --> 01:00:06,760
like exception specifications 
that failed. 

976
01:00:07,200 --> 01:00:09,720
You know, it's like, oh, the 
idea is there that you have to 

977
01:00:09,720 --> 01:00:12,400
know what's going to happen and 
we don't. 

978
01:00:13,160 --> 01:00:18,200
And and once you see that, you 
go, oh, wow, OK, this, we can't 

979
01:00:18,200 --> 01:00:22,160
build big systems without 
running into this problem. 

980
01:00:23,360 --> 01:00:27,320
And now that we're having the 
AID, so much of our code 

981
01:00:27,320 --> 01:00:30,720
authoring, so much of that is 
refactoring. 

982
01:00:30,920 --> 01:00:35,280
And John Dego's is always called
like Zeo and Effect systems 

983
01:00:35,600 --> 01:00:37,880
gives you the ability of 
fearless refactoring. 

984
01:00:37,880 --> 01:00:41,120
Well, yeah. 
And I want my AD to fearlessly 

985
01:00:41,120 --> 01:00:45,680
refactor a million times a day. 
That's and I think effect 

986
01:00:45,680 --> 01:00:47,480
systems are one of the best ways
to. 

987
01:00:47,720 --> 01:00:50,800
Oh yeah. 
So no, I feel like it's the bear

988
01:00:51,280 --> 01:00:54,360
we, you know, you just look at 
the history of computer science 

989
01:00:54,360 --> 01:00:58,720
and the barriers that we have 
unconsciously run into. 

990
01:00:58,720 --> 01:01:01,120
And it's like, why can't we 
build bigger systems? 

991
01:01:01,120 --> 01:01:04,600
And it's like, well, you need 
namespaces or you need, you 

992
01:01:04,600 --> 01:01:07,600
know, you need this or that or 
you need error, you know, need 

993
01:01:07,840 --> 01:01:09,720
reliable error handling or 
whatever it is. 

994
01:01:10,000 --> 01:01:13,040
And then after the fact we go, 
oh, that's why we couldn't build

995
01:01:13,040 --> 01:01:15,040
it. 
And I think this is what we're 

996
01:01:15,040 --> 01:01:18,480
running into now, that most 
people are just, well, I guess 

997
01:01:18,480 --> 01:01:21,480
we could use dependency 
injection, but that's really a 

998
01:01:21,480 --> 01:01:26,680
lot of messing around. 
And I think, you know, at some 

999
01:01:26,680 --> 01:01:28,960
point in the future, we'll be 
able to look back and go, oh, 

1000
01:01:28,960 --> 01:01:32,880
yeah, clearly that was our 
problem, but everybody is not 

1001
01:01:32,880 --> 01:01:33,800
aware of it. 
Yeah. 

1002
01:01:33,880 --> 01:01:36,240
Yeah, I think the questions 
around AI are really 

1003
01:01:36,240 --> 01:01:39,520
interesting. 
I mean, I think a lot of the 

1004
01:01:39,520 --> 01:01:44,760
features and effects systems 
exist to make this kind of pure 

1005
01:01:44,760 --> 01:01:48,920
programming economic because as 
you say, if you want to do 

1006
01:01:48,960 --> 01:01:53,280
dependency injection by hand or 
errors as values by hand, it 

1007
01:01:53,280 --> 01:01:57,000
becomes pretty verbose and 
unmanageable. 

1008
01:01:57,480 --> 01:01:59,760
And so that's why we've come up 
with all these abstractions, 

1009
01:01:59,760 --> 01:02:02,680
because historically speaking, 
it's been humans typing it by 

1010
01:02:02,680 --> 01:02:06,960
hand and that's no fun. 
But now that an AI agent is 

1011
01:02:06,960 --> 01:02:10,040
doing it, maybe we don't need as
many abstractions, but we still 

1012
01:02:10,040 --> 01:02:13,120
want the concepts of dependency 
injection and the errors as 

1013
01:02:13,120 --> 01:02:16,440
values and all those things. 
But maybe, maybe you do need 

1014
01:02:16,440 --> 01:02:20,600
less syntax and less frameworks.
Like, I mean, I guess I'm I'm 

1015
01:02:20,600 --> 01:02:22,960
kind of shooting status in the 
foot here a little bit, but 

1016
01:02:23,480 --> 01:02:25,080
maybe there's a future where 
it's like. 

1017
01:02:26,040 --> 01:02:30,840
For for reliable composition, 
the AI needs to know what are my

1018
01:02:30,840 --> 01:02:33,120
dependencies, what are the 
possible ways that this can 

1019
01:02:33,120 --> 01:02:37,920
fail, what are the I don't any 
other kind of side effecting 

1020
01:02:37,920 --> 01:02:41,040
things that are happening and if
it can know those in the types 

1021
01:02:41,040 --> 01:02:43,760
of. 
Track of that itself, but it 

1022
01:02:43,760 --> 01:02:47,040
just seems like you want that to
be automated. 

1023
01:02:47,040 --> 01:02:49,920
You want it to because it's. 
Just going to be explicit in the

1024
01:02:49,920 --> 01:02:51,240
type system. 
Yeah, exactly. 

1025
01:02:51,680 --> 01:02:54,600
No, but but what I mean is that 
dependency injection, you don't 

1026
01:02:54,600 --> 01:02:56,760
need an effect system to do 
dependency injection, right? 

1027
01:02:56,760 --> 01:02:59,160
That can just be a function. 
You don't need. 

1028
01:02:59,160 --> 01:03:01,080
To fix systems, to do errors as 
values. 

1029
01:03:01,080 --> 01:03:03,800
But the reason we do it with 
effect system is because it's 

1030
01:03:03,800 --> 01:03:06,920
very not it's not very nice to 
do it without those, without a 

1031
01:03:06,920 --> 01:03:09,480
system for it, right? 
And but for the AI system, it's.

1032
01:03:09,480 --> 01:03:10,640
Metaphor. 
Yeah. 

1033
01:03:11,720 --> 01:03:13,160
Yeah, but that would still be 
the case, right? 

1034
01:03:13,160 --> 01:03:16,000
If even without the effect 
system, yeah. 

1035
01:03:16,640 --> 01:03:18,080
I think it's the. 
Like the? 

1036
01:03:18,640 --> 01:03:22,360
Layers of composition. 
It gets you. 

1037
01:03:22,400 --> 01:03:25,840
You have to do a lot of 
traversals through things to 

1038
01:03:25,840 --> 01:03:29,320
understand the dependency 
requirements. 

1039
01:03:29,680 --> 01:03:31,000
And same thing is true for 
errors. 

1040
01:03:31,000 --> 01:03:33,880
Like, like if you if you call 
something, how do you know it 

1041
01:03:33,880 --> 01:03:36,040
throws an exception? 
Well, you could traverse through

1042
01:03:36,040 --> 01:03:38,880
every call site and look at the 
signal. 

1043
01:03:39,000 --> 01:03:40,800
Not not even the signature, 
because it's not in the 

1044
01:03:40,800 --> 01:03:42,560
signature. 
You have to actually look at the

1045
01:03:42,560 --> 01:03:45,760
body of the thing to understand 
what errors could potentially be

1046
01:03:45,760 --> 01:03:47,800
produced. 
And instead, if you have it 

1047
01:03:47,800 --> 01:03:50,960
represented in the type system 
that composes, then you just 

1048
01:03:50,960 --> 01:03:52,240
look one place. 
Yeah. 

1049
01:03:52,240 --> 01:03:55,160
And you have all the information
about dependencies and errors. 

1050
01:03:55,160 --> 01:03:57,920
And and you're right, and AI 
could do that. 

1051
01:03:58,000 --> 01:04:02,280
And yet is that a good use of 
the AI is that, I mean, and I 

1052
01:04:02,280 --> 01:04:06,600
think even it's going to, you 
know, eventually get bogged down

1053
01:04:06,600 --> 01:04:08,680
by it. 
I don't know, you know, maybe 

1054
01:04:08,680 --> 01:04:12,320
not, but but then ultimately, I 
think being able to have it 

1055
01:04:12,320 --> 01:04:15,440
human readable, like the weed. 
We interviewed the guy who 

1056
01:04:15,440 --> 01:04:20,160
created this over language which
is designed for AI generation, 

1057
01:04:20,160 --> 01:04:23,840
but also for human readability 
and verifiability. 

1058
01:04:23,840 --> 01:04:27,200
And I think that's, you know, 
with robots, they found that the

1059
01:04:27,200 --> 01:04:31,520
best, the, the most beneficial 
thing is a human with a robot 

1060
01:04:31,520 --> 01:04:33,960
helper. 
And I think that's, you know, 

1061
01:04:34,240 --> 01:04:38,680
we, we still, I, I see humiotic 
somewhere in the loop, there's a

1062
01:04:38,680 --> 01:04:44,040
human. 
So I, I don't know, I I'm I'm I 

1063
01:04:44,040 --> 01:04:48,200
feel like it still needs to be 
wired in to the type system. 

1064
01:04:49,080 --> 01:04:51,480
That's maybe, maybe agree with 
that. 

1065
01:04:52,400 --> 01:04:57,520
I just I don't know if we need 
all of the human affordances of 

1066
01:04:57,600 --> 01:05:01,440
all of the libraries support 
because the AI can generate that

1067
01:05:01,600 --> 01:05:05,520
as long as it's tracking types. 
Maybe we don't need to build all

1068
01:05:05,520 --> 01:05:08,160
of these special libraries. 
I think the example of that and 

1069
01:05:08,160 --> 01:05:11,920
the Zeo case is that Zeo has 
hundreds of combinators like 

1070
01:05:11,920 --> 01:05:17,600
the, the like, oh, you want to 
do this like operation on a Zeo,

1071
01:05:18,040 --> 01:05:21,440
which is really just like 3 
lines based on some other 

1072
01:05:21,440 --> 01:05:24,800
operation. 
And so while Zeo has these like 

1073
01:05:24,800 --> 01:05:28,720
hundreds of combinators in the 
AI realm, maybe it only needs 

1074
01:05:28,720 --> 01:05:32,280
10, you know, and. 
Human affordances. 

1075
01:05:32,280 --> 01:05:35,360
Can can build and it's nice as a
human to be able to look at 

1076
01:05:35,360 --> 01:05:39,120
something and be like, OK, dot 
dot retry or whatever. 

1077
01:05:39,360 --> 01:05:42,040
And but is that really 
necessary? 

1078
01:05:42,040 --> 01:05:44,960
You know, exactly. 
Maybe there's some fundamental 

1079
01:05:44,960 --> 01:05:48,240
ones like like you need a fold 
and you need a flat map and you 

1080
01:05:48,240 --> 01:05:51,160
know you need those things, but 
everything else can just be 

1081
01:05:51,160 --> 01:05:53,720
assembled on. 
Provably correct things that 

1082
01:05:54,360 --> 01:05:59,480
that can be assembled by the AI.
And yeah, I don't know, I guess 

1083
01:05:59,480 --> 01:06:02,400
we're going to find now. 
Yeah, for sure. 

1084
01:06:03,240 --> 01:06:06,280
But anyway, this is this is 
really fascinating. 

1085
01:06:06,280 --> 01:06:11,240
I was kind of amazed that I 
could do as much as I could with

1086
01:06:11,240 --> 01:06:13,360
the library. 
I figured there's going to be 

1087
01:06:13,600 --> 01:06:18,720
some kind of stumble at some 
point, but so far it's been 

1088
01:06:18,720 --> 01:06:20,480
pretty amazing. 
Nice. 

1089
01:06:20,640 --> 01:06:22,080
So. 
That's good to hear. 

1090
01:06:22,080 --> 01:06:24,560
Yeah. 
Thank you for for letting me 

1091
01:06:24,560 --> 01:06:26,360
know if you. 
Do stumble on something? 

1092
01:06:27,000 --> 01:06:32,120
I, I certainly will, yeah. 
I now that we've communicated, I

1093
01:06:32,120 --> 01:06:35,280
will if I get questions, I will 
e-mail you sounds. 

1094
01:06:36,800 --> 01:06:38,280
Good. 
Yeah, and we'll put links to 

1095
01:06:38,280 --> 01:06:41,400
everything on the show notes, 
but thank you for building this.

1096
01:06:41,400 --> 01:06:44,760
I think for me it makes Python 
palatable. 

1097
01:06:44,800 --> 01:06:48,040
And so that's that's a a huge 
improvement. 

1098
01:06:48,920 --> 01:06:51,040
And for Bruce, it's been great 
to. 

1099
01:06:51,040 --> 01:06:54,560
See him so really. 
Diving into to this we'll get 

1100
01:06:54,560 --> 01:06:56,080
the rest of the world on board 
with. 

1101
01:06:56,160 --> 01:07:00,560
Over the hump of understanding 
facts. 

1102
01:07:00,920 --> 01:07:04,320
Yeah, yeah. 
Bring in effect on the language.

1103
01:07:04,320 --> 01:07:06,480
That I've used for the longest 
time. 

1104
01:07:06,480 --> 01:07:11,000
I think at this point, yeah. 
I gave up on C in Java a while 

1105
01:07:11,000 --> 01:07:14,600
ago, but I still keep coming 
back to Python. 

1106
01:07:14,640 --> 01:07:15,760
All right. 
Well, thank you so much. 

1107
01:07:15,760 --> 01:07:17,680
Yes, appreciate it. 
Thank you. 

1108
01:07:18,400 --> 01:07:20,880
Yeah, it's a pleasure. 
Yeah, it's great to have you.

