1
00:00:00,017 --> 00:00:03,677
We'll forget hello yeah so last talk super difficult

2
00:00:03,677 --> 00:00:06,537
slot but also i guess that everyone wants to go and relax a

3
00:00:06,537 --> 00:00:10,137
little bit after a full day of talks here but

4
00:00:10,137 --> 00:00:14,497
i promise you this talk is not a technical talk like so much technical there

5
00:00:14,497 --> 00:00:18,577
will be some code there it's mainly ideas and highlights of what what we are

6
00:00:18,577 --> 00:00:23,377
doing with the most stable and feature complete set of bindings for the Qt framework

7
00:00:23,377 --> 00:00:28,397
and i am not being biased to saying that because that's a reality so first First,

8
00:00:28,397 --> 00:00:30,877
if you don't know me, my name is Christian.

9
00:00:31,117 --> 00:00:34,797
I have been working in the Qt company for even more than six years now.

10
00:00:35,957 --> 00:00:39,397
And to show some connection to the whole community, of course,

11
00:00:39,437 --> 00:00:44,057
I wanted to put some, not going into full memory lane, but highlight what is

12
00:00:44,057 --> 00:00:45,377
my connection, at least with KDE.

13
00:00:46,277 --> 00:00:50,237
So the main motivation that I had to be here finally in person,

14
00:00:50,317 --> 00:00:54,057
because in the last events I was only online, is that long time ago,

15
00:00:54,197 --> 00:00:59,517
I was part of this community I hope that you don't know the logo because sadly

16
00:00:59,517 --> 00:01:00,877
that community doesn't exist anymore,

17
00:01:01,097 --> 00:01:03,877
but there was even an official blog post about it,

18
00:01:04,497 --> 00:01:08,877
But Elio Castro, I think that is also is was active on the chat there.

19
00:01:08,997 --> 00:01:14,817
He was visiting there the community and Back then we used to had a Chilean KDE community.

20
00:01:15,237 --> 00:01:18,237
So this was 2010 I made a mistake of

21
00:01:18,237 --> 00:01:21,217
of subtracting the years and knowing that is a long time ago

22
00:01:21,217 --> 00:01:24,057
so yeah i mean back then i

23
00:01:24,057 --> 00:01:26,937
was one of the only one pushing for for cute there around

24
00:01:26,937 --> 00:01:30,737
and you might think oh well it's another community there in that country that

25
00:01:30,737 --> 00:01:34,397
the the answer is no because in south america besides

26
00:01:34,397 --> 00:01:37,817
brazil genome was the king everyone

27
00:01:37,817 --> 00:01:41,197
was doing genome like everyone was doing gtk and there

28
00:01:41,197 --> 00:01:44,677
were only a few weird people like this in these photos like we were using cute

29
00:01:44,677 --> 00:01:48,817
i said oh but that thing is is a european stuff whatever i was like yeah it's

30
00:01:48,817 --> 00:01:53,257
so nice so we were We were there doing some stuff and I started to check this

31
00:01:53,257 --> 00:01:56,357
really old set of pictures and I noticed another picture that if you were here

32
00:01:56,357 --> 00:01:59,017
for the initial talk this morning, the.

33
00:02:00,017 --> 00:02:03,617
Speaker there, Joana, I think was her name, that was bragging about using RLinux.

34
00:02:03,857 --> 00:02:07,557
I was also using RLinux there and I also started in our community and if you

35
00:02:07,557 --> 00:02:13,697
are a RLinux user, you remember that around that time using it was a lot of fun.

36
00:02:13,797 --> 00:02:16,077
But this is not the content of the talk.

37
00:02:16,657 --> 00:02:20,637
So first disclaimer again, like this morning's talk about Rust,

38
00:02:20,877 --> 00:02:24,137
the idea of this talk is not to say, hey, Python is better, use Python.

39
00:02:24,317 --> 00:02:28,557
No, it's like, hey, Python is also there. We can use it, we can get ideas,

40
00:02:28,657 --> 00:02:29,917
and we can improve the whole ecosystem.

41
00:02:30,717 --> 00:02:32,297
So I don't want to convince you.

42
00:02:33,746 --> 00:02:36,866
So, first of all, the language findings in the Qt ecosystem is something that

43
00:02:36,866 --> 00:02:40,766
is nothing new. I mean, I will not bore you here, like, explaining you how to do it.

44
00:02:41,066 --> 00:02:45,826
It's there. Nothing new. But I really believe that the bindings that we have

45
00:02:45,826 --> 00:02:47,366
are there are also Qt experience.

46
00:02:47,626 --> 00:02:52,166
And because of that reason, some people using other languages can think, oh, Qt is really bad.

47
00:02:52,306 --> 00:02:56,266
I will not use it or I will not even start using KDE because of the experience

48
00:02:56,266 --> 00:02:57,386
that they had on those bindings.

49
00:02:57,426 --> 00:03:00,466
So I think that as a Qt project, we need to be responsible for it.

50
00:03:00,466 --> 00:03:03,266
For it and that's why I believe that why we need to push

51
00:03:03,266 --> 00:03:06,166
so much for having a good experience with Python

52
00:03:06,166 --> 00:03:09,946
bindings in general so just to highlight a few that I was just checking maybe

53
00:03:09,946 --> 00:03:14,546
you know that wiki page maybe not but only a few we have two bindings for Python

54
00:03:14,546 --> 00:03:21,166
we have the CSXQ that we talked this morning about it there are other Rust bindings

55
00:03:21,166 --> 00:03:23,946
around we have for Java that is to my to my surprise,

56
00:03:24,186 --> 00:03:27,606
Java bindings are super up-to-date and still actively maintained.

57
00:03:28,866 --> 00:03:33,826
Julia, ,, you name it. There is even like 26 others there.

58
00:03:34,166 --> 00:03:39,146
And it's super relevant. But the problem that I have is that most of these bindings

59
00:03:39,146 --> 00:03:42,566
usually try to boot a one-on-one kind of equivalent.

60
00:03:42,806 --> 00:03:44,126
So you have these classes in

61
00:03:44,126 --> 00:03:48,126
the Qt ecosystem exposing those things in the neural language and to it.

62
00:03:48,586 --> 00:03:54,766
But at some point, when we are reaching feature completeness with the Qt framework,

63
00:03:55,966 --> 00:04:00,286
we thought, what about we can improve the experience of the Python users in

64
00:04:00,286 --> 00:04:02,066
the Qt ecosystem with our set of bindings?

65
00:04:02,526 --> 00:04:07,886
So, and also the idea was to at least say, okay, it's not like you can use Qt

66
00:04:07,886 --> 00:04:11,226
with Python, but you have other things that you can use around.

67
00:04:12,126 --> 00:04:17,606
So in the case of Python, I sadly need to go back to all these surveys around,

68
00:04:17,746 --> 00:04:19,946
like this morning we're referring, and also don't like them much.

69
00:04:19,946 --> 00:04:25,706
But the only thing that I want to highlight here is that even though most of

70
00:04:25,706 --> 00:04:29,566
us like we're born and raised C++ developers, we cannot neglect Python.

71
00:04:29,786 --> 00:04:32,506
By the way, I think that there we don't even have Rust.

72
00:04:33,706 --> 00:04:37,986
And I think this was shown, I think a different one was shown this morning was

73
00:04:37,986 --> 00:04:43,026
Tag Overflow survey that even though you can see like Rust is growing and everyone

74
00:04:43,026 --> 00:04:45,666
wants it, But the reality is that out there,

75
00:04:45,766 --> 00:04:50,226
most of the developers are using technologies like Python, JavaScript, and all the others.

76
00:04:50,346 --> 00:04:53,106
So it's super relevant still about the thing.

77
00:04:53,406 --> 00:04:58,986
So, of course, most of you, your social hands, will never use Python in this room.

78
00:05:00,165 --> 00:05:03,025
Everyone's used perfect. So we cannot neglect this kind of things.

79
00:05:03,065 --> 00:05:06,105
I mean, this is only a little I don't want you to read that Just want to see

80
00:05:06,105 --> 00:05:08,765
the magnitude For doing a kind of like super simple.

81
00:05:08,885 --> 00:05:12,405
Hello world and silver plus and cute and I'm not even adding the CMakeList TXT

82
00:05:12,405 --> 00:05:14,625
there and that will be the equivalent with Python.

83
00:05:14,725 --> 00:05:18,925
So even that's Selling point for new users like oh, yeah You can do the same

84
00:05:18,925 --> 00:05:22,065
with this other language and achieve whatever you want to achieve there for

85
00:05:22,065 --> 00:05:27,425
your first application Which maybe will not be a super commercial ready already an application,

86
00:05:27,765 --> 00:05:31,685
but something to get started into the Qt ecosystem is very appealing.

87
00:05:31,985 --> 00:05:35,445
So even though there are some things that I don't like from the current state

88
00:05:35,445 --> 00:05:39,105
of the project regarding syntax, I believe that is something that we need to

89
00:05:39,105 --> 00:05:42,085
push more so we can attract more people to Qt.

90
00:05:42,145 --> 00:05:45,145
And naturally, we will have more people into the KDE community.

91
00:05:46,085 --> 00:05:51,745
So if you're not into much the history of Python, I'd say personally that Python

92
00:05:51,745 --> 00:05:54,545
has three main points where it started to shine.

93
00:05:54,765 --> 00:05:59,365
The first one being the whole web development things, when you had things like

94
00:05:59,365 --> 00:06:05,645
Flask, Django, and lately FastAPI, which is a really, really popular Python module.

95
00:06:06,025 --> 00:06:09,105
And then we had the second kind of like another peak of the development,

96
00:06:09,245 --> 00:06:13,505
which you all know, I am almost certain, which is data science lately.

97
00:06:13,805 --> 00:06:18,045
And last but not least, I also believe that this is also a really cool area

98
00:06:18,045 --> 00:06:22,165
because there are projects like MicroPython and CircuitPython that started to

99
00:06:22,165 --> 00:06:26,725
brought the whole microcontrollers to the people that didn't know a lot of experience of,

100
00:06:26,825 --> 00:06:30,065
I don't know, memory allocations or limits on the RAM or whatever.

101
00:06:30,265 --> 00:06:35,885
So I believe that these three pillars of the Python community is something that

102
00:06:35,885 --> 00:06:37,425
is what is still making it shine.

103
00:06:37,725 --> 00:06:40,185
Nowadays, we know it's a reality and you know.

104
00:06:41,225 --> 00:06:45,105
Someone wants to start learning how to code, you most probably will say,

105
00:06:45,185 --> 00:06:48,165
yeah, maybe you can do some Python first and then, you know,

106
00:06:48,205 --> 00:06:51,085
go into the harder languages.

107
00:06:51,365 --> 00:06:56,005
So first, another thing that is to highlight that I guess that we cannot defeat

108
00:06:56,005 --> 00:06:58,485
the installing systems of Python.

109
00:06:58,685 --> 00:07:02,865
So pip install, whatever, and then you have it. It's way simpler that at least

110
00:07:02,865 --> 00:07:05,825
all the other compiled languages that we have there.

111
00:07:05,965 --> 00:07:09,185
We even managed at some point to expose, since I work in the computer company,

112
00:07:09,185 --> 00:07:13,625
that kind of functionality to having private wheels, which is something that

113
00:07:13,625 --> 00:07:19,585
also is not very explored in companies because companies sometimes offer commercial Python packages.

114
00:07:19,885 --> 00:07:25,185
And we did this thing, again, it's written in C++, and it was also a really good experience.

115
00:07:25,205 --> 00:07:27,885
At least the feedback we got from some commercial customers is really good.

116
00:07:28,785 --> 00:07:33,045
I was telling before about the whole data science popularity and specifically

117
00:07:33,045 --> 00:07:38,645
on the machine learning popularity, you see those two are the more essential or main modules.

118
00:07:38,965 --> 00:07:45,185
And you can see already in the language, those projects has how important C++ is.

119
00:07:45,585 --> 00:07:51,045
So the whole message here is that I really believe that one of the pilars of

120
00:07:51,045 --> 00:07:55,345
the Python ecosystem at the moment to be in like such a good language is because C++.

121
00:07:55,625 --> 00:07:58,545
Because C++ is exposing all these, like, you know,

122
00:07:58,545 --> 00:08:05,845
the hardcore performance critical processes into a user-facing API that is super

123
00:08:05,845 --> 00:08:09,985
simple and people without any knowledge of programming can add a few lines,

124
00:08:10,205 --> 00:08:11,845
train a model, and start doing things.

125
00:08:12,225 --> 00:08:16,325
That's why I believe that with this combination of C++ and Python,

126
00:08:16,425 --> 00:08:17,305
we got the perfect recipe.

127
00:08:17,545 --> 00:08:24,425
So as I said before, we have a Python user-facing experience with a C++ core,

128
00:08:24,625 --> 00:08:26,385
right? That should be right.

129
00:08:27,928 --> 00:08:31,948
I will talk about that later. But let's go about Python and Qt.

130
00:08:31,988 --> 00:08:36,028
So first of all, I want to clarify something that I get wrong all the time,

131
00:08:36,068 --> 00:08:37,208
but many people they interact with.

132
00:08:38,068 --> 00:08:41,448
We have the Qt ecosystem, two set of bindings.

133
00:08:42,388 --> 00:08:45,968
And I want to explain why we have two set of bindings. So I know that now you're

134
00:08:45,968 --> 00:08:47,688
expecting like all the drama behind it.

135
00:08:48,068 --> 00:08:52,548
It's not, at least I was not there, but when this happens, but in a nutshell,

136
00:08:52,868 --> 00:08:55,728
you know, PyQt has been around for a long time.

137
00:08:55,728 --> 00:08:59,388
At some point it got invited into the Qt project with

138
00:08:59,388 --> 00:09:02,268
the condition of course of changing the license and then

139
00:09:02,268 --> 00:09:06,188
the people behind PyQt say like thank you very much but we have our own thing

140
00:09:06,188 --> 00:09:10,788
where our business around it not convening for us to say okay then we need to

141
00:09:10,788 --> 00:09:15,648
do another one and that's why PySite was born so is maybe it was more dramatic

142
00:09:15,648 --> 00:09:19,388
I don't know I don't even want to go into the meta list at all but the main

143
00:09:19,388 --> 00:09:22,228
difference are like this as I I mentioned before, licenses,

144
00:09:22,548 --> 00:09:26,168
the company that is behind the development,

145
00:09:26,588 --> 00:09:35,268
supports are roughly the same, and the and more part there is that I want to make emphasis why.

146
00:09:35,428 --> 00:09:39,588
And as I said, I know I might be biased, but this has been the goal in the latest

147
00:09:39,588 --> 00:09:44,528
years that we want to offer more than just the Qt API available in Python.

148
00:09:45,528 --> 00:09:50,728
So, I don't want to go into the details, but this is more or less the story of PySight.

149
00:09:51,068 --> 00:09:56,968
I joined around 2018, so you can see there, I missed all the fun parts there

150
00:09:56,968 --> 00:09:59,708
before, but so far so good.

151
00:09:59,848 --> 00:10:04,168
We are just keeping the same release schedule as Qt, and everything is going great.

152
00:10:05,928 --> 00:10:10,428
As I told you before, for PySight, as I said, we would not like to just expose

153
00:10:10,428 --> 00:10:14,788
the Qt API because then the question that you all might have is like,

154
00:10:14,868 --> 00:10:17,748
so what's the difference? So I just changed the import and that's it.

155
00:10:18,368 --> 00:10:21,568
And this was the state of the project at some point. And we were like really

156
00:10:21,568 --> 00:10:23,648
thinking, oh my God, we really need to do a difference now.

157
00:10:23,848 --> 00:10:28,448
So what I would try to do now is to highlight which are all the features that

158
00:10:28,448 --> 00:10:32,328
we have at on top of just having Qt bindings for making the Python experience

159
00:10:32,328 --> 00:10:36,828
for new Qt developers very well. So as I said, searching for features.

160
00:10:37,028 --> 00:10:39,748
So the first one we thought it was a really interesting one.

161
00:10:39,748 --> 00:10:42,408
It was a main use case from one of our customers.

162
00:10:43,827 --> 00:10:47,907
It's some code there you're unable to read so far, but don't worry,

163
00:10:47,987 --> 00:10:48,847
give it a couple of seconds.

164
00:10:50,607 --> 00:10:55,327
Maybe you're familiarized with the solution from Autodesk. They started with

165
00:10:55,327 --> 00:11:00,947
this requirement that was having access to a Qt C++ application from a Python interpreter.

166
00:11:01,227 --> 00:11:04,267
In a nutshell, if you want to implement plugins or add-ons to the application.

167
00:11:04,587 --> 00:11:07,887
We thought it was the main thing that people were planning to use it.

168
00:11:08,167 --> 00:11:09,387
People still wanted more.

169
00:11:09,807 --> 00:11:13,787
So at some point we thought, what is the most popular Python model out there

170
00:11:13,787 --> 00:11:17,147
that we can make, we make it interact flawlessly with Qt.

171
00:11:17,387 --> 00:11:21,827
And it was NumPy, a numerical Python module, historical module that also was

172
00:11:21,827 --> 00:11:25,687
super important in the evolution and the adoption from the scientific community.

173
00:11:26,467 --> 00:11:32,067
And then we thought, maybe we can have some mechanisms inside to accept the

174
00:11:32,067 --> 00:11:36,607
data structures that they expose, the NumPy arrays, within that thing.

175
00:11:36,867 --> 00:11:41,287
And even at some point, we got a project called PyQtGraph, and I know it said

176
00:11:41,287 --> 00:11:43,027
PyQt, but it's It's compiled with PySide as well.

177
00:11:44,247 --> 00:11:48,687
They asked, you know what? We really would like for QPainter to have a specific

178
00:11:48,687 --> 00:11:51,667
API that accepts these two and AMP arrays, whatever, whatever.

179
00:11:52,127 --> 00:11:55,287
And since everyone was thinking of, ah, yeah, the PySide bindings are,

180
00:11:55,327 --> 00:11:57,647
yeah, there, we thought, yeah, you know what? Let's break API.

181
00:11:57,987 --> 00:12:01,647
You have this need. It's an open source project that will benefit from it.

182
00:12:01,847 --> 00:12:05,547
We gave those new APIs. So this is even something that we have been open for

183
00:12:05,547 --> 00:12:07,887
all the other projects. Like, you need something that's not there?

184
00:12:08,167 --> 00:12:11,127
Let's do it. We don't care. We just want to get more people happy.

185
00:12:12,227 --> 00:12:16,147
And the third point was Qt Creator support, at least a minimal one.

186
00:12:16,267 --> 00:12:20,527
So we thought that exposing a few templates there that you can start was enough.

187
00:12:21,510 --> 00:12:24,670
We started to work a little bit more on these things. And after you finish and

188
00:12:24,670 --> 00:12:29,170
selected your module you wanted to use, you can even have the option now to

189
00:12:29,170 --> 00:12:32,530
create your own virtual environment, which is the natural thing for Python developers to do.

190
00:12:32,650 --> 00:12:35,390
And then you get this nice, or maybe, I don't know, not so nice,

191
00:12:35,490 --> 00:12:38,190
but a pop-up about like, hey, PySense is not installed.

192
00:12:38,470 --> 00:12:42,190
Maybe you can install it like that. So trying to ease the interaction there.

193
00:12:42,730 --> 00:12:46,010
But then people, I went to conference around it. They said, yeah, that's not enough.

194
00:12:46,210 --> 00:12:50,730
I said, well, okay, let's look for more maybe Python features to this.

195
00:12:50,730 --> 00:12:53,810
So the first one, and this is something that you might believe maybe,

196
00:12:53,950 --> 00:12:56,870
oh, that's silly, but I will tell you later why it was not.

197
00:12:58,230 --> 00:13:01,890
Typical, nonsensical, like simple code, just to highlight that this is what

198
00:13:01,890 --> 00:13:03,670
we will be using in Python.

199
00:13:05,270 --> 00:13:11,810
And then we implemented a feature that was changing the whole Qt API at runtime to SnakeCase.

200
00:13:12,190 --> 00:13:17,350
And you will say, this was, alongside the next one that I will tell you,

201
00:13:17,350 --> 00:13:21,230
the number one comment that every single, it was really like a joke,

202
00:13:21,310 --> 00:13:22,610
like an eimer that follows you, everyone.

203
00:13:22,810 --> 00:13:26,090
But you know what? You have camel case and that feels really C++.

204
00:13:26,290 --> 00:13:31,410
It's not really Python. So we did that, but it was not enough because then people

205
00:13:31,410 --> 00:13:35,310
thought, you also need to have true properties because in C++,

206
00:13:35,390 --> 00:13:37,830
we're used to setters and getters, well, and Qt, right?

207
00:13:37,970 --> 00:13:42,110
But in Python, that's not a thing. So we implemented another option called true property.

208
00:13:42,330 --> 00:13:45,070
So then you don't need all these setters and getters and you can just directly

209
00:13:45,070 --> 00:13:47,310
go there and modify the property value.

210
00:13:47,610 --> 00:13:50,730
And as I told you, this was really what everyone was asking for.

211
00:13:50,810 --> 00:13:54,970
Even this thing, as well, caused many good and positive comments out of the community.

212
00:13:55,962 --> 00:14:01,402
Then we had QML element. So as you know, you're secure to C++ developers,

213
00:14:01,782 --> 00:14:10,702
you can expose C++ code to use in the QML, made this little macro called QML

214
00:14:10,702 --> 00:14:15,002
element that then at build time because of some CMAX magic, you get that exposed.

215
00:14:15,622 --> 00:14:19,822
We don't have build time in Python. So we needed to do something like how could

216
00:14:19,822 --> 00:14:22,122
we solve this problem for the Python users?

217
00:14:22,302 --> 00:14:26,062
So we thought what is natural for people in Python to have, you maybe want to,

218
00:14:26,142 --> 00:14:29,102
I don't know, do some external decoration on things.

219
00:14:29,262 --> 00:14:33,442
So literally using a decorator. So then we implemented this approach of,

220
00:14:33,442 --> 00:14:38,302
it was literally just having one decorator on a specific Python class that needed

221
00:14:38,302 --> 00:14:39,822
to inherit from QObject,

222
00:14:39,982 --> 00:14:45,222
giving some important name and versioning, and then people would easily go to the QML there,

223
00:14:45,802 --> 00:14:48,762
and just instantiate the object and using it all over the place.

224
00:14:49,282 --> 00:14:55,382
With that also, we made a lot of QML users happy about it. and it was something

225
00:14:55,382 --> 00:14:58,222
that literally like changed the situation.

226
00:14:59,082 --> 00:15:00,802
If you were using PySide, have

227
00:15:00,802 --> 00:15:05,462
you ever used QML element to expose Python things to C++? Sorry, so QML?

228
00:15:07,462 --> 00:15:11,582
Nobody? Okay, good. So now you know, but now you can do it.

229
00:15:13,342 --> 00:15:16,862
So yeah, this was very important. And then after that, I didn't want to put

230
00:15:16,862 --> 00:15:20,122
it here in the slide, but there are many other degraders that can help you,

231
00:15:20,162 --> 00:15:24,182
like if you want a singleton or whatsoever. So, we have many methods there to

232
00:15:24,182 --> 00:15:27,142
do the whole type registrar thing at runtime.

233
00:15:27,962 --> 00:15:32,022
So, every time, maybe yourself and the people behind all the support that we

234
00:15:32,022 --> 00:15:35,002
have in CMake gets creative with doing things in build time,

235
00:15:35,782 --> 00:15:38,502
we need to somehow try to figure out why do we do that.

236
00:15:38,842 --> 00:15:41,622
As far as I know, and please correct me if I am wrong later,

237
00:15:42,162 --> 00:15:44,502
PyQ does not have any mechanism to do this.

238
00:15:46,456 --> 00:15:49,176
Tooling then we thought okay maybe we need

239
00:15:49,176 --> 00:15:52,096
to do something about that people don't know that we

240
00:15:52,096 --> 00:15:55,056
include in the wheels all those tools there

241
00:15:55,056 --> 00:15:58,356
the ones that you see on the top maybe you cannot read it well properly are

242
00:15:58,356 --> 00:16:04,196
the one that we have wrappers around the c++ code so the the c++ tool so we

243
00:16:04,196 --> 00:16:09,156
can use it in python modules and the last two there sometimes they are super

244
00:16:09,156 --> 00:16:13,676
simple as calling the binary that we're including but we also have things that

245
00:16:13,676 --> 00:16:16,316
doesn't exist in Qt for example, generate type hints for Python.

246
00:16:16,876 --> 00:16:20,756
We have even a little functionality to do a complete dump of the meta object

247
00:16:20,756 --> 00:16:25,316
and even new tools that also have not getting a lot of love because we have

248
00:16:25,316 --> 00:16:27,176
been really bad at communicating those things,

249
00:16:27,356 --> 00:16:31,916
which is like you can have tools like PySatSig Project that is kind of having

250
00:16:31,916 --> 00:16:36,216
a kit creator on the terminal because you can start new projects based from

251
00:16:36,216 --> 00:16:41,356
templates and just build and run the application there without worrying about anything.

252
00:16:41,356 --> 00:16:44,696
And then you also have a tool to deploy, for example.

253
00:16:44,796 --> 00:16:48,556
Deployment is a big issue even nowadays for C++ and Qt developers because,

254
00:16:48,696 --> 00:16:52,876
in my opinion, it's not good to have the application to deploy to Linux,

255
00:16:53,136 --> 00:16:55,596
one to Windows, and one to Mac.

256
00:16:55,696 --> 00:17:01,636
So we thought, why reinventing the wheel, like having yet another tool base, whatever?

257
00:17:01,856 --> 00:17:05,376
So we started to look into the Python community. And there is recently a really

258
00:17:05,376 --> 00:17:08,736
good deployment tool in Python, which is called Nuitka.

259
00:17:09,176 --> 00:17:12,616
And it's the only one that really compiles Python code.

260
00:17:12,756 --> 00:17:16,056
All the other ones are freezers. The one that like transforms some stuff and

261
00:17:16,056 --> 00:17:20,316
is a fake zip, but this is really good and we said, let's do a user interface

262
00:17:20,316 --> 00:17:22,116
on top of that developer team.

263
00:17:22,216 --> 00:17:25,236
There is super nice, super open. So we have been collaborating quite a lot.

264
00:17:25,656 --> 00:17:29,756
So why not? And the last that you see there on the right is the Android deployed,

265
00:17:29,996 --> 00:17:34,816
which I will talk about later, which is also a big milestone in our own project.

266
00:17:35,726 --> 00:17:39,006
So, yeah, again, even with all these things, people were still asking about,

267
00:17:39,066 --> 00:17:42,266
eh, what about, okay, let's do even more features.

268
00:17:43,546 --> 00:17:48,646
Android support, as I just told you. This is a case that since I joined the

269
00:17:48,646 --> 00:17:50,686
company, people is asking for Android support.

270
00:17:51,306 --> 00:17:55,866
My opinion, I'm not a mobile developer. It's really strange for someone to want

271
00:17:55,866 --> 00:18:01,586
to do a mobile application using Python since there are options out there that can be super simple.

272
00:18:01,586 --> 00:18:05,586
But again, we thought, why reinventing everything from scratch,

273
00:18:05,706 --> 00:18:07,186
trying to figure out everything?

274
00:18:07,466 --> 00:18:12,466
And one of the competitors that PySight has out there in the Python ecosystem is Kibbe.

275
00:18:12,606 --> 00:18:16,246
Kibbe is another framework to create user interfaces in Python.

276
00:18:16,406 --> 00:18:21,766
And they developed a tool that is literally to put Python modules on Android devices.

277
00:18:22,046 --> 00:18:26,806
And then we saw the license is compliant. We developed one tool around it that

278
00:18:26,806 --> 00:18:30,326
was compliant with everything they had. We contacted them, they say,

279
00:18:30,406 --> 00:18:33,026
hey, we have a recipe now, so you can have pies right there.

280
00:18:33,106 --> 00:18:34,506
I said, yes, sure, let's do it.

281
00:18:35,206 --> 00:18:38,586
And we are reusing that thing again. So even though there are like two different

282
00:18:38,586 --> 00:18:43,766
offers, we are trying to find our ways to interact more with other projects doing things.

283
00:18:44,086 --> 00:18:48,026
So if you want to know how it works, you will be unable to read here because

284
00:18:48,026 --> 00:18:51,966
it was recording on a screen size with the resolution too high.

285
00:18:52,246 --> 00:18:58,166
But in a nutshell, the first step that you maybe saw there is that just calling

286
00:18:58,166 --> 00:18:59,926
the Android Deploy tool that we have.

287
00:19:00,126 --> 00:19:04,606
And we do provide some ARC64 wheels, so we are using those.

288
00:19:04,826 --> 00:19:09,446
You can do this, the cost compilation to create those wheels for Linux or Mac.

289
00:19:09,626 --> 00:19:12,206
And then when we have all these wheels, we are preparing the packaging.

290
00:19:12,386 --> 00:19:16,006
Then you can open it, for example, in Android Studio, where you can see all

291
00:19:16,006 --> 00:19:17,186
the information there generated.

292
00:19:17,546 --> 00:19:22,686
And I think the last step now would be that we are preparing to put the package on a mobile phone.

293
00:19:22,946 --> 00:19:26,966
And soon as you will see the application popping up. There it is.

294
00:19:31,726 --> 00:19:32,546
Oh, is that Bossert?

295
00:19:34,753 --> 00:19:38,633
So then you have like the usual permissions and everything. And thanks to one

296
00:19:38,633 --> 00:19:41,473
of my colleagues, Sham, that recorded this like two days ago.

297
00:19:41,853 --> 00:19:47,453
So then you have that. The first comment that I got when we announced under

298
00:19:47,453 --> 00:19:49,693
support of all the work, like, yeah, what about iOS?

299
00:19:49,973 --> 00:19:53,593
And I was like, OK, yeah, so I will not not even continue and take the time for it.

300
00:19:54,753 --> 00:19:58,133
Another interesting experiment here, which is cute as in Kayo.

301
00:19:58,433 --> 00:20:00,273
This doesn't exist in C++, of course.

302
00:20:01,073 --> 00:20:05,853
And why we did it is because we had a lot of people requesting inter-availability

303
00:20:05,853 --> 00:20:09,653
between the module async.io in Python and Python applications.

304
00:20:11,033 --> 00:20:15,113
So async.io is one of the main, if not like the maybe well-accepted modules

305
00:20:15,113 --> 00:20:16,833
to do asynchronous computing in Python.

306
00:20:17,373 --> 00:20:20,953
And there are many plugins out there. If you really, if you Google for like,

307
00:20:21,033 --> 00:20:25,273
I don't know, like Qt or async.io or whatever, you will find those things.

308
00:20:25,273 --> 00:20:30,073
They started to stop being developed and one after the other they were forking

309
00:20:30,073 --> 00:20:35,133
each other and then at the end I think there is no active project so we thought

310
00:20:35,133 --> 00:20:36,953
why not having something like that.

311
00:20:37,233 --> 00:20:41,753
So this was never done before because it is literally a model that doesn't exist

312
00:20:41,753 --> 00:20:45,933
in C++ that people can't import like they do with any other Qt module.

313
00:20:46,593 --> 00:20:51,093
So in a nutshell you can see there like a little example that is just highlighting

314
00:20:51,093 --> 00:20:54,353
how do you call, I think this is the simple example that we have.

315
00:20:55,773 --> 00:20:59,953
How do you need to use this new wrapper around the queue application,

316
00:21:00,213 --> 00:21:02,813
for example, in order to make it work.

317
00:21:03,073 --> 00:21:07,573
So at some point, we even were discussing like, oh, maybe we can make now this

318
00:21:07,573 --> 00:21:10,413
a C++ thing and maybe reinvent it, but no.

319
00:21:10,773 --> 00:21:15,413
So far, no interaction on that. And sadly, also the Adrian, the person that

320
00:21:15,413 --> 00:21:19,233
was in charge of the thing, at some point stopped contributing with the project.

321
00:21:19,233 --> 00:21:22,933
So in case you're interested with this topic, we can talk about each other.

322
00:21:24,813 --> 00:21:28,053
Another thing, so Design Studio. Have you ever used Design Studio by the way

323
00:21:28,053 --> 00:21:29,933
here? Is anyone using Design Studio? Okay, you are.

324
00:21:31,513 --> 00:21:35,133
Super requested thing by open source user and commercial users like,

325
00:21:35,213 --> 00:21:37,193
hey, but I want to have a Python project out of it.

326
00:21:39,264 --> 00:21:43,544
We didn't have support. So the solution that we have in place now that we will

327
00:21:43,544 --> 00:21:46,184
announce in the following days,

328
00:21:46,444 --> 00:21:52,064
it's a new option in Design Studio that you have enabling the Python generator

329
00:21:52,064 --> 00:21:55,944
that will create this new Python directory inside your project,

330
00:21:56,524 --> 00:22:01,004
where you will have a setting things that is the file that will be constantly

331
00:22:01,004 --> 00:22:06,644
changing in case you have more assets there in your project and the main POI

332
00:22:06,644 --> 00:22:09,164
file, which in theory will not change at all.

333
00:22:09,284 --> 00:22:13,404
So you don't have the risk of touching again and again the files and everything.

334
00:22:14,384 --> 00:22:18,904
As I said, with the next Qt Design Studio release, this will be out as well.

335
00:22:19,084 --> 00:22:23,864
And we were preparing a blog post about it. So you can have a look.

336
00:22:24,064 --> 00:22:27,744
So it's really convenient. And at the same time, maybe you have noticed that

337
00:22:27,744 --> 00:22:33,584
Design Studio also has their own Qt Quick components that they're not in Qt.

338
00:22:34,144 --> 00:22:38,904
So what we also did is that now we will have a PySite design studio wheel that

339
00:22:38,904 --> 00:22:42,004
includes those components as well, so in case you want to just use those.

340
00:22:44,084 --> 00:22:48,804
Another thing that it was really interesting to achieve is that before the jump

341
00:22:48,804 --> 00:22:54,464
from five to six, we noticed that performance-wise, PySite was really slow compared to PyQt.

342
00:22:54,884 --> 00:22:58,204
And we did some investigation, and we noticed that back then we were using really

343
00:22:58,204 --> 00:22:59,524
inefficient containers,

344
00:23:00,124 --> 00:23:04,764
in the implementation, and we improved that, and we managed to get parity of the speedup,

345
00:23:04,764 --> 00:23:07,984
but something that we are still fighting well

346
00:23:07,984 --> 00:23:10,884
hopefully for not so long is that the loading of the modules

347
00:23:10,884 --> 00:23:13,664
is something that is a it was a little bit more

348
00:23:13,664 --> 00:23:16,544
sorry slow so this new

349
00:23:16,544 --> 00:23:21,484
approach that uh when another colleague christian is working uh it's based on

350
00:23:21,484 --> 00:23:26,064
a enhanced proposal in the python ecosystem that was rejected but the idea was

351
00:23:26,064 --> 00:23:31,164
good to improve the improve the startup time and i don't know if some of you

352
00:23:31,164 --> 00:23:34,084
were in the contributor summit but we talk about there that there.

353
00:23:34,244 --> 00:23:37,464
And for the end user, it's just faster to run a Python application.

354
00:23:39,609 --> 00:23:44,089
Qt script. You remember maybe Qt script, the one that enabled you to make some

355
00:23:44,089 --> 00:23:48,069
nice interaction with JavaScript that was in Qt 5 that was not maintained anymore.

356
00:23:48,789 --> 00:23:52,369
At some point, we had an internal hackathon, and I had the idea like,

357
00:23:52,449 --> 00:23:54,649
hey, maybe we can do it with Python. And everyone was like, ha,

358
00:23:54,649 --> 00:23:56,609
ha, ha, but it's not for real.

359
00:23:56,869 --> 00:24:00,389
And then we did something, and it was very interesting. The reception,

360
00:24:00,469 --> 00:24:03,429
at least in the company's hackathon, was, yeah, maybe we can push it later.

361
00:24:03,809 --> 00:24:07,369
And another colleague from the team, Friedemann, decided to say like,

362
00:24:07,449 --> 00:24:08,689
hey, maybe we can do this thing.

363
00:24:09,749 --> 00:24:13,809
Recently, maybe you saw that Qt Creator supports Lua now for creating extensions,

364
00:24:14,189 --> 00:24:20,529
and the end goal of this is to convince and work together with the Qt Creator

365
00:24:20,529 --> 00:24:24,669
developers to enable Python to be as a language to write plugins for Qt Creator.

366
00:24:24,849 --> 00:24:31,989
I don't know if you have wrote any Qt Creator currently, but it's a little bit complicated.

367
00:24:31,989 --> 00:24:38,269
So, as I told you before, the idea of this would be to embed this Python interpreter

368
00:24:38,269 --> 00:24:40,729
so you can use it within C++.

369
00:24:41,029 --> 00:24:44,949
And it was similar to the first example that I showed you there.

370
00:24:45,069 --> 00:24:48,309
This application, this widescreen that was enlarging the fonts.

371
00:24:48,669 --> 00:24:52,949
And it would enable us to use these dynamical bindings for this program without

372
00:24:52,949 --> 00:24:58,189
relying on having this binding generator needing to be building the modules and stuff.

373
00:24:58,189 --> 00:25:01,949
So it will be really cool in my opinion and hopefully it's something we can

374
00:25:01,949 --> 00:25:04,049
push soon to to have this thing around.

375
00:25:06,744 --> 00:25:11,544
Something that might be interesting, at least the people that are around this

376
00:25:11,544 --> 00:25:14,944
topic know already, so I'm happy about it, is that for a long time,

377
00:25:15,044 --> 00:25:18,044
I remember having many conversations with people from the KDE that said, hey,

378
00:25:18,224 --> 00:25:21,984
please, make it possible to build this via Flatpak.

379
00:25:22,244 --> 00:25:27,584
So recently, Shyam, one of the colleagues, decided to enable this thing,

380
00:25:27,704 --> 00:25:32,064
so maybe you remember this Python with Kirigami website that is in the documentation.

381
00:25:32,064 --> 00:25:35,444
Presentation before it was PyQt with Kirigami and

382
00:25:35,444 --> 00:25:38,204
now we gladly with this support we managed to

383
00:25:38,204 --> 00:25:41,164
do the Python in general so users can have

384
00:25:41,164 --> 00:25:45,004
the choice they can do Kirigami based applications with either with PyQt or

385
00:25:45,004 --> 00:25:49,424
PySide so this something was recently announced there and since we are talking

386
00:25:49,424 --> 00:25:54,184
about KDE something that also makes us really happy and and thanks for color

387
00:25:54,184 --> 00:25:59,844
here is that there's also a work being in the whole Summer Code done by Manuel.

388
00:26:00,204 --> 00:26:04,964
And Carl is helping. And apparently, as I heard, everything is going well so far.

389
00:26:05,244 --> 00:26:09,304
So it is something that is still interesting to have.

390
00:26:09,464 --> 00:26:13,844
And I believe that this is kind of the idea that we need to move into the future,

391
00:26:13,884 --> 00:26:18,884
like stop thinking of C++ framework and more like many languages framework.

392
00:26:19,924 --> 00:26:23,144
So then the question was, is that enough with all the pies and features that we have?

393
00:26:23,224 --> 00:26:28,644
Well, I believe that it will never be enough. so we even started to think about new features.

394
00:26:28,864 --> 00:26:31,784
And here I want to make a parenthesis, and I want to talk about Rust.

395
00:26:33,184 --> 00:26:38,744
Recently, and this is my own personal opinion, some people noticed that rewriting

396
00:26:38,744 --> 00:26:41,184
Python code in a compiled language was faster.

397
00:26:41,704 --> 00:26:46,164
And then everyone was like, oh my god, right? And I was like, seriously?

398
00:26:46,804 --> 00:26:50,584
But anyway, this is improving the Python ecosystem, so people are happy about

399
00:26:50,584 --> 00:26:54,744
using it, But I really don't like when people always do this comparison about

400
00:26:54,744 --> 00:26:57,304
like Python being slow with compared to Rust or C++.

401
00:26:57,464 --> 00:26:59,544
Yeah, we know. I mean, it's a reality. This is what happens.

402
00:27:00,064 --> 00:27:03,184
Because we don't use Python for being fast. We use Python for being convenient.

403
00:27:03,444 --> 00:27:06,504
But anyway. So I like the whole argument of memory safety. Yes.

404
00:27:06,664 --> 00:27:09,324
But if you see a person only highlighting faster, it's like...

405
00:27:10,592 --> 00:27:15,072
And you may believe like, okay, well, that's a silly thing. So Rust started

406
00:27:15,072 --> 00:27:17,172
to be super strong in the Python community.

407
00:27:17,392 --> 00:27:21,092
And now there is even like companies doing tooling around it.

408
00:27:21,172 --> 00:27:25,152
So people decided, for example, to start rewriting different applications.

409
00:27:25,752 --> 00:27:28,952
The first two are rewrites of existing Python tooling.

410
00:27:29,152 --> 00:27:33,452
And the last one is kind of like a cargo for Python kind of thing.

411
00:27:33,592 --> 00:27:35,532
And they have been super successful lately.

412
00:27:35,952 --> 00:27:39,732
So I believe that this is really good for the Python ecosystem.

413
00:27:39,732 --> 00:27:42,952
System and I really hope that with the CX execute we can manage to get into

414
00:27:42,952 --> 00:27:48,392
a point of having also this another language and being not rewriting things

415
00:27:48,392 --> 00:27:49,732
like in the talk this morning was,

416
00:27:50,472 --> 00:27:55,172
mentioning but having new things written in Rust that can improve the KDEK system.

417
00:27:56,212 --> 00:27:59,872
There is a different approach though that something someone there

418
00:27:59,872 --> 00:28:03,032
is also a different company called Exaloop decided to you

419
00:28:03,032 --> 00:28:05,992
know what Python is cool but let's keep only the user or interface and

420
00:28:05,992 --> 00:28:08,912
rewrite everything one of the authors this thing it's

421
00:28:08,912 --> 00:28:11,752
a commercial only thing so far it's one of the the

422
00:28:11,752 --> 00:28:14,812
people behind llvm so they decided

423
00:28:14,812 --> 00:28:17,672
to say just using as python as a front end and then well the

424
00:28:17,672 --> 00:28:20,792
language that you see and then everything else is super improved

425
00:28:20,792 --> 00:28:24,452
to run in different system whatever and it's i don't know it's a nice approach

426
00:28:24,452 --> 00:28:29,552
that i wanted to highlight as well so i think i still have like sometimes right

427
00:28:29,552 --> 00:28:34,472
so like five okay cool so yeah that was the parentheses and with regarding Rust

428
00:28:34,472 --> 00:28:38,732
because maybe you have read some news or in your timeline some respective social

429
00:28:38,732 --> 00:28:40,772
media like Python and Rust are being really cool.

430
00:28:41,412 --> 00:28:46,252
And I had a talk in Lithuania where a lot of people wanted to say,

431
00:28:46,272 --> 00:28:47,632
oh yeah, Rust is so fast, Rust is so fast.

432
00:28:47,812 --> 00:28:52,332
And I wrote one extension in Rust and one in C++, and C++ was faster.

433
00:28:52,772 --> 00:28:54,692
So why people is not writing things in C++?

434
00:28:55,352 --> 00:28:59,572
You tell me. I don't know. So the future of the project, the future of PySide. it.

435
00:29:00,252 --> 00:29:05,292
First of all, simplifying user experience. This is Qt. I will give you a couple

436
00:29:05,292 --> 00:29:06,452
of seconds to digest the code.

437
00:29:10,212 --> 00:29:14,852
This is a prototype that I was playing around with because sometimes I get the

438
00:29:14,852 --> 00:29:19,812
complaints from people that to write a simple application, they need to know

439
00:29:19,812 --> 00:29:22,812
a lot of things about Qt. You need to know what a Qt application is.

440
00:29:22,892 --> 00:29:25,712
You need to know what a Qt push button is, how to interact that

441
00:29:25,712 --> 00:29:28,632
you need a QV box layout in order to put things

442
00:29:28,632 --> 00:29:31,492
and some people don't like that I respect that

443
00:29:31,492 --> 00:29:34,932
but maybe as a Qt project we could start envisioning

444
00:29:34,932 --> 00:29:39,452
trying to have solutions on top of what we have already so this is only widget

445
00:29:39,452 --> 00:29:44,092
based and I don't think that I will ever publish it but if you see it's completely

446
00:29:44,092 --> 00:29:48,512
different and it's super similar to other frameworks like Flutter does there

447
00:29:48,512 --> 00:29:52,312
is currently something called Flet that is Flutter for Python that is literally

448
00:29:52,312 --> 00:29:54,712
this kind of like interfaces.

449
00:29:55,212 --> 00:29:58,432
So I know, I don't know, maybe it was a playground thingy. It's something that

450
00:29:58,432 --> 00:30:02,012
is convenient for us to expose people to our dear technology,

451
00:30:02,112 --> 00:30:06,852
but in a way that is not so specific to our framework and in my work.

452
00:30:07,829 --> 00:30:11,789
The other one is packaging and tooling. Even though we still have lots of tools,

453
00:30:11,949 --> 00:30:15,209
I still believe that we need to make a better work communicating it,

454
00:30:15,269 --> 00:30:19,169
and functionality-wise, maybe start shipping everything,

455
00:30:19,369 --> 00:30:23,509
but maybe have one or two that does most of those stuff, because people get

456
00:30:23,509 --> 00:30:29,069
super confused, and I all the time have bug reports like, if I put designer by a standalone,

457
00:30:29,449 --> 00:30:33,289
it doesn't work with the PySite plugins, and it's like, now you need to do PySite

458
00:30:33,289 --> 00:30:34,929
as a designer instead of, okay.

459
00:30:35,589 --> 00:30:40,089
So yeah, maybe we might work on that as well. And new modules integrations.

460
00:30:40,209 --> 00:30:45,429
I always like to see Qt for Python as an interface, trying to get the best of both worlds.

461
00:30:45,609 --> 00:30:50,449
So we are still looking into other Python modules that we can have more API for.

462
00:30:50,789 --> 00:30:57,089
So we can use maybe, I don't know, have a Qtable widget or a view populated

463
00:30:57,089 --> 00:31:01,569
by a Pandas data frame, for example, if you're familiar with Pandas in the Python ecosystem.

464
00:31:02,269 --> 00:31:07,249
Things like that might be worth exploring and might be also a good thing to have in the future.

465
00:31:07,949 --> 00:31:11,809
And the other thing that I was mentioning before is about this async.io module

466
00:31:11,809 --> 00:31:16,909
is that maybe we'll have other modules written in Python only that can improve

467
00:31:16,909 --> 00:31:19,329
the life of Qt developers in Python.

468
00:31:19,529 --> 00:31:21,889
I only have a few slides, so I will be finishing soon.

469
00:31:22,269 --> 00:31:26,369
And as I told you before, but don't tell this anyone outside this room,

470
00:31:26,509 --> 00:31:31,889
if you have requested a specialized API that can break the Qt API but is solving

471
00:31:31,889 --> 00:31:33,249
your problem, let's talk.

472
00:31:33,389 --> 00:31:37,069
And maybe we can even add it to the model without any problem. them and if

473
00:31:37,069 --> 00:31:39,809
you have ideas as well contact me if you

474
00:31:39,809 --> 00:31:43,389
I will be around tomorrow and the day after tomorrow even if

475
00:31:43,389 --> 00:31:46,249
you have pain points I'm happy to hear so what's

476
00:31:46,249 --> 00:31:48,909
next I think that we need to

477
00:31:48,909 --> 00:31:51,849
embrace the idea of many language framework for the Qt ecosystem

478
00:31:51,849 --> 00:31:54,589
and I like I don't know maybe because

479
00:31:54,589 --> 00:31:58,029
I'm getting old but I really would like for us to be boring and

480
00:31:58,029 --> 00:32:00,989
in a sense of like do not try to reinvent a new

481
00:32:00,989 --> 00:32:03,889
super parser that does something if there is something out

482
00:32:03,889 --> 00:32:06,809
there let's use it or they did something that worked let's do

483
00:32:06,809 --> 00:32:09,449
that with every single language because sometimes you don't need

484
00:32:09,449 --> 00:32:12,949
to invent new things all the time you can adopt and nurture

485
00:32:12,949 --> 00:32:17,429
whatever you have with those things so that's the thing that i really envisioned

486
00:32:17,429 --> 00:32:22,549
that having a cute ecosystem imagining like everything acting together and imagine

487
00:32:22,549 --> 00:32:25,489
all the possibilities that we have like putting more languages more ideas more

488
00:32:25,489 --> 00:32:30,069
mechanism that maybe solves problems that you as a cute user as a kda user have.

489
00:32:30,389 --> 00:32:32,969
And then with all this thing, you know what we can, oh, sorry,

490
00:32:33,089 --> 00:32:36,029
we can have a better Qt ecosystem overall.

491
00:32:36,329 --> 00:32:40,629
And with that, I just wanted to see, like, again, if we have a better and polyglot

492
00:32:40,629 --> 00:32:42,869
Qt framework, that means a better KDE for sure.

493
00:32:43,169 --> 00:32:47,189
So yeah, thank you very much. And if you have maybe any questions, you can let me know.