1
00:00:02,428 --> 00:00:09,788
Tim: When we started recording this episode, I thought we'd
be talking about inter process communication and parallelism.
2
00:00:10,068 --> 00:00:17,948
What ended up happening was a huge discussion about
Linux and Rust and C and the future of software.
3
00:00:18,348 --> 00:00:20,498
It's a long episode, but I think you're going to enjoy it.
4
00:00:23,294 --> 00:00:25,304
Welcome to Compose!
5
00:00:25,424 --> 00:00:38,004
It is our third episode and I have the author of a crate, in fact a
couple of crates, who has the best logo that I think I've ever seen.
6
00:00:38,994 --> 00:00:39,164
Zeeshan Ali Khan: Thank you!
7
00:00:39,164 --> 00:00:47,684
Tim: Do you to describe the zbus and the animated
gif or gif that greets people on the readme?
8
00:00:48,279 --> 00:00:50,039
There must be a story behind that.
9
00:00:50,039 --> 00:00:50,869
Zeeshan Ali Khan: Sort of, yeah.
10
00:00:52,779 --> 00:00:55,889
So there's a logo and then there is the how do I call it?
11
00:00:56,289 --> 00:00:57,539
It's an illustration, actually.
12
00:00:57,539 --> 00:00:58,419
Yeah, that's what you call it.
13
00:00:59,729 --> 00:01:02,149
And yeah, this is done by Jakob Steiner.
14
00:01:02,784 --> 00:01:03,784
A great artist.
15
00:01:04,114 --> 00:01:05,024
He works on GNOME.
16
00:01:05,094 --> 00:01:05,844
He's a designer.
17
00:01:06,984 --> 00:01:12,524
And the logo is done by Tobias
Bernhardt, who is another GNOME designer.
18
00:01:12,734 --> 00:01:15,654
So as you can see, I'm very well connected in the GNOME world.
19
00:01:16,954 --> 00:01:24,094
But the library itself, I would describe it as just,
crate that makes you helps you talk D-Bus, right?
20
00:01:24,114 --> 00:01:26,494
It's an inter process communication protocol.
21
00:01:27,026 --> 00:01:30,706
and a lot of system system services on Linux.
22
00:01:30,936 --> 00:01:31,666
They use that.
23
00:01:31,946 --> 00:01:37,306
, so if you want to talk to, let's say systemd or
network manager and modem manager, all of those.
24
00:01:37,636 --> 00:01:38,796
That's where you need D-Bus.
25
00:01:39,126 --> 00:01:43,556
And when you, and that's how most people come to this library.
26
00:01:43,842 --> 00:01:46,302
They, all of a sudden, for any reason, they need that.
27
00:01:46,592 --> 00:01:49,682
And they look around and they find a few libraries and Zbus.
28
00:01:50,142 --> 00:01:57,672
I would say myself, it's the best one that you can find because a
lot of people are porting away from the old one that already existed.
29
00:01:58,032 --> 00:01:59,472
That we will talk about later as well.
30
00:02:00,022 --> 00:02:01,352
But yeah, that's the description.
31
00:02:01,652 --> 00:02:22,422
Tim: So even let's say I'm, is it possible with ZBus,
which is your library, to, is there a Py03 wrapper around
ZBus to talk the D-Bus protocol from, let's say Python
or has that been, is, are you, is the library that you
32
00:02:22,597 --> 00:02:23,147
Zeeshan Ali Khan: I don't think
33
00:02:23,447 --> 00:02:25,622
Tim: easier to use than, okay.
34
00:02:26,222 --> 00:02:26,932
Zeeshan Ali Khan: It is, yeah.
35
00:02:27,092 --> 00:02:33,272
For me one of the greatest compliments was when one of my
friends he was not interested in Rust, actually, for a long time.
36
00:02:33,712 --> 00:02:45,622
And then when he did do Rust, he was doing some D-Bus,
and he used zbus, and he said, oh, this is the reason
I would love Rust now, and this is the reason I want
to do all my D-Bus stuff in Rust because of zbus.
37
00:02:45,832 --> 00:02:49,102
So that I really felt so good about that when that happened.
38
00:02:49,332 --> 00:02:59,862
So yeah it's not there, I don't know of any wrappers for Python or
anything, but I'm pretty sure that they can be made and I think they
would be much better off than the C versions the wrapper for C APIs.
39
00:03:00,322 --> 00:03:00,387
Yeah.
40
00:03:00,582 --> 00:03:10,942
Tim: Correct me if I'm wrong or if I'm mistaken, you have
created a pure Rust implementation of the D-Bus protocol.
41
00:03:11,042 --> 00:03:14,172
You have not wrapped, let's say, I
42
00:03:14,757 --> 00:03:15,087
Zeeshan Ali Khan: Yeah.
43
00:03:15,432 --> 00:03:19,222
Tim: don't know, is there a lib D-Bus
that you then created a library over?
44
00:03:19,692 --> 00:03:19,952
Yeah.
45
00:03:20,152 --> 00:03:20,592
So that,
46
00:03:21,597 --> 00:03:24,987
Zeeshan Ali Khan: I can tell you the story if
you want to here , should I tell you the story?
47
00:03:25,172 --> 00:03:25,772
Tim: please do, please.
48
00:03:25,772 --> 00:03:26,012
Yeah.
49
00:03:26,032 --> 00:03:26,282
Love.
50
00:03:26,342 --> 00:03:26,572
I'd
51
00:03:26,597 --> 00:03:27,737
Zeeshan Ali Khan: Alright, let's do the story.
52
00:03:27,957 --> 00:03:28,767
, the origin story.
53
00:03:28,877 --> 00:03:30,977
My, my background is in systems programming, right?
54
00:03:30,977 --> 00:03:36,297
Because of that, I actually maintained a systems
a component called Geo Clue, which runs on Linux.
55
00:03:36,387 --> 00:03:41,827
A modern Linux machine has geo clue most of them
have which the task of that service is simple.
56
00:03:42,097 --> 00:03:43,867
Find your location by any means.
57
00:03:44,407 --> 00:03:51,737
You can, and I wrote the re-implementation of it and the
main, feature of the re implementation was privacy in mind.
58
00:03:51,977 --> 00:03:59,767
So that users have a choice to, to decide how much, which accuracy and
if they want a relocation services at all in the first place, even.
59
00:04:00,207 --> 00:04:01,287
And that was in C.
60
00:04:01,567 --> 00:04:08,127
So when I got into Rust in around 2016, I I wanted to
rewrite that in Rust and and that's a Diva service.
61
00:04:08,377 --> 00:04:10,077
The first thing I need is a D-Bus library.
62
00:04:10,187 --> 00:04:12,767
And there was an existing library called D-Bus.
63
00:04:13,077 --> 00:04:14,867
Full name is D-Bus RS on the repo.
64
00:04:15,107 --> 00:04:17,037
But and the create name is D-Bus.
65
00:04:17,447 --> 00:04:19,717
And so of course that's what you find, right?
66
00:04:19,797 --> 00:04:22,032
You search for it, you search for D-Bus, you find D-Bus.
67
00:04:22,482 --> 00:04:28,882
And it's still the first hit like zbus cannot be the first
hit because it's the exact match They have squatted the name.
68
00:04:29,402 --> 00:04:33,952
And I tried to try to use it And this is the
time when I was really new to Rust right?
69
00:04:34,162 --> 00:04:50,159
So I have a lot of trouble with all those types that were
being mapped to C types, and they were getting really complex,
actually, and I was having a lot of trouble, and I was at
this hackfest, and I said to my friend, Sebastian hey how
about I rewrite this in Rust and make a pure implementation.
70
00:04:50,479 --> 00:04:52,329
I was really joking at first.
71
00:04:52,499 --> 00:04:53,779
And he said, yeah, why not?
72
00:04:54,179 --> 00:04:55,339
And I was like I'm here.
73
00:04:55,369 --> 00:04:56,139
I'm at a hackfest.
74
00:04:56,179 --> 00:04:56,699
Let's try it.
75
00:04:56,749 --> 00:05:00,619
And I started writing, I'm a systems
guy, so I started from the very scratch.
76
00:05:00,619 --> 00:05:03,129
From the bottom I first worked on this.
77
00:05:03,524 --> 00:05:07,594
thing called zvariant, which is the encoding
part of it, with no transport or anything.
78
00:05:07,924 --> 00:05:11,054
And I did something in three days that kind of worked.
79
00:05:11,054 --> 00:05:14,740
I could create a specific method that could be called.
80
00:05:14,740 --> 00:05:16,660
And I did some very basic socket, right?
81
00:05:16,765 --> 00:05:17,725
Just to test it out.
82
00:05:17,955 --> 00:05:21,825
And I got a response from the from the other side,
which was correct, and I was able to decode it.
83
00:05:21,985 --> 00:05:24,265
That was like, actually, this is not that hard.
84
00:05:24,645 --> 00:05:26,725
And then that's how it started.
85
00:05:27,065 --> 00:05:27,895
This whole project.
86
00:05:28,445 --> 00:05:29,575
So it is a pure [Rust project].
87
00:05:29,600 --> 00:05:30,020
Tim: Wow.
88
00:05:30,230 --> 00:05:30,470
Yeah.
89
00:05:30,470 --> 00:05:33,330
So the variant it's GVariant isn't it?
90
00:05:33,370 --> 00:05:35,580
And that is part of the GNOME project.
91
00:05:36,505 --> 00:05:36,915
Zeeshan Ali Khan: Yeah.
92
00:05:36,955 --> 00:05:38,615
So the, about, about GVariant
93
00:05:38,675 --> 00:05:43,975
D-Bus the wire protocol, the encoding
of it that had some limitations, right?
94
00:05:43,975 --> 00:05:45,745
It's, it started in 2003.
95
00:05:46,145 --> 00:05:50,025
So it's it's been more than two decades of this whole thing existing.
96
00:05:50,515 --> 00:05:56,215
And this one person Allison Lortie she decided
that she wanted something a bit better.
97
00:05:56,435 --> 00:06:07,055
So she wrote a new encoding called GVariant, which is super duper,
like D-Bus was already pretty efficient protocol, but she made it
even more efficient efficient and added some of the missing features.
98
00:06:07,515 --> 00:06:11,415
And the idea was that it will become D-Bus
99
00:06:11,415 --> 00:06:11,430
2.0.
100
00:06:11,680 --> 00:06:13,480
It wasn't supposed to be something different.
101
00:06:13,840 --> 00:06:18,220
But somehow, historically, all those things, moving parts, happening.
102
00:06:18,460 --> 00:06:21,900
She was a glib contributor, so she added this support in glib.
103
00:06:22,210 --> 00:06:37,620
D-Bus to this day, when it, when you need to do any D-Bus stuff
with glib glib api You have to talk this GVariant that the
API is designed for this new, different specification slightly
different than D-Bus and it's not compatible with it, right?
104
00:06:37,980 --> 00:06:44,300
And it internally translates that to D-Bus when it's,
when it actually sends us off and also the vice versa.
105
00:06:44,310 --> 00:06:45,890
So it's a bit slightly inefficient.
106
00:06:45,920 --> 00:06:50,120
It's not as inefficient as it sounds, but it,
there is a bit of, Conversion going on there.
107
00:06:50,680 --> 00:06:56,970
So that thing became GVariant and that is
now separate from the D-Bus, specification.
108
00:06:57,240 --> 00:07:01,590
And I was, when I started this whole
thing, I was not just new at D Rust.
109
00:07:01,670 --> 00:07:03,190
I was also new to,
110
00:07:03,430 --> 00:07:04,750
D-Bus, the protocol.
111
00:07:04,940 --> 00:07:06,690
I had used D-Bus a lot.
112
00:07:06,920 --> 00:07:08,190
And I've implemented services.
113
00:07:08,190 --> 00:07:12,920
I had done a lot of things with D-Bus before,
but I had no idea about the protocol itself.
114
00:07:13,130 --> 00:07:16,770
So I had, I didn't know that GVariant is completely incompatible.
115
00:07:16,810 --> 00:07:19,410
So when I started, that's why I named it zvariant.
116
00:07:19,620 --> 00:07:22,080
And I said, Oh, I'll just support both.
117
00:07:22,240 --> 00:07:23,270
And that would be easy.
118
00:07:23,600 --> 00:07:28,190
Tim: If we didn't say to ourselves that it was
going to be easy, we wouldn't start, right?
119
00:07:28,500 --> 00:07:43,715
The if we knew as much as possible, about how difficult things
would be that we, the knowledge that we gained after being part of a
project for a few years, then you probably would never have started.
120
00:07:44,245 --> 00:07:45,495
And so this literally
121
00:07:45,525 --> 00:07:45,705
Zeeshan Ali Khan: That's
122
00:07:45,805 --> 00:07:47,385
Tim: At a three day hack fest.
123
00:07:47,695 --> 00:08:02,095
And now eight years later, you are the maintainer probably of the
most performant, most easy to use IPC system in the Linux ecosystem.
124
00:08:03,705 --> 00:08:04,515
Zeeshan Ali Khan: Sort of.
125
00:08:04,565 --> 00:08:09,705
The g the there, the other bindings, the C bindings,
they, I would say they're more efficient at the moment.
126
00:08:09,945 --> 00:08:11,055
I'm actually working on that.
127
00:08:11,315 --> 00:08:15,120
So I found the hotspot the bottleneck of my performance.
128
00:08:15,460 --> 00:08:17,590
All the CPU usage, basically.
129
00:08:17,940 --> 00:08:24,140
And I have a pretty, I'm pretty confident that I can make
it more efficient than the C implementations out there.
130
00:08:24,630 --> 00:08:26,420
So yeah, I'm currently working on that actually.
131
00:08:26,790 --> 00:08:27,780
So hopefully it will happen.
132
00:08:27,780 --> 00:08:30,370
But at the moment, it's not the case, I would say.
133
00:08:30,660 --> 00:08:42,280
But they are I would say almost as efficient and they
are that's one thing is for sure, they are a lot more
easier to use, like Zbus is a lot more easier to use
than the C libraries or the bindings to the C libraries.
134
00:08:42,280 --> 00:08:49,230
And that was the idea, so I started with making
it possible that it's as easy as possible.
135
00:08:49,630 --> 00:08:50,680
That was the whole idea.
136
00:08:51,290 --> 00:08:51,580
Yeah.
137
00:08:52,980 --> 00:09:06,228
And about starting things like when you start things because
they're easy that's a really cool thing that it happens that
we think it's easy but there's also the other way around like
sometimes there's a thing and you think it's this is going to be
138
00:09:06,228 --> 00:09:17,578
super difficult And you don't start it you're procrastinating for
years or months or whatever and then you start it and then after a
few days You're like, oh, I'm almost done So it wasn't that hard.
139
00:09:17,578 --> 00:09:18,968
So there are like two sides of it.
140
00:09:19,308 --> 00:09:33,465
Tim: Yeah, it's, and actually I am curious about your
impressions about the phrase systems programmer and the Rust
programming language, because I don't have a systems background.
141
00:09:33,644 --> 00:09:37,216
I was, I have a data science background actually.
142
00:09:37,216 --> 00:09:40,788
And so that was, that means Python and the.
143
00:09:43,138 --> 00:09:51,068
And I think that over the last couple of years, has
outgrown the phrase systems programming language.
144
00:09:51,178 --> 00:09:52,953
Like it's become a much more general purpose.
145
00:09:53,003 --> 00:10:05,848
But I actually think that there are a lot of people
who are intimidated, I don't know, by like low
level systems details unnecessarily, but actually.
146
00:10:07,538 --> 00:10:20,638
If you spent a couple of hours, maybe you would find that
actually it's much more approachable or accessible than
you originally expected that you don't need a PhD to start.
147
00:10:22,978 --> 00:10:24,738
Zeeshan Ali Khan: Yeah, that's that's certainly true.
148
00:10:24,838 --> 00:10:35,708
It's it's actually funny to me because what I have noticed
is that there's a lot more, there are a lot more people from
web and from cloud and all those backgrounds than they are
149
00:10:35,708 --> 00:10:44,283
from systems program programming background in Rust, which
is very surprising to me because for me the main thing about
Rust was that it's, It's a systems programming language.
150
00:10:44,508 --> 00:10:45,688
That's what it's designed for.
151
00:10:46,318 --> 00:10:48,198
So where are all the systems programmers?
152
00:10:48,548 --> 00:10:50,588
So I rarely meet actually systems programmers.
153
00:10:50,588 --> 00:10:52,648
I mostly meet people from other backgrounds.
154
00:10:53,108 --> 00:10:56,698
And and I was very surprised also,
like it's, it went into crypto world.
155
00:10:56,758 --> 00:10:59,828
It's like most of the jobs that you see are from crypto world.
156
00:11:00,148 --> 00:11:02,528
And you're like, this is not what it was designed for.
157
00:11:03,998 --> 00:11:04,348
So
158
00:11:04,738 --> 00:11:04,948
Tim: Yeah.
159
00:11:04,948 --> 00:11:09,098
And actually probably C is a lot easier to write a lot of code.
160
00:11:09,598 --> 00:11:10,418
cryptographic primitives.
161
00:11:10,438 --> 00:11:16,558
You've got more access to constant time operations,
you have at least easier access to intrinsics,
162
00:11:17,398 --> 00:11:18,988
Zeeshan Ali Khan: yeah,
163
00:11:19,478 --> 00:11:24,278
Tim: gets out of your way a little bit, whereas
the Rust compiler is much more opinionated.
164
00:11:26,048 --> 00:11:38,348
Zeeshan Ali Khan: I actually wanted to discuss that a
bit later about coming from C background, but the first
thing about what you asked about systems programming,
um, Defining systems programming is very difficult.
165
00:11:38,398 --> 00:11:43,869
I have learned that a bit the hard way because I've been
interviewing people to, for a systems programming job.
166
00:11:44,229 --> 00:11:47,569
And a lot of time they come and they say,
yeah, I have systems programming background.
167
00:11:47,679 --> 00:11:51,419
Then I ask, and it's completely different from what I was expecting.
168
00:11:51,679 --> 00:11:52,749
And they're not lying there.
169
00:11:52,759 --> 00:11:55,559
They do have systems programming from what they understand it.
170
00:11:56,059 --> 00:11:59,692
The main thing is for me is that the system, right?
171
00:11:59,692 --> 00:12:06,102
The operating system, you have some idea of how the
components on your systems are talking to each other.
172
00:12:06,162 --> 00:12:07,492
What are they doing, basically?
173
00:12:07,808 --> 00:12:14,958
And A lot of times these people come for interviews, they are
when I ask them like, Okay, so system D what IPC they talk, right?
174
00:12:15,368 --> 00:12:17,038
And they're like, I don't know.
175
00:12:17,318 --> 00:12:30,963
I'm like, but that's how can yeah, there's very different definitions
and I can't, Put my finger on one specific one, but for me from
my background, it's like knowing the systems services how they
176
00:12:30,963 --> 00:12:40,497
work essentially and all the essential features of them, like what
do they do for example, if there's a service, for example, and
it's, you don't want them to run, be running all the time, right?
177
00:12:40,497 --> 00:12:45,217
If they're not being used, you want them, the
process not to be running, but how would it work?
178
00:12:45,217 --> 00:12:47,887
What Starts the process when there is a call for them.
179
00:12:48,227 --> 00:12:49,717
And what is the process for that?
180
00:12:49,777 --> 00:12:56,947
And the answer is, of course Socket activation, which systemd's,
the systemd's feature but Most people wouldn't know about that.
181
00:12:57,107 --> 00:13:05,615
So for me that's systems programming and also Using
those libraries and those services like to have
some idea of how to use them when you need to.
182
00:13:05,895 --> 00:13:07,895
That's also systems programming skill, right?
183
00:13:08,255 --> 00:13:13,215
So that's how I would very vaguely
describe what I mean by system programming.
184
00:13:13,215 --> 00:13:15,655
But of course, definitions vary.
185
00:13:16,395 --> 00:13:16,835
Tim: They do.
186
00:13:16,875 --> 00:13:24,565
And see, for example, my definition of
systems programming would be something, would
187
00:13:25,565 --> 00:13:27,175
be something closer to middleware.
188
00:13:27,175 --> 00:13:29,685
So
189
00:13:31,945 --> 00:13:45,030
systems programming, involves writing software for other
programs or And at this point, there are two questions
that have been shouting at me, in the back of my mind.
190
00:13:45,030 --> 00:13:46,950
One is we need to introduce you.
191
00:13:46,960 --> 00:13:47,340
Who are you?
192
00:13:47,340 --> 00:13:50,780
And why are you talking to us?
193
00:13:50,780 --> 00:13:53,485
It's now nearly, we're over a quarter of an hour into the interview.
194
00:13:54,128 --> 00:13:58,878
And I haven't given you the courtesy
of allowing you to introduce yourself.
195
00:13:59,248 --> 00:14:08,308
And the other thing that I think we need to discuss
is what is IPC or what is inter process communication?
196
00:14:08,608 --> 00:14:13,458
Yeah who are you and why are you right?
197
00:14:13,488 --> 00:14:17,018
Why do you write D-Bus?
198
00:14:17,433 --> 00:14:18,253
Inrust.
199
00:14:18,658 --> 00:14:24,288
Zeeshan Ali Khan: I'm ZK . The correct pronunciation
is Khan, but you can call it Khan as well.
200
00:14:24,438 --> 00:14:24,978
It's okay.
201
00:14:25,378 --> 00:14:25,588
Yeah.
202
00:14:25,888 --> 00:14:28,178
Tim: Oh, sorry, I shouldn't have interrupted, but
203
00:14:28,733 --> 00:14:28,913
Zeeshan Ali Khan: no.
204
00:14:28,913 --> 00:14:29,298
It's okay.
205
00:14:29,378 --> 00:14:35,108
Tim: so is that the anglicization of the script?
206
00:14:36,328 --> 00:14:36,668
And,
207
00:14:36,843 --> 00:14:37,383
Zeeshan Ali Khan: Yeah, it is.
208
00:14:37,383 --> 00:14:37,633
Yeah.
209
00:14:37,673 --> 00:14:44,753
It's I think in Pakistan, we call it Latin, like
you write it in Latin, Latinization or something.
210
00:14:45,133 --> 00:14:46,403
But yeah, it's it's that.
211
00:14:46,583 --> 00:14:49,013
Actually, no, it's called Romanization or something.
212
00:14:49,023 --> 00:14:49,503
That's weird.
213
00:14:49,553 --> 00:14:49,943
But yeah.
214
00:14:50,573 --> 00:14:50,703
So
215
00:14:50,743 --> 00:14:55,303
Tim: Anglicization from English Latinization about
the script Romanization because of the Latin.
216
00:14:55,303 --> 00:14:59,183
Anyway, sorry from Romans languages, but yeah, that's yeah.
217
00:14:59,183 --> 00:15:00,493
So yeah.
218
00:15:00,523 --> 00:15:00,913
Thank you.
219
00:15:00,913 --> 00:15:01,453
Thank you for that.
220
00:15:01,453 --> 00:15:02,353
Sorry about the division.
221
00:15:02,353 --> 00:15:02,683
Carry on
222
00:15:03,413 --> 00:15:03,853
Zeeshan Ali Khan: no worries.
223
00:15:04,303 --> 00:15:10,493
So yeah my, my nation is called Pashtuns and we are everyone you
meet from that nation is called their last name would be Khan.
224
00:15:10,833 --> 00:15:13,263
So it's it's quite common because of that.
225
00:15:13,653 --> 00:15:16,743
And yeah, I'm from this country called Pakistan originally.
226
00:15:17,063 --> 00:15:23,823
And I moved to Finland and the, in
2005, it's been almost 20 years of that.
227
00:15:24,153 --> 00:15:28,123
And I I went there to work on something called MIMO or MIGO project.
228
00:15:28,143 --> 00:15:31,083
People know it from different names
because I changed names over the time.
229
00:15:31,333 --> 00:15:36,573
And the idea was to make a device by Nokia that is Linux based.
230
00:15:36,823 --> 00:15:45,213
And it was in the beginning, it was just internet tablets,
but then we started also doing these phones at some
point because they wanted to become mainstream, right?
231
00:15:45,723 --> 00:15:47,753
Things didn't go in the end so well.
232
00:15:47,783 --> 00:15:52,023
And Yeah people know about the story, what
happened to Nokia, so I wouldn't go into that.
233
00:15:52,353 --> 00:15:59,483
But for five years, I was working there, and I was doing what I would
call systems programming, but also more embedded systems programming.
234
00:15:59,783 --> 00:16:10,173
And that's, that was a bit different in the sense that we were
mostly using like GNOME software, the stack but we are putting
our own UI on it, and underneath there were our own drivers.
235
00:16:10,503 --> 00:16:19,573
A lot of them were women proprietary, but there was a lot of
stuff that was open source and even Nokia was like funding
creation and development of a lot of open source projects.
236
00:16:19,573 --> 00:16:22,623
They were part of GNOME basically for a long time.
237
00:16:22,953 --> 00:16:29,155
And and we had a really good relationship with with GNOME
and then later it was Qt became very important there.
238
00:16:29,415 --> 00:16:33,285
So I was interacting a bit with that
too, but I was mostly a GNOME guy.
239
00:16:33,505 --> 00:16:35,975
So basically doing desktop stuff.
240
00:16:36,260 --> 00:16:43,130
But some do it in a way that it works performantly on and
then a better device as well with resource constraints.
241
00:16:43,370 --> 00:16:45,720
So that was a, it was a very nice challenge.
242
00:16:45,990 --> 00:16:53,740
And I got because of that background, I got so used to having
things very optimized and having things very like very small.
243
00:16:53,740 --> 00:16:59,040
And it's just in now in my, I would say DNA
that I need things to be super efficient.
244
00:16:59,420 --> 00:17:02,030
And that's why I got into D-Bus as well, because of that.
245
00:17:02,050 --> 00:17:07,800
And and we can define IPC at the same time as we
it's just one process talking to another, right?
246
00:17:08,060 --> 00:17:12,931
On, on Linux, on I, I I guess all pro all
operating systems, you call them processes, right?
247
00:17:12,931 --> 00:17:16,451
Like, when you launch a program and it's running, it's a process then.
248
00:17:16,671 --> 00:17:20,111
So that living instance of a program is called a process.
249
00:17:20,401 --> 00:17:23,946
And when that needs to talk to another one this is called an IPC.
250
00:17:24,166 --> 00:17:26,326
And this can be a very low level thing.
251
00:17:26,356 --> 00:17:30,656
Like a lot of IPCs and RPCs I've seen,
they're actually pretty low level.
252
00:17:30,716 --> 00:17:31,998
They think in terms of messages.
253
00:17:32,026 --> 00:17:35,236
So you have a message and you have defined an encoding and.
254
00:17:35,756 --> 00:17:42,246
When you're both sides agree to what the encoding is how it will be
encoded and decoded then they can talk, basically talk to each other.
255
00:17:42,556 --> 00:17:47,756
And one side sends the message, the other one
decodes it and figures out what message it is.
256
00:17:48,036 --> 00:17:49,786
In Rust world, we will have an enum, right?
257
00:17:49,786 --> 00:17:54,906
Usually oh, the other side sends me a command and what
command it is and you match it on it and stuff like that.
258
00:17:55,526 --> 00:17:56,256
So on a basic,
259
00:17:56,276 --> 00:18:03,566
Tim: this might, so even more low level,
I, so something like zero MQ, for example,
260
00:18:04,746 --> 00:18:05,096
Zeeshan Ali Khan: yeah,
261
00:18:05,396 --> 00:18:14,126
Tim: yeah there are two programs essentially, two processes
and I'm sending messages between one and the other.
262
00:18:14,236 --> 00:18:14,656
And
263
00:18:17,076 --> 00:18:25,376
at the, on the receiving side, there is essentially
no knowledge yet about what the message will contain.
264
00:18:25,836 --> 00:18:39,626
Is this what you mean by, you need to define both a
transport layer, a way to send bytes between two passages
and an encoding so that both sides can actually make sense
of the bytes, the bits that are being sent between one
265
00:18:39,926 --> 00:18:40,266
Zeeshan Ali Khan: yeah.
266
00:18:40,616 --> 00:18:43,046
And they're like self describing formats, right?
267
00:18:43,046 --> 00:18:49,436
Like JSON, where you don't need to any more
information from the other side, except that it's JSON.
268
00:18:49,786 --> 00:18:52,926
And then they can, Sorry, decoded.
269
00:18:53,236 --> 00:18:58,044
But in, then there are non self describing
like D-Bus, which is a binary protocol.
270
00:18:58,074 --> 00:19:00,944
Everything, as I said needed to be super efficient.
271
00:19:00,954 --> 00:19:04,974
They created a binary protocol so that it's not for human eyes, right?
272
00:19:05,164 --> 00:19:08,874
So it's only for programs for code for programmers to decipher.
273
00:19:09,124 --> 00:19:11,734
It, it doesn't need to be self describing.
274
00:19:12,074 --> 00:19:13,194
All you need is how to.
275
00:19:13,329 --> 00:19:14,029
how to decode it.
276
00:19:14,289 --> 00:19:15,969
And the how to is is the important bit.
277
00:19:16,299 --> 00:19:19,516
And it's they also define like alignments.
278
00:19:19,566 --> 00:19:24,686
This, it is defined so that you can
read directly from the encoded message.
279
00:19:24,976 --> 00:19:28,646
So you don't need to put it in, into another thing, right?
280
00:19:28,646 --> 00:19:32,501
Like you, when you're decoding it, you
don't need to deserialize to another thing.
281
00:19:32,801 --> 00:19:36,251
Tim: So this is known as zero copy.
282
00:19:36,726 --> 00:19:37,066
Zeeshan Ali Khan: Yeah.
283
00:19:38,096 --> 00:19:43,696
Yeah, so it was very much designed for zero copy
reading or deserialization or whatever you call it.
284
00:19:44,076 --> 00:19:45,816
And it's the case for the DBS.
285
00:19:46,186 --> 00:19:48,086
That's the important bit.
286
00:19:48,786 --> 00:19:51,606
I have this condition that I forget what I was talking about.
287
00:19:51,607 --> 00:19:54,606
I
288
00:19:54,741 --> 00:19:55,621
Tim: to remind you of this.
289
00:19:55,746 --> 00:19:55,916
It
290
00:19:55,961 --> 00:19:57,001
Zeeshan Ali Khan: was introducing myself.
291
00:19:57,301 --> 00:19:58,021
Tim: Yeah, that's right.
292
00:19:58,231 --> 00:20:02,271
And also, by the way, you described the internals of IPC.
293
00:20:02,431 --> 00:20:02,831
That's okay.
294
00:20:02,861 --> 00:20:05,731
So you are at Is it MeMo?
295
00:20:06,021 --> 00:20:32,524
And the reason why I say that is because I wanted to interrupt
you at that point and say, I think I read every blog post
about MeMo and there were a few other names or It seemed
like there was a lot of A lot or about between 20, 2003,
2005, it seemed like Linux on mobile might actually happen.
296
00:20:32,584 --> 00:20:41,934
And in fact, I think Nokia did actually produce one really
good phone just, and then got acquired by Microsoft.
297
00:20:42,844 --> 00:20:43,544
And then needed
298
00:20:43,649 --> 00:20:43,844
Zeeshan Ali Khan: just,
299
00:20:49,144 --> 00:20:49,434
Tim: Is it
300
00:20:49,499 --> 00:20:53,849
Zeeshan Ali Khan: So they first set up, yeah, it was N9.
301
00:20:54,259 --> 00:20:56,289
And I think N9.
302
00:20:56,589 --> 00:20:58,094
Tim: N95 is the mask.
303
00:20:58,589 --> 00:21:01,719
Zeeshan Ali Khan: It's there was a
developer version of it with a keyboard.
304
00:21:01,789 --> 00:21:03,189
with a slide, sliding keyboard.
305
00:21:03,669 --> 00:21:10,139
But the main one was called N9 at the end, but they had
already signed an agreement with Microsoft of partnership.
306
00:21:10,489 --> 00:21:17,289
So they were going with Windows or whatever it was
for in the future in any case before N9 was produced.
307
00:21:17,729 --> 00:21:19,589
We knew that the ship was going down.
308
00:21:19,589 --> 00:21:22,219
We left so at that point I left and I joined Red Hat.
309
00:21:22,589 --> 00:21:23,609
And then I was doing.
310
00:21:23,859 --> 00:21:24,949
Purely desktop stuff.
311
00:21:24,979 --> 00:21:28,969
So I was not doing like I didn't need
to care about super efficiency anymore.
312
00:21:29,399 --> 00:21:36,609
And I was there for five years and I was doing mostly C in all
this time, but there was also another language called Vala.
313
00:21:36,999 --> 00:21:40,689
Because I was also tired a bit of C
because it was just too low level, right?
314
00:21:40,999 --> 00:21:44,989
So I needed something a bit higher level that can be as efficient as
315
00:21:45,289 --> 00:21:46,079
Tim: Isn't that a scheme?
316
00:21:46,379 --> 00:21:47,509
Zeeshan Ali Khan: Vala sorry Vala.
317
00:21:47,814 --> 00:21:48,974
Tim: Vala a scheme?
318
00:21:49,294 --> 00:21:52,004
Or, oh no, I thought it was a Lisp dialect.
319
00:21:52,074 --> 00:21:52,464
I,
320
00:21:52,504 --> 00:21:53,494
Zeeshan Ali Khan: No, it's not at all.
321
00:21:53,524 --> 00:21:55,834
Actually, it's it's based on C sharp.
322
00:21:55,854 --> 00:22:01,524
The syntax is C sharp based, but it compiles,
transpiles, as people call it, to C.
323
00:22:01,854 --> 00:22:06,424
So it was basically writing C in a higher level language like C sharp.
324
00:22:06,704 --> 00:22:07,984
That was very convenient.
325
00:22:08,179 --> 00:22:23,869
And I wrote my, one of my project called Rigel, it's a I
don't know if people still remember this thing called DLNA or
UPnP, which is about talking from one device to another, it
was more like an RPC, not IPC, but RPC and it, most, a lot of
326
00:22:23,869 --> 00:22:34,209
media servers, media renders, TVs still do that actually and
that, that's what I was working on, and it's an open source
project, Rigel, and it was done in Vala And my library was in C.
327
00:22:34,449 --> 00:22:40,179
So I was doing this thing called this thing, that I was doing
libraries in C and the application I would write in Walla.
328
00:22:40,559 --> 00:22:51,009
And but then like when GNOME like when Nokia, that
was like going in the other direction and I left Nokia
and Walla was The interest was going down very fast.
329
00:22:51,189 --> 00:22:55,679
And then Rust came along and that
interest in Vala, basically a flat line.
330
00:22:55,799 --> 00:23:07,119
It's not it's still like people really like it in GNOME still, and
they still do it some people, but the number of people doing Vala is
like really low and there's a lot more people interested in Rust now.
331
00:23:07,349 --> 00:23:10,139
So I think Rust basically killed Vala at some point.
332
00:23:10,459 --> 00:23:11,609
But I was still.
333
00:23:11,869 --> 00:23:12,449
Interested in it.
334
00:23:12,449 --> 00:23:19,019
So even at Red Hat I was doing Vala until I got into Rust
and then I was like, okay I don't need Vala at all anymore.
335
00:23:19,029 --> 00:23:19,579
It's Rust has,
336
00:23:20,749 --> 00:23:35,169
Tim: Yeah, I think that there are a few languages that
are essentially C With different syntax, and for example,
there's an extension language for Python called Cython
337
00:23:35,329 --> 00:23:48,529
which allows you to write native extensions, and, But the
thing that gets me with these languages is they still have
memory safety issues and you can still have null pointers.
338
00:23:49,099 --> 00:23:49,419
Zeeshan Ali Khan: yeah.
339
00:23:49,499 --> 00:23:51,479
Null pointers is very common.
340
00:23:52,289 --> 00:23:54,129
I think most of my time was spent on that.
341
00:23:54,149 --> 00:23:59,799
And that's actually, that brings me to
why I wanted to rewrite GeoClue, right?
342
00:23:59,799 --> 00:24:05,309
Because all the bugs that I was getting, I was
not that interested in maintaining it anymore.
343
00:24:05,349 --> 00:24:06,419
And I was the maintainer.
344
00:24:07,139 --> 00:24:08,259
Nobody wanted to take it.
345
00:24:08,609 --> 00:24:11,159
And all the bugs I was getting were crash reports.
346
00:24:11,589 --> 00:24:28,954
Basically, and because of some pointer getting in a different way,
and the funny, not so funny actually, in that time, was that I
would solve a crash, and it would solve that specific crash, but And
that fix would introduce other crashes that would come out later.
347
00:24:28,974 --> 00:24:31,244
And I was like, Oh, I have to do this again.
348
00:24:31,684 --> 00:24:33,279
So I was getting really tired of that.
349
00:24:33,589 --> 00:24:37,049
And I was like, if there is a way to,
to just completely remove them, why not?
350
00:24:37,339 --> 00:24:45,389
So I started rewriting in in Rust and all these years later, I
think it's been four years since I started Zebus or maybe even five.
351
00:24:45,479 --> 00:24:46,709
I think at least four years now.
352
00:24:46,959 --> 00:24:49,009
And I still haven't read it in GeoClue.
353
00:24:49,089 --> 00:25:01,659
I actually, in the between, gave up like that project because
Zebus itself became such a big project and it, I have to
do so much for that now that I just don't have the time.
354
00:25:02,009 --> 00:25:04,809
So yeah I'm mostly just doing Zebus now, not GeoClue.
355
00:25:05,439 --> 00:25:06,089
Are you on mute?
356
00:25:06,959 --> 00:25:08,649
Tim: Sorry, the,
357
00:25:11,439 --> 00:25:26,259
so your GeoClue project is currently, it works, but as far
as, but essentially you have the problem that you probably,
you are the quote, the maintainer or the owner of the project.
358
00:25:26,439 --> 00:25:30,269
However, you don't have enough capacity to actually,
359
00:25:30,619 --> 00:25:37,109
Zeeshan Ali Khan: Yeah, so I have given it up like
to other folks who were interested in contributing
and I was like, yeah, you are contributing a lot.
360
00:25:37,109 --> 00:25:38,999
Please, just maintain it from now on.
361
00:25:39,359 --> 00:25:42,099
And they also, at least one of them needed for their work.
362
00:25:42,457 --> 00:25:48,319
So I was like, yeah, it makes sense that for you to take
it over because I for me, it wasn't work project anymore.
363
00:25:48,319 --> 00:25:50,649
It was I wasn't getting paid to work on it at all.
364
00:25:51,069 --> 00:25:52,499
And I just didn't have the capacity.
365
00:25:52,499 --> 00:25:56,839
And as I have a kid now, so it's been two
years that I have a little one as long, as
366
00:25:56,839 --> 00:25:57,479
Tim: I
367
00:25:57,529 --> 00:25:57,749
Zeeshan Ali Khan: it's,
368
00:25:58,049 --> 00:25:59,919
Tim: is it's challenging.
369
00:25:59,919 --> 00:26:11,319
The interesting thing about this that I think is a more broad or more
general discussion that so much work gets pushed onto so few people.
370
00:26:12,624 --> 00:26:21,514
In open source, the, and the, and it even to
hear, Oh, look, now ZBus is doing very well,
371
00:26:22,404 --> 00:26:32,504
that doesn't reduce the amount of work, although it probably
get different bug reports, or at least different feature
reports but it seems As things become more successful,
372
00:26:32,964 --> 00:26:33,394
Zeeshan Ali Khan: yeah,
373
00:26:33,504 --> 00:26:41,554
Tim: the job almost becomes harder because you
don't want to push out a release that is broken or
374
00:26:41,854 --> 00:26:42,314
Zeeshan Ali Khan: Of course.
375
00:26:42,614 --> 00:26:43,364
Tim: And things like this,
376
00:26:44,044 --> 00:26:46,204
Zeeshan Ali Khan: Yeah it's yeah, it's certainly true.
377
00:26:46,204 --> 00:26:50,354
And Zebus is used quite a lot nowadays, like in actual production.
378
00:26:50,704 --> 00:27:03,744
People actually, even I met once a person who was
using a beta version, like I had specifically marked
it as beta because I I did not want anyone to use
it in production, but he was using it in production.
379
00:27:04,044 --> 00:27:12,484
I was like you have to immediately change to a
supported version because i'm not gonna support
you on this so yeah, it's used, quite a lot.
380
00:27:12,534 --> 00:27:21,839
In by so many companies big and small Since it's insane, but the
contribution that are coming they are not They're not in proportion.
381
00:27:21,939 --> 00:27:24,349
They're people just assume yeah, this is the project.
382
00:27:24,349 --> 00:27:24,849
It's cool.
383
00:27:24,849 --> 00:27:25,719
And we will use it.
384
00:27:25,719 --> 00:27:26,109
It works.
385
00:27:26,469 --> 00:27:28,719
If they have a problem, they usually work around it.
386
00:27:28,719 --> 00:27:30,969
I joined a few companies where they were already using it.
387
00:27:31,429 --> 00:27:34,009
And then I found out that they were working around some problems.
388
00:27:34,009 --> 00:27:35,079
I'm like, why are you working around?
389
00:27:35,079 --> 00:27:35,949
Why didn't you tell me?
390
00:27:36,099 --> 00:27:36,919
I could have fixed this.
391
00:27:37,879 --> 00:27:39,359
No they just work around it.
392
00:27:40,189 --> 00:27:48,599
One of them actually had a huge document explaining
how to work around a very small problem in Zebas
that I could have in five minutes fixed it.
393
00:27:48,629 --> 00:27:52,229
But no, he had to write a whole document to work around it.
394
00:27:52,874 --> 00:28:00,934
Tim: I wonder, yeah, it's very hard for commercial
users of open source to speak to maintainers
395
00:28:01,664 --> 00:28:02,024
Zeeshan Ali Khan: Yeah.
396
00:28:02,154 --> 00:28:04,124
Tim: in a sensible way, I think,
397
00:28:04,174 --> 00:28:04,354
Zeeshan Ali Khan: Yeah.
398
00:28:04,354 --> 00:28:11,928
I think they just don't have this sorry to interrupt,
but I just that I think they just don't have
this thing that these are people you can talk to.
399
00:28:11,928 --> 00:28:24,623
I think they think of open source maintainers, developers as
some sort of guards or some out of reach people who are really
awesome, but they, Yeah, it's yeah, that's a bit of a problem.
400
00:28:25,073 --> 00:28:25,873
You can fix it.
401
00:28:25,913 --> 00:28:29,023
It's you just tell them like, yeah, this is a guy like me.
402
00:28:29,093 --> 00:28:30,283
I'm working with you now, right?
403
00:28:30,283 --> 00:28:31,303
Like I'm not a God.
404
00:28:31,493 --> 00:28:32,253
I'm just like you.
405
00:28:32,253 --> 00:28:33,443
Yeah, it is a bit of a problem.
406
00:28:33,483 --> 00:28:33,763
Sorry.
407
00:28:33,813 --> 00:28:34,413
I interrupted you.
408
00:28:34,413 --> 00:28:38,053
Yeah.
409
00:28:38,353 --> 00:28:50,843
Tim: But I am curious around how the process
of developing software in Rust comes across.
410
00:28:51,013 --> 00:28:52,273
So there's two aspects.
411
00:28:52,383 --> 00:28:55,123
One is the friction between communities.
412
00:28:55,363 --> 00:29:05,853
Essentially, you've already talked about how Rust in at
least the GNOME, the context of GNOME project kind of,
destroy, destroyed the momentum for Vala, let's say.
413
00:29:06,213 --> 00:29:08,503
And then the, but I think.
414
00:29:09,103 --> 00:29:18,123
With D-Bus, if the Rust implementation becomes, if
you remove these bottlenecks, you discover that.
415
00:29:18,498 --> 00:29:24,868
You could potentially go faster and you are easier to use that.
416
00:29:25,278 --> 00:29:33,598
Does that not cause issues with the people who
developed the original code in a different language?
417
00:29:33,988 --> 00:29:47,668
And the other related question is what does it feel like to write
rust for something that is spiritually in a different language?
418
00:29:48,288 --> 00:29:52,648
You cannot force D-Bus to change.
419
00:29:52,768 --> 00:30:00,563
You need to comply with It's rules and Rust has its own opinions.
420
00:30:01,113 --> 00:30:12,573
And I assume that there is conflict at a technical
level between what Rust wants or Rust, Rust compiler
wants and the, what the specification requires.
421
00:30:15,268 --> 00:30:18,008
Zeeshan Ali Khan: If you don't mind, I'll answer your, Last question.
422
00:30:18,258 --> 00:30:22,378
No, second question first, because I
understood that question and I know the answer.
423
00:30:22,578 --> 00:30:24,458
And the first question, I have to clarify,
424
00:30:24,973 --> 00:30:25,413
Tim: Okay.
425
00:30:25,413 --> 00:30:25,523
Sure.
426
00:30:25,578 --> 00:30:29,763
Zeeshan Ali Khan: So yeah, so the second
question about compatibility, right?
427
00:30:29,763 --> 00:30:35,565
So that's something I learned fairly early on
because I first provided an API like for zvariant.
428
00:30:35,635 --> 00:30:36,985
It wasn't zBus yet.
429
00:30:37,295 --> 00:30:38,505
zvariant was already there.
430
00:30:38,825 --> 00:30:45,125
And the first issue that was filed against it after the
first release was, why are you not providing a serde API?
431
00:30:45,485 --> 00:30:48,065
And that's like the standard in Rust.
432
00:30:49,540 --> 00:30:55,350
The answer that I probably didn't give to that person,
but the answer was really that I was new to Rust.
433
00:30:55,670 --> 00:31:06,380
I was already struggling with Rust itself and and to go for serde,
which I looked at and I got scared, especially to implement it, right?
434
00:31:06,480 --> 00:31:10,665
Serde, it's so easy, so interesting, so good.
435
00:31:11,135 --> 00:31:15,735
But when you implement it That's where things get
a bit hairy, especially if you're new to Rust.
436
00:31:15,735 --> 00:31:18,835
You see the lifetimes, you're like, what the hell is going on?
437
00:31:19,255 --> 00:31:20,335
So I got scared basically.
438
00:31:20,595 --> 00:31:23,995
And I was like, okay, I can't deal
with multiple things at the same time.
439
00:31:23,995 --> 00:31:25,495
I'm learning D-Bus protocol.
440
00:31:25,675 --> 00:31:26,455
I'm learning Rust.
441
00:31:26,665 --> 00:31:27,485
I can't be learning.
442
00:31:27,845 --> 00:31:28,625
Serde as well.
443
00:31:28,755 --> 00:31:37,445
So I didn't do serde, but the, after that, I was
like, okay, let's create a serde based API because
that's what people would be interested in Rust world.
444
00:31:37,735 --> 00:31:46,275
So when I did that, I realized soon that there was a huge,
there was a fundamental problem between D-Bus and serde.
445
00:31:46,715 --> 00:31:53,620
And the reason is that, When you're doing serde,
implementing serde deserializer or serializer when you're,
446
00:31:53,765 --> 00:31:55,175
Tim: I should pause there just, sorry.
447
00:31:55,435 --> 00:32:00,245
So for people who have not implemented a file format
448
00:32:02,415 --> 00:32:10,345
for serde, serde, so you will be used to the
serialize and deserialize traits that you derive.
449
00:32:10,425 --> 00:32:17,585
They're very common, we just, again, we just bolt them
on to our struct and serde does the rest of the work.
450
00:32:18,055 --> 00:32:44,950
Now, when you want to provide a file format, On the
serialize or deserialize side, you implement different
traits these are called serialize er and deserialize er,
which have this slightly odd visitor pattern API, which
itself seems very mystical and it's difficult and complex.
451
00:32:44,990 --> 00:32:45,670
So carry on.
452
00:32:45,760 --> 00:32:47,810
I just thought I would just explain for people who
453
00:32:47,860 --> 00:32:48,480
Zeeshan Ali Khan: No, no worries.
454
00:32:48,480 --> 00:32:49,560
I should have done that.
455
00:32:49,860 --> 00:32:50,350
Tim: that's okay.
456
00:32:50,360 --> 00:32:50,780
It's okay.
457
00:32:51,130 --> 00:32:52,010
Zeeshan Ali Khan: I should have done that.
458
00:32:52,050 --> 00:32:58,600
Yeah, as as Tim just pointed out it's also for
example, like when you use a specific format, right?
459
00:32:58,600 --> 00:33:02,130
JSON, SerdeJSON and TOML and all that.
460
00:33:02,360 --> 00:33:07,090
So they are implementing behind the scene
for you, the serializer and deserializer.
461
00:33:07,150 --> 00:33:25,533
And for those self describing formats that I talked of before
ser json and toml and stuff it's much easier and serde, it
seems to me from looking at it from internal perspective,
it seems to be very much defined very much created for these
formats, so it's much easier to implement it for those.
462
00:33:25,823 --> 00:33:31,443
But it's much, much harder to implement it for binary
protocols that are not self describing in general.
463
00:33:31,623 --> 00:33:34,993
And also, as Tim pointed out, there's
the visitor pattern for de serializer.
464
00:33:35,143 --> 00:33:38,873
So de serializer is a bit harder to
implement than serializer, but it's similar.
465
00:33:39,153 --> 00:33:47,223
The good thing, the good news was actually that all the basic
types that DBAs has are the same as in rust and survey world.
466
00:33:47,223 --> 00:33:48,393
So they're they match.
467
00:33:48,483 --> 00:33:49,313
So that was a good thing.
468
00:33:49,623 --> 00:33:51,071
But the ba the part that.
469
00:33:51,906 --> 00:34:07,871
That where the things fall apart is when you want to implement a
container like Array, for example, D-Bus calls it Array, but in in
Serde world, it's called a sequence, which is like a whack, or or a
slice, for example that when you encode or decode that's where the
470
00:34:07,871 --> 00:34:18,796
problems comes because a Serde, when when you're serialize, when
you're implementing this serializer or deserializer trait it does not
tell you the type, because Rust doesn't have what do you call that?
471
00:34:18,826 --> 00:34:19,836
Reflections, right?
472
00:34:19,846 --> 00:34:22,936
It doesn't tell you exactly what the type is.
473
00:34:23,196 --> 00:34:25,606
It's very defined in a very generic way.
474
00:34:25,616 --> 00:34:30,496
You get a generic type that, oh, this type
implements serialize and deserialize, and that's it.
475
00:34:30,856 --> 00:34:32,357
And you don't have no other information.
476
00:34:32,596 --> 00:34:36,126
So in, in D-Bus, unfortunately, there is a weird.
477
00:34:36,386 --> 00:34:47,776
Requirement that when you are encoding an empty array, empty
sequence, basically, you have to still pad for the first
first element, even if you don't have the first element.
478
00:34:47,836 --> 00:34:47,996
If
479
00:34:48,076 --> 00:34:50,106
Tim: this is because of the alignment.
480
00:34:50,171 --> 00:34:54,231
Yeah,
481
00:34:54,256 --> 00:34:59,436
Zeeshan Ali Khan: because of this alignment requirement, you
have to add some zeros in the encoding based on what type it is.
482
00:34:59,936 --> 00:35:04,426
And since you don't know what type it is,
what does it contain inside you can't do it.
483
00:35:04,576 --> 00:35:10,576
It's just impossible doing it purely with
serde itself, with the serde API and Rust.
484
00:35:10,896 --> 00:35:19,706
I had to implement a requirement in there, so that
your type doesn't just have to implement serialize
or deserialize depending on what you're doing.
485
00:35:20,036 --> 00:35:30,376
But also, another create, which I called type
which gives me a specific string, which is in
D-Bus, defines what is on, in, inside, right?
486
00:35:30,506 --> 00:35:32,536
Because it's not a self describing format, as I said.
487
00:35:32,706 --> 00:35:40,086
So to decode a series of bytes that you receive from the
other side, you need something to tell you what's in there.
488
00:35:40,366 --> 00:35:42,646
And that thing is called a signature.
489
00:35:42,906 --> 00:35:46,856
And the signature is just a string that tells about each.
490
00:35:47,016 --> 00:35:49,346
Type that is encoded in sequence in there.
491
00:35:49,576 --> 00:35:55,726
Okay, this is an array of strings, and
then now a string so basically a struct.
492
00:35:55,726 --> 00:35:58,306
Everything is a struct of different sizes, right?
493
00:35:58,516 --> 00:35:59,476
And it describes that.
494
00:35:59,686 --> 00:36:06,746
So I had to introduce, I was so annoyed by this,
because I really did not want the, people to have
to do this because you have a random type, right?
495
00:36:06,746 --> 00:36:10,796
Like from a different crate and you have this orphan rule in Rust.
496
00:36:11,156 --> 00:36:16,366
And now all of a sudden you need to, for D-Bus, how
do you encode it or decode it from D-Bus, right?
497
00:36:16,586 --> 00:36:17,046
You need.
498
00:36:17,311 --> 00:36:30,838
The signature, all of a sudden, and it's more work serde, deserialize,
and serialize, they're so common, all those traits crates they
provide serde features usually, and they provide this implementation
499
00:36:30,838 --> 00:36:43,079
for you, but they will not do that for Zebus, because as famous
as it could be, it doesn't matter because it cannot come to the
same, Fame as it says it is and they will not go that far for it.
500
00:36:43,269 --> 00:36:49,849
So it was really annoying, but that's where the incompatibility
happened between the two worlds and I had to do that.
501
00:36:50,079 --> 00:36:51,929
But I did provide a macro.
502
00:36:52,104 --> 00:36:54,504
So that you don't have to do it manually.
503
00:36:54,774 --> 00:36:57,164
It's really hard to prove, to always implement that.
504
00:36:57,434 --> 00:36:59,074
But it's I have, I've done that.
505
00:36:59,074 --> 00:37:00,754
So it's not that hard.
506
00:37:00,844 --> 00:37:04,074
So because in the end, I wanted to make it as easy as possible.
507
00:37:04,304 --> 00:37:11,024
And this is as easy as it could be because of this
fundamental incompatibility between these two worlds.
508
00:37:11,354 --> 00:37:15,304
Now we can talk about your first question,
if I have answered your second question.
509
00:37:16,419 --> 00:37:44,389
Tim: I think that no I appreciate that there is I only
have a half thought in response, which would be something
along the lines that there is a, I want to shake serde
and say, look, I wonder if we, so the thought is,
shouldn't we have some way to tell serde something extra?
510
00:37:45,089 --> 00:38:00,024
Can we provide some sort of context about the type that
we, the information that we expect, and then we could go
back to, I wonder if we have just created the same the
page of documentation about workarounds in the file format.
511
00:38:01,894 --> 00:38:03,984
Maybe we should talk to David Tolman.
512
00:38:04,194 --> 00:38:22,024
However, the, I actually think in the case of serde, that it's design
means that adjusting it now is going to be so hard that effectively
you need the page of documentation or in your case, the macro.
513
00:38:22,429 --> 00:38:23,289
To work around it.
514
00:38:23,579 --> 00:38:39,159
I think I have this personal grumpiness about
how prominent serde is for serialization and
deserialization, because I think that it forces itself.
515
00:38:39,329 --> 00:38:45,339
Anyway, I wish that serialized and deserialized were part of
the standard library and that they were slightly more neutral or
516
00:38:45,689 --> 00:38:56,209
Zeeshan Ali Khan: Yeah the thing is that this specific issue
was filed already by the previous creator, the D-Bus RS,
which was a library, which is a wrapper around a C library.
517
00:38:56,579 --> 00:39:02,229
And I think they wanted to also move away from
C library and create a new API based on serde.
518
00:39:02,449 --> 00:39:07,110
So they filed this issue already and they discussed with
David Tolney and in the end they themselves closed, the issue.
519
00:39:07,570 --> 00:39:12,990
The issue saying that, okay, I think this
is going to require breaking serde API.
520
00:39:13,220 --> 00:39:20,980
And that's not something you want but to make it actually even go even
further one step, because I don't want people to do having to do this.
521
00:39:21,230 --> 00:39:25,140
So all the famous crates, let's say time and What is the other one?
522
00:39:25,180 --> 00:39:31,887
Chrono, and all those kind uuid, everything, all those crits that
are the most famous one that provides types that are used all over.
523
00:39:32,317 --> 00:39:41,637
I in Zebus have provided these features that are that
when you enable it, it provides you serialization,
deserialization for, not deserialization, but the type.
524
00:39:41,857 --> 00:39:42,877
implementation for you.
525
00:39:42,987 --> 00:39:51,397
So you don't, in most cases, you don't actually have
to do this, but mostly for your custom types, for which
you have to implement serialize, deserialize anyway.
526
00:39:51,597 --> 00:39:53,737
So you might as well derive one more thing.
527
00:39:53,987 --> 00:39:55,207
And that's, it's not so bad.
528
00:39:55,397 --> 00:39:58,757
So I think in the end, what I have ended up with is not so bad.
529
00:39:59,057 --> 00:40:05,907
And I can always add more types in in ZBus if Someone comes
around anything so they don't have to work around actually
530
00:40:06,317 --> 00:40:08,427
Tim: you very much for doing the work to,
531
00:40:09,147 --> 00:40:14,347
Zeeshan Ali Khan: No worries, and there's other
people also contributing recently actually
someone contributed more types and stuff.
532
00:40:14,697 --> 00:40:16,507
I think you there was another question from
533
00:40:16,517 --> 00:40:41,297
Tim: there was, and the question was more along the lines of
the social aspect of, do you think that people in the D-Bus
community are, you mentioned, clearly, I should finish my
sentence, they, is the hostility to you as someone coming
in from the outside who didn't know D-Bus when they started?
534
00:40:42,047 --> 00:40:52,362
I suppose now you have established yourself as being, Part of the D-Bus
community at large, but the D-Bus is very important in the Linux world.
535
00:40:52,552 --> 00:40:59,226
It even though it's weird, you've got
these strange paths and okay, fine.
536
00:40:59,226 --> 00:41:02,629
But and
537
00:41:05,249 --> 00:41:18,879
the yeah, so I'm, I am curious about whether or not you
have had any pushback from people who have said it would
have been better if you had just made the C thing better.
538
00:41:21,354 --> 00:41:41,409
Zeeshan Ali Khan: I, I actually never had that because for
C we already had a library like Gile provides GIO, which
already does this in a, and it provides as nice an API as
it possibly could for C, it's like there's a limitation
that you cannot make it much any better than that, I think.
539
00:41:41,789 --> 00:41:44,023
And actually, that was my inspiration.
540
00:41:44,123 --> 00:41:45,163
So I was used to that.
541
00:41:45,313 --> 00:41:50,173
So I wanted something similar in Rust world for yeah, for Rust people.
542
00:41:50,553 --> 00:41:56,183
And then it grew out and I realized that I
could actually provide much better than that.
543
00:41:56,333 --> 00:42:01,733
I think C and C they have reached their limitation and
there's already an API and nobody has asked for it.
544
00:42:01,893 --> 00:42:04,213
Except for one person who was trying it.
545
00:42:04,523 --> 00:42:08,903
to do this, but they were not looking for a better API in C.
546
00:42:09,083 --> 00:42:18,923
What they were trying to look for was trying to introduce Zebus
as a dependency into libraries like GTK a system library in C.
547
00:42:19,183 --> 00:42:27,288
And they were hoping that they can snug it in so that
Rust is a dependency of core GNOME and Linux libraries.
548
00:42:27,598 --> 00:42:30,258
And they were, that's what their main agenda.
549
00:42:30,468 --> 00:42:42,608
Which I agree with, but I was telling them like, there's, it's going
to be hard to get it and make it a C, good C API and then being able
to sell it that, okay this is a better C API than the other one.
550
00:42:42,888 --> 00:42:44,258
And that one cannot be improved.
551
00:42:44,648 --> 00:42:45,458
In the same way.
552
00:42:45,788 --> 00:42:47,288
I think that would be a harder sell.
553
00:42:47,478 --> 00:42:50,878
So I think that this would, this could be a wasted effort.
554
00:42:51,068 --> 00:42:52,088
It would be a big effort.
555
00:42:52,148 --> 00:42:55,208
And if it's wasted, then I really don't want to do it.
556
00:42:55,618 --> 00:42:56,088
There is one.
557
00:42:56,923 --> 00:42:59,828
Tim: do you want to talk a little bit about your thoughts on that?
558
00:43:00,178 --> 00:43:11,268
About Rust and Linux, not in the kernel, but I
suppose in user space or maybe in kernel space
as well, but in all of the utilities and things.
559
00:43:12,658 --> 00:43:29,408
Zeeshan Ali Khan: yeah, so I think it, it also ties into what
you said earlier about you coming from a web background and
I was talking about a lot of people actually come from web
background and other backgrounds, not from this Linux systems
programming background, and that creates a bit of friction.
560
00:43:30,248 --> 00:43:36,928
And the main project where this friction
arises is cargo for us from Rust world.
561
00:43:37,218 --> 00:43:38,898
Like I'm now part of the Rust world.
562
00:43:38,978 --> 00:43:44,528
I'm mostly I really understand the Attraction
of cargo for people from other worlds.
563
00:43:44,728 --> 00:43:50,058
They see cargo as some kind of like
amazing thing that solves all problems.
564
00:43:50,358 --> 00:43:56,358
And actually I don't know if you would be surprised to know
this, but it's not the case for syst Linux systems programmers.
565
00:43:56,718 --> 00:44:04,018
That's actually the project that they point to that's a very
good excuse for C programmers to say, Why should I learn Rust?
566
00:44:04,188 --> 00:44:05,838
It has bad tooling.
567
00:44:06,128 --> 00:44:23,698
It doesn't have good tooling and in a way they're right, because
they're expecting that a very similar tooling to exist for Rust
as well, that they're used to foresee, because when you're a
system programmer especially an open source system programmer,
you have to worry a lot about you provide a package that is very
568
00:44:23,698 --> 00:44:38,613
easy for for distros, for Linux distributions to, to package and
what and give them something they're used to and also to be able
to cross compile in the same way that they're used to and not
what how cargo or there's this thing called I forgot the name.
569
00:44:38,653 --> 00:44:39,013
Cross.
570
00:44:39,013 --> 00:44:39,303
Yeah.
571
00:44:39,593 --> 00:44:40,053
Cross tool.
572
00:44:40,233 --> 00:44:41,123
They're not used to that.
573
00:44:41,313 --> 00:44:42,483
They don't know what that is about.
574
00:44:42,673 --> 00:44:43,903
And where is the my binary?
575
00:44:44,143 --> 00:44:54,473
And especially one aspect of it as installation of because in the
rest of the world, we are more used to of like single binary, like
it compiles to always the same binary as the name of the cargo.
576
00:44:54,773 --> 00:44:55,573
And that's it.
577
00:44:55,673 --> 00:44:56,458
And then you run it.
578
00:44:56,668 --> 00:45:00,113
or you install it and you call it with
the same name, that's the end of it.
579
00:45:00,393 --> 00:45:07,343
But in, in system, Linux system programming, you always
have auxiliary data and that you also have to install.
580
00:45:07,563 --> 00:45:08,863
You don't have just the binary.
581
00:45:09,003 --> 00:45:11,093
And also, the binary, where do you install it?
582
00:45:11,383 --> 00:45:15,503
So all that stuff especially with
installation, that is not there in Cargo.
583
00:45:15,733 --> 00:45:17,243
There is a there are issues.
584
00:45:19,153 --> 00:45:21,273
And they are, they're there for ages.
585
00:45:21,273 --> 00:45:26,373
Nobody really does anything about it because of this friction.
586
00:45:26,413 --> 00:45:32,293
So the cargo people, the people who actually work on cargo and
contribute to it and are into it, they're Rust developers, right?
587
00:45:32,493 --> 00:45:36,023
So they're, they've already bought into
Rust and they're very passionate about it.
588
00:45:36,423 --> 00:45:36,743
And
589
00:45:37,088 --> 00:45:40,648
Tim: So I think what you're saying next is that, they don't.
590
00:45:42,733 --> 00:45:47,793
They don't want to teach, they don't want to change, they
591
00:45:48,093 --> 00:45:52,298
Zeeshan Ali Khan: no, it's not about, Yeah, I
think it's not about being able wanting to teach.
592
00:45:52,298 --> 00:45:56,768
It's more about they want to care about
their own use cases, which is natural.
593
00:45:56,778 --> 00:45:58,818
Like everyone cares about their use cases.
594
00:45:59,278 --> 00:46:02,028
I went Canadian for a bit for some reason.
595
00:46:02,048 --> 00:46:03,178
I'm not a Canadian.
596
00:46:03,968 --> 00:46:06,778
I have family in Canada, but I've never looked there myself.
597
00:46:06,838 --> 00:46:11,728
Anyway they don't naturally they care about their
use cases, which are not Linux systems programming.
598
00:46:12,148 --> 00:46:15,023
But on the other hand, the people who you are teaching.
599
00:46:15,153 --> 00:46:19,063
trying to sell it to Linux system people they wouldn't get into it.
600
00:46:19,073 --> 00:46:20,713
So it's a bit of a chicken and egg problem.
601
00:46:20,983 --> 00:46:25,273
They wouldn't get into it because cargo,
the tooling doesn't offer what they need.
602
00:46:25,543 --> 00:46:29,693
And if they don't get into it, they wouldn't solve
it themselves because they're not interested.
603
00:46:30,343 --> 00:46:31,843
So it's a bit of a chicken and egg problem.
604
00:46:32,263 --> 00:46:38,773
And I've been trying to Actually fighting this war,
actually, trying to get Rust into Linux systems programming.
605
00:46:39,123 --> 00:46:41,783
And that's why one of the reasons I started this project, right?
606
00:46:41,783 --> 00:46:47,283
Now like one year ago, I started this other
project calledbusd, which is the daemon.
607
00:46:47,313 --> 00:46:52,573
I think I should have mentioned this that
D-Bus usually typically involves a broker.
608
00:46:52,783 --> 00:46:57,613
So you don't talk to other processes directly
because it's a bit of a higher level.
609
00:46:58,113 --> 00:47:01,363
Protocol, because you don't have just messages passing between.
610
00:47:01,643 --> 00:47:10,253
You usually have an API and that API means that you have a service
that provides a specific API and and the clients call to that.
611
00:47:10,553 --> 00:47:10,758
And.
612
00:47:11,098 --> 00:47:22,708
Having this broker in the middle takes care of a lot
of things for you and including the fact that if you
are in you have any problem with your service or your
or your client you want to debug it what's going on?
613
00:47:22,718 --> 00:47:24,008
Why am I not getting these messages?
614
00:47:24,208 --> 00:47:27,158
You monitor this broker, and you get your answers.
615
00:47:27,398 --> 00:47:29,598
So this broker solves a lot of problem problems.
616
00:47:29,973 --> 00:47:32,783
And all these brokers currently are written in C.
617
00:47:32,843 --> 00:47:33,483
And they're old.
618
00:47:33,793 --> 00:47:36,973
And I want to change that, and I want to do it in Rust.
619
00:47:37,143 --> 00:47:45,723
And the good thing is that with ZBus, making it Making D-Bus so
easy getting the first version done was a matter of two weekends.
620
00:47:45,973 --> 00:47:49,563
So I, like all the basics all the essentials were already done.
621
00:47:49,693 --> 00:47:51,983
You could talk through it and it would work.
622
00:47:52,333 --> 00:47:56,553
But of course it's a lot more, there's a lot more to it than that.
623
00:47:56,723 --> 00:48:01,523
So that project is part of my effort
to get Rust into systems programming.
624
00:48:01,893 --> 00:48:02,503
World system.
625
00:48:02,648 --> 00:48:03,538
World, linux world.
626
00:48:03,978 --> 00:48:13,368
But it's a bit of a problem because of this cargo
and and the thing that is used in the sea world right
now is called Mason, which is quite sort of new.
627
00:48:13,608 --> 00:48:15,098
It's Python based.
628
00:48:15,098 --> 00:48:20,758
It is in the sense that it's implemented in
Python and it's, it's the syntax is very Python-ish.
629
00:48:21,028 --> 00:48:22,578
It's like a configuration thing.
630
00:48:22,838 --> 00:48:29,638
I guess viewers might have heard of something called CMake
or AutoTools, which are famous for being notoriously bad.
631
00:48:30,028 --> 00:48:30,618
But nowadays
632
00:48:30,658 --> 00:48:39,198
Tim: I, I actually went to a talk at LinuxConfAU in January, 2020.
633
00:48:40,458 --> 00:48:41,178
Like just.
634
00:48:41,543 --> 00:48:44,873
as the gates were closing.
635
00:48:45,838 --> 00:48:46,368
Zeeshan Ali Khan: right?
636
00:48:47,453 --> 00:48:50,363
Tim: and he was there presenting Mason.
637
00:48:50,813 --> 00:48:51,393
Mason?
638
00:48:51,528 --> 00:48:52,163
Zeeshan Ali Khan: mean, Yussi.
639
00:48:52,618 --> 00:48:52,948
Tim: Yeah.
640
00:48:53,158 --> 00:48:54,318
He's, yeah, I was about to say
641
00:48:54,463 --> 00:48:55,588
Zeeshan Ali Khan: He's a good friend of mine, yeah.
642
00:48:55,888 --> 00:48:56,358
Tim: Oh good.
643
00:48:56,493 --> 00:48:57,723
Zeeshan Ali Khan: Yeah, he's a friend of mine.
644
00:48:58,418 --> 00:49:09,958
Tim: and he also, he gave a wonderful talk, very
jet lagged about, about font kerning and and
shaping the Euler curve, which is this sort of.
645
00:49:10,393 --> 00:49:11,833
Perfect spiral.
646
00:49:12,013 --> 00:49:18,713
Anyway, sorry, the, so the, they, so in Linux.
647
00:49:19,088 --> 00:49:21,058
There's a Linux distro.
648
00:49:21,378 --> 00:49:35,708
So the build system is now preferred is Mason, which is very
different in its approach than Cargo, sorry, Rust project.
649
00:49:36,398 --> 00:49:39,368
Mason actually does understand how to build Rust.
650
00:49:39,398 --> 00:49:45,408
It can invoke Rust C, but then you give up on the rest of Cargo.
651
00:49:45,528 --> 00:49:48,113
You don't have the whole of crates
652
00:49:48,413 --> 00:49:49,093
Zeeshan Ali Khan: dependency downloads.
653
00:49:49,093 --> 00:49:52,813
Yeah that's very true.
654
00:49:52,913 --> 00:49:57,963
And the main thing is that what the idea
is that he doesn't want to, talk to Cargo.
655
00:49:58,003 --> 00:49:59,313
He wants to talk to Rust C.
656
00:49:59,893 --> 00:50:02,083
Because that's his approach for all the projects.
657
00:50:02,093 --> 00:50:05,103
So I see his his problem with Cargo.
658
00:50:05,463 --> 00:50:10,763
And and the problem is that Rust people
are like, no, but Cargo is the tool to use.
659
00:50:10,773 --> 00:50:11,643
Like, why don't you use Cargo?
660
00:50:11,673 --> 00:50:16,323
No, I want to talk to the compiler because
my tool is on the same level as Cargo.
661
00:50:16,323 --> 00:50:18,293
So why should I be talking to Cargo?
662
00:50:18,995 --> 00:50:21,465
There is now there's now some momentum in there.
663
00:50:21,465 --> 00:50:25,585
There's one person, Javier, he has done already some work.
664
00:50:25,775 --> 00:50:28,835
You already can have cargo like Crystal.
665
00:50:28,835 --> 00:50:31,515
io dependencies in your Rust projects.
666
00:50:31,515 --> 00:50:36,275
It's already possible, but there is
some Some work you need to do for that.
667
00:50:36,345 --> 00:50:48,895
So you need to write these files I think they're called RAP
files if I'm not mistaken I could be wrong about the name
But you have to for each of your dependency you have to
write that and tell Mason with that what is my dependency?
668
00:50:48,895 --> 00:50:50,535
Where do you get it and all that stuff?
669
00:50:51,425 --> 00:51:03,440
But he's now working on making that obsolete so they can
be automatically generated for all your dependencies And
then after that is done, you there is, this excuse is
gone for not using Rust in systems programming world.
670
00:51:03,772 --> 00:51:06,062
For application, it's already not the case.
671
00:51:06,112 --> 00:51:11,642
There is projects in GNOME world a
lot of actually new apps in, in GNOME.
672
00:51:11,977 --> 00:51:21,927
They are in done in Rust, so because the new blood, they want
to use some, a new modern programming language that is out there
that they don't want to use, see that is going away, hopefully.
673
00:51:22,427 --> 00:51:23,307
So yeah it's there.
674
00:51:23,317 --> 00:51:23,827
It's coming.
675
00:51:24,197 --> 00:51:25,347
And I'm talking to people, right?
676
00:51:25,387 --> 00:51:29,382
I'm, friends with Leonard the system D guy, and friends with UC.
677
00:51:29,482 --> 00:51:32,362
And so I'm trying my best, but it's a bit hard.
678
00:51:32,382 --> 00:51:41,422
It's especially if you have developed a huge
project, very successful, huge project, it has a
huge momentum like system D moving towards Rust.
679
00:51:41,702 --> 00:51:42,752
It's not an easy task.
680
00:51:42,782 --> 00:51:46,472
So you want everything to be in place before you start that project.
681
00:51:46,652 --> 00:51:47,462
That whole project.
682
00:51:47,812 --> 00:51:47,942
So
683
00:51:48,112 --> 00:51:49,052
Tim: it here, folks.
684
00:51:49,062 --> 00:51:51,482
They are rewriting system D and Rust.
685
00:51:51,532 --> 00:51:52,212
Linut.
686
00:51:52,422 --> 00:51:59,852
Zeeshan Ali Khan: are many folks who have tried that,
and I think the only time it will happen is that when
Lennart says, okay, enough is enough let's do it.
687
00:52:00,102 --> 00:52:04,792
And the thing is, Lennart is very, is an extremely pragmatic guy.
688
00:52:05,092 --> 00:52:10,707
He he has his points, and it will take time, but I
think eventually I'm hopeful that it will happen.
689
00:52:10,897 --> 00:52:12,147
He hasn't said no ever.
690
00:52:12,497 --> 00:52:16,437
Whenever I talk to him about Rust, coding
in Rust, he has never, ever said no.
691
00:52:16,627 --> 00:52:19,437
He has always talked about problems, why he's not doing it.
692
00:52:19,887 --> 00:52:21,857
So there is, that's a very good sign.
693
00:52:22,517 --> 00:52:23,507
Eventually it will happen.
694
00:52:24,687 --> 00:52:37,597
Tim: I look, I think that the things that are
so fundamental like system D should no longer
be written in languages that are memory unsafe.
695
00:52:39,217 --> 00:52:40,127
Zeeshan Ali Khan: Yeah, for sure.
696
00:52:40,577 --> 00:52:42,757
Tim: It's too dangerous.
697
00:52:43,177 --> 00:52:43,827
We,
698
00:52:44,127 --> 00:52:44,947
Zeeshan Ali Khan: Lennart agrees.
699
00:52:45,007 --> 00:52:45,737
He agrees to that.
700
00:52:45,767 --> 00:52:47,787
Like it's on theoretical level.
701
00:52:47,787 --> 00:52:48,577
He does agree.
702
00:52:48,627 --> 00:52:50,047
So yeah, you're right.
703
00:52:51,177 --> 00:52:59,117
Tim: Or you probably had a few questions or that you
would like to talk about and I don't think I've given
you the opportunity to ask or to add to the conversation.
704
00:53:00,447 --> 00:53:00,997
Zeeshan Ali Khan: No worries.
705
00:53:01,047 --> 00:53:06,207
What I could share it's interesting because,
as like I came from the C world, right?
706
00:53:06,207 --> 00:53:10,162
So for me, Everything was less unsafe, right?
707
00:53:10,262 --> 00:53:20,562
I was just not used to this way of always thinking in
terms of safety, but when I started doing Rust more
and more, I stopped thinking in those terms, right?
708
00:53:20,562 --> 00:53:22,302
I was more thinking in terms of how do you do it?
709
00:53:22,492 --> 00:53:26,502
And I would never, I was never really
thinking how to do it in unsafe Rust.
710
00:53:26,702 --> 00:53:29,652
Even if in some cases it would be fine.
711
00:53:30,292 --> 00:53:42,144
So I feel like I lost a skill because in, in Rust,
you have that opportunity to still do like possibly
unsafe things, but it doesn't have to be unsafe, right?
712
00:53:42,144 --> 00:53:45,964
Like just because you're saying unsafe doesn't really mean that.
713
00:53:46,404 --> 00:53:52,614
And there's a lot of times when I had later thought
about my code and I was like, why did I do it this way?
714
00:53:52,614 --> 00:53:53,694
So inefficient.
715
00:53:54,044 --> 00:53:55,704
So this was not needed.
716
00:53:56,344 --> 00:54:04,874
All I had to do was use some unsafe API or just even
myself do some pointer Stuff and then I could do it.
717
00:54:05,064 --> 00:54:17,154
And also because of that when I have to inter interface
each time with any c which I rarely do nowadays, but
each time I have to do it with the FFII I'm bit lost.
718
00:54:17,609 --> 00:54:31,929
I'm trying to understand how the C call is working, even for example,
even with libc recently, or windows sys, I was doing something with
it, and it took me half a day to understand how to make that call.
719
00:54:31,939 --> 00:54:37,509
It was just one function call with four parameters, and I
just couldn't figure it out, like, how do I do it safely?
720
00:54:38,239 --> 00:54:40,559
So that was a bit of a skill.
721
00:54:40,579 --> 00:54:41,969
I feel like I lost it.
722
00:54:42,359 --> 00:54:47,247
And I regret that, and I want to Get that back a bit.
723
00:54:47,547 --> 00:54:50,607
Because it, it has its advantages, those skills.
724
00:54:50,927 --> 00:54:54,527
So that's something I would say to anyone who comes from C background.
725
00:54:54,907 --> 00:54:58,367
If if you're to start writing Rust, just be careful.
726
00:54:58,577 --> 00:55:00,017
Don't lose that completely.
727
00:55:00,017 --> 00:55:01,647
Don't be afraid of unsafe.
728
00:55:02,037 --> 00:55:10,402
I know I read it in the book in the beginning, but I feel like I
am a bit scared of unsafe still because of how Rust works, right?
729
00:55:10,402 --> 00:55:11,572
Like you become scared of it.
730
00:55:11,902 --> 00:55:13,802
Just don't be scared of it.
731
00:55:13,852 --> 00:55:14,692
Sometimes it's okay.
732
00:55:14,792 --> 00:55:15,602
Just do unsafe.
733
00:55:15,962 --> 00:55:16,542
It will be okay.
734
00:55:17,797 --> 00:55:26,427
Tim: I think of the word the keyword unsafe as
meaning I am taking responsibility for the safety.
735
00:55:27,287 --> 00:55:42,420
Not that what you're doing is inherently unsafe, although yeah,
and maybe it comes back to the other point that you made earlier
that sometimes you think things that are very difficult actually
turn out to be quite easy or at least easier than you expected.
736
00:55:42,965 --> 00:55:51,173
And on the other side, you have, things that look
easy, like doing everything safely or using safe APIs.
737
00:55:51,543 --> 00:55:53,333
It turns out to be much, much harder.
738
00:55:53,413 --> 00:56:10,913
And so if you do have the experience of manipulating pointers or
doing lots of pointer arithmetic, and you understand represent
internal representations and Indian ness and lots of other
you have lots of knowledge about systems programming, then.
739
00:56:11,933 --> 00:56:17,363
You have tools available inside of Rust too,
and so you should feel free to use them.
740
00:56:18,313 --> 00:56:18,643
Zeeshan Ali Khan: Yeah.
741
00:56:19,123 --> 00:56:26,003
And I actually, I just got, I just remembered that
you are the author of the book that talks about it.
742
00:56:26,343 --> 00:56:27,953
I think you mentioned right in your book.
743
00:56:27,953 --> 00:56:28,813
It was a long time ago.
744
00:56:28,813 --> 00:56:29,203
I read it.
745
00:56:29,203 --> 00:56:29,893
I don't remember.
746
00:56:29,893 --> 00:56:33,963
But I think you talked about how to see unsafe and how to use unsafe.
747
00:56:34,013 --> 00:56:34,243
And
748
00:56:34,543 --> 00:56:35,343
Tim: Yeah I did.
749
00:56:35,343 --> 00:56:39,853
So I I wrote Rust in Action the book with the with the boxer
750
00:56:40,963 --> 00:56:46,513
Zeeshan Ali Khan: yeah, I know that you have written that book,
but I just remembered that you talk about unsafe bits in there.
751
00:56:46,813 --> 00:56:49,403
Tim: Yeah I actually I received a lot of criticism.
752
00:56:49,773 --> 00:56:50,303
Zeeshan Ali Khan: Oh, really?
753
00:56:51,433 --> 00:56:53,753
Tim: From anonymous reviewers.
754
00:56:54,433 --> 00:57:03,693
So these are people, when you write a technical book, the publisher
will send your book around to people to provide anonymous feedback.
755
00:57:03,693 --> 00:57:09,043
And I got some comments saying, Oh, you shouldn't
introduce unsafe for a book and for beginners.
756
00:57:10,333 --> 00:57:16,413
I'm like no, it's part of the language and
don't be scared of, it's just software.
757
00:57:17,758 --> 00:57:24,038
Zeeshan Ali Khan: Guess maybe they came from a different
background where they didn't need this ever and they thought
like they will never need it and they probably are right.
758
00:57:24,583 --> 00:57:24,863
Tim: yeah.
759
00:57:24,863 --> 00:57:33,333
And I, and the other thing is I thought it was fun to say
let's try mem transmute and let's treat a floating point.
760
00:57:34,203 --> 00:57:42,708
It's like an unsigned integer and it's just bits and we can, yeah
but if the time has come where we really need to wrap up the call,
761
00:57:43,008 --> 00:57:44,948
Zeeshan Ali Khan: yeah, it's good.
762
00:57:44,978 --> 00:57:45,738
It's so interesting.
763
00:57:45,778 --> 00:57:47,148
I don't want to wrap it up, but
764
00:57:48,963 --> 00:57:49,993
Tim: We just got to the good bit.
765
00:57:50,363 --> 00:57:54,363
Maybe we will schedule another call to talk about
766
00:57:54,438 --> 00:57:55,418
Zeeshan Ali Khan: sure, I'm here.
767
00:57:56,248 --> 00:57:56,558
Yeah,
768
00:57:57,363 --> 00:57:59,693
Tim: In a few months time, I'll give you a break.
769
00:57:59,813 --> 00:58:01,803
Enjoy your time off.
770
00:58:01,863 --> 00:58:05,393
I hope everything is well with you and your family.
771
00:58:05,673 --> 00:58:07,183
It's been a real pleasure to talk.
772
00:58:07,193 --> 00:58:11,823
Thank you very much for supporting me on on this new podcast idea.
773
00:58:12,083 --> 00:58:13,553
It's been a pleasure.
774
00:58:13,843 --> 00:58:17,063
Zeeshan and I met in Berlin.
775
00:58:17,513 --> 00:58:18,548
When did we first meet?
776
00:58:18,848 --> 00:58:20,238
Zeeshan Ali Khan: That was no, that was second time.
777
00:58:20,398 --> 00:58:22,118
I think we met in the rest.
778
00:58:22,208 --> 00:58:23,048
EuroRust, I think.
779
00:58:23,373 --> 00:58:24,043
Tim: Oh, EuroRust.
780
00:58:24,063 --> 00:58:24,423
Okay.
781
00:58:24,828 --> 00:58:25,118
Zeeshan Ali Khan: Yeah.
782
00:58:25,123 --> 00:58:29,423
Yeah, we were hanging out in the I don't even
remember which city it was, but Brussels, I think.
783
00:58:29,723 --> 00:58:30,413
Tim: It was Brussels.
784
00:58:30,413 --> 00:58:30,493
Yeah.
785
00:58:30,643 --> 00:58:30,703
Zeeshan Ali Khan: it?
786
00:58:31,143 --> 00:58:31,383
Yeah.
787
00:58:31,543 --> 00:58:33,013
Tim: Oh yeah, Brussels, we had lunch.
788
00:58:34,123 --> 00:58:36,773
Zeeshan Ali Khan: We had breakfast but I think we had lunch too.
789
00:58:37,223 --> 00:58:37,703
Anyway, yeah,
790
00:58:38,003 --> 00:58:38,663
Tim: Yeah, okay.
791
00:58:38,843 --> 00:58:39,263
Okay.
792
00:58:39,293 --> 00:58:39,993
You have a nice day.
793
00:58:40,393 --> 00:58:41,413
I am going to go to bed.
794
00:58:41,463 --> 00:58:42,943
I will see you online.
795
00:58:42,963 --> 00:58:43,273
Take care.
796
00:58:43,273 --> 00:58:43,533
Bye.
797
00:58:44,023 --> 00:58:44,503
Zeeshan Ali Khan: Yeah.
798
00:58:44,563 --> 00:58:45,203
Thanks so much, Tim.
00:00:02,428 --> 00:00:09,788
Tim: When we started recording this episode, I thought we'd
be talking about inter process communication and parallelism.
2
00:00:10,068 --> 00:00:17,948
What ended up happening was a huge discussion about
Linux and Rust and C and the future of software.
3
00:00:18,348 --> 00:00:20,498
It's a long episode, but I think you're going to enjoy it.
4
00:00:23,294 --> 00:00:25,304
Welcome to Compose!
5
00:00:25,424 --> 00:00:38,004
It is our third episode and I have the author of a crate, in fact a
couple of crates, who has the best logo that I think I've ever seen.
6
00:00:38,994 --> 00:00:39,164
Zeeshan Ali Khan: Thank you!
7
00:00:39,164 --> 00:00:47,684
Tim: Do you to describe the zbus and the animated
gif or gif that greets people on the readme?
8
00:00:48,279 --> 00:00:50,039
There must be a story behind that.
9
00:00:50,039 --> 00:00:50,869
Zeeshan Ali Khan: Sort of, yeah.
10
00:00:52,779 --> 00:00:55,889
So there's a logo and then there is the how do I call it?
11
00:00:56,289 --> 00:00:57,539
It's an illustration, actually.
12
00:00:57,539 --> 00:00:58,419
Yeah, that's what you call it.
13
00:00:59,729 --> 00:01:02,149
And yeah, this is done by Jakob Steiner.
14
00:01:02,784 --> 00:01:03,784
A great artist.
15
00:01:04,114 --> 00:01:05,024
He works on GNOME.
16
00:01:05,094 --> 00:01:05,844
He's a designer.
17
00:01:06,984 --> 00:01:12,524
And the logo is done by Tobias
Bernhardt, who is another GNOME designer.
18
00:01:12,734 --> 00:01:15,654
So as you can see, I'm very well connected in the GNOME world.
19
00:01:16,954 --> 00:01:24,094
But the library itself, I would describe it as just,
crate that makes you helps you talk D-Bus, right?
20
00:01:24,114 --> 00:01:26,494
It's an inter process communication protocol.
21
00:01:27,026 --> 00:01:30,706
and a lot of system system services on Linux.
22
00:01:30,936 --> 00:01:31,666
They use that.
23
00:01:31,946 --> 00:01:37,306
, so if you want to talk to, let's say systemd or
network manager and modem manager, all of those.
24
00:01:37,636 --> 00:01:38,796
That's where you need D-Bus.
25
00:01:39,126 --> 00:01:43,556
And when you, and that's how most people come to this library.
26
00:01:43,842 --> 00:01:46,302
They, all of a sudden, for any reason, they need that.
27
00:01:46,592 --> 00:01:49,682
And they look around and they find a few libraries and Zbus.
28
00:01:50,142 --> 00:01:57,672
I would say myself, it's the best one that you can find because a
lot of people are porting away from the old one that already existed.
29
00:01:58,032 --> 00:01:59,472
That we will talk about later as well.
30
00:02:00,022 --> 00:02:01,352
But yeah, that's the description.
31
00:02:01,652 --> 00:02:22,422
Tim: So even let's say I'm, is it possible with ZBus,
which is your library, to, is there a Py03 wrapper around
ZBus to talk the D-Bus protocol from, let's say Python
or has that been, is, are you, is the library that you
32
00:02:22,597 --> 00:02:23,147
Zeeshan Ali Khan: I don't think
33
00:02:23,447 --> 00:02:25,622
Tim: easier to use than, okay.
34
00:02:26,222 --> 00:02:26,932
Zeeshan Ali Khan: It is, yeah.
35
00:02:27,092 --> 00:02:33,272
For me one of the greatest compliments was when one of my
friends he was not interested in Rust, actually, for a long time.
36
00:02:33,712 --> 00:02:45,622
And then when he did do Rust, he was doing some D-Bus,
and he used zbus, and he said, oh, this is the reason
I would love Rust now, and this is the reason I want
to do all my D-Bus stuff in Rust because of zbus.
37
00:02:45,832 --> 00:02:49,102
So that I really felt so good about that when that happened.
38
00:02:49,332 --> 00:02:59,862
So yeah it's not there, I don't know of any wrappers for Python or
anything, but I'm pretty sure that they can be made and I think they
would be much better off than the C versions the wrapper for C APIs.
39
00:03:00,322 --> 00:03:00,387
Yeah.
40
00:03:00,582 --> 00:03:10,942
Tim: Correct me if I'm wrong or if I'm mistaken, you have
created a pure Rust implementation of the D-Bus protocol.
41
00:03:11,042 --> 00:03:14,172
You have not wrapped, let's say, I
42
00:03:14,757 --> 00:03:15,087
Zeeshan Ali Khan: Yeah.
43
00:03:15,432 --> 00:03:19,222
Tim: don't know, is there a lib D-Bus
that you then created a library over?
44
00:03:19,692 --> 00:03:19,952
Yeah.
45
00:03:20,152 --> 00:03:20,592
So that,
46
00:03:21,597 --> 00:03:24,987
Zeeshan Ali Khan: I can tell you the story if
you want to here , should I tell you the story?
47
00:03:25,172 --> 00:03:25,772
Tim: please do, please.
48
00:03:25,772 --> 00:03:26,012
Yeah.
49
00:03:26,032 --> 00:03:26,282
Love.
50
00:03:26,342 --> 00:03:26,572
I'd
51
00:03:26,597 --> 00:03:27,737
Zeeshan Ali Khan: Alright, let's do the story.
52
00:03:27,957 --> 00:03:28,767
, the origin story.
53
00:03:28,877 --> 00:03:30,977
My, my background is in systems programming, right?
54
00:03:30,977 --> 00:03:36,297
Because of that, I actually maintained a systems
a component called Geo Clue, which runs on Linux.
55
00:03:36,387 --> 00:03:41,827
A modern Linux machine has geo clue most of them
have which the task of that service is simple.
56
00:03:42,097 --> 00:03:43,867
Find your location by any means.
57
00:03:44,407 --> 00:03:51,737
You can, and I wrote the re-implementation of it and the
main, feature of the re implementation was privacy in mind.
58
00:03:51,977 --> 00:03:59,767
So that users have a choice to, to decide how much, which accuracy and
if they want a relocation services at all in the first place, even.
59
00:04:00,207 --> 00:04:01,287
And that was in C.
60
00:04:01,567 --> 00:04:08,127
So when I got into Rust in around 2016, I I wanted to
rewrite that in Rust and and that's a Diva service.
61
00:04:08,377 --> 00:04:10,077
The first thing I need is a D-Bus library.
62
00:04:10,187 --> 00:04:12,767
And there was an existing library called D-Bus.
63
00:04:13,077 --> 00:04:14,867
Full name is D-Bus RS on the repo.
64
00:04:15,107 --> 00:04:17,037
But and the create name is D-Bus.
65
00:04:17,447 --> 00:04:19,717
And so of course that's what you find, right?
66
00:04:19,797 --> 00:04:22,032
You search for it, you search for D-Bus, you find D-Bus.
67
00:04:22,482 --> 00:04:28,882
And it's still the first hit like zbus cannot be the first
hit because it's the exact match They have squatted the name.
68
00:04:29,402 --> 00:04:33,952
And I tried to try to use it And this is the
time when I was really new to Rust right?
69
00:04:34,162 --> 00:04:50,159
So I have a lot of trouble with all those types that were
being mapped to C types, and they were getting really complex,
actually, and I was having a lot of trouble, and I was at
this hackfest, and I said to my friend, Sebastian hey how
about I rewrite this in Rust and make a pure implementation.
70
00:04:50,479 --> 00:04:52,329
I was really joking at first.
71
00:04:52,499 --> 00:04:53,779
And he said, yeah, why not?
72
00:04:54,179 --> 00:04:55,339
And I was like I'm here.
73
00:04:55,369 --> 00:04:56,139
I'm at a hackfest.
74
00:04:56,179 --> 00:04:56,699
Let's try it.
75
00:04:56,749 --> 00:05:00,619
And I started writing, I'm a systems
guy, so I started from the very scratch.
76
00:05:00,619 --> 00:05:03,129
From the bottom I first worked on this.
77
00:05:03,524 --> 00:05:07,594
thing called zvariant, which is the encoding
part of it, with no transport or anything.
78
00:05:07,924 --> 00:05:11,054
And I did something in three days that kind of worked.
79
00:05:11,054 --> 00:05:14,740
I could create a specific method that could be called.
80
00:05:14,740 --> 00:05:16,660
And I did some very basic socket, right?
81
00:05:16,765 --> 00:05:17,725
Just to test it out.
82
00:05:17,955 --> 00:05:21,825
And I got a response from the from the other side,
which was correct, and I was able to decode it.
83
00:05:21,985 --> 00:05:24,265
That was like, actually, this is not that hard.
84
00:05:24,645 --> 00:05:26,725
And then that's how it started.
85
00:05:27,065 --> 00:05:27,895
This whole project.
86
00:05:28,445 --> 00:05:29,575
So it is a pure [Rust project].
87
00:05:29,600 --> 00:05:30,020
Tim: Wow.
88
00:05:30,230 --> 00:05:30,470
Yeah.
89
00:05:30,470 --> 00:05:33,330
So the variant it's GVariant isn't it?
90
00:05:33,370 --> 00:05:35,580
And that is part of the GNOME project.
91
00:05:36,505 --> 00:05:36,915
Zeeshan Ali Khan: Yeah.
92
00:05:36,955 --> 00:05:38,615
So the, about, about GVariant
93
00:05:38,675 --> 00:05:43,975
D-Bus the wire protocol, the encoding
of it that had some limitations, right?
94
00:05:43,975 --> 00:05:45,745
It's, it started in 2003.
95
00:05:46,145 --> 00:05:50,025
So it's it's been more than two decades of this whole thing existing.
96
00:05:50,515 --> 00:05:56,215
And this one person Allison Lortie she decided
that she wanted something a bit better.
97
00:05:56,435 --> 00:06:07,055
So she wrote a new encoding called GVariant, which is super duper,
like D-Bus was already pretty efficient protocol, but she made it
even more efficient efficient and added some of the missing features.
98
00:06:07,515 --> 00:06:11,415
And the idea was that it will become D-Bus
99
00:06:11,415 --> 00:06:11,430
2.0.
100
00:06:11,680 --> 00:06:13,480
It wasn't supposed to be something different.
101
00:06:13,840 --> 00:06:18,220
But somehow, historically, all those things, moving parts, happening.
102
00:06:18,460 --> 00:06:21,900
She was a glib contributor, so she added this support in glib.
103
00:06:22,210 --> 00:06:37,620
D-Bus to this day, when it, when you need to do any D-Bus stuff
with glib glib api You have to talk this GVariant that the
API is designed for this new, different specification slightly
different than D-Bus and it's not compatible with it, right?
104
00:06:37,980 --> 00:06:44,300
And it internally translates that to D-Bus when it's,
when it actually sends us off and also the vice versa.
105
00:06:44,310 --> 00:06:45,890
So it's a bit slightly inefficient.
106
00:06:45,920 --> 00:06:50,120
It's not as inefficient as it sounds, but it,
there is a bit of, Conversion going on there.
107
00:06:50,680 --> 00:06:56,970
So that thing became GVariant and that is
now separate from the D-Bus, specification.
108
00:06:57,240 --> 00:07:01,590
And I was, when I started this whole
thing, I was not just new at D Rust.
109
00:07:01,670 --> 00:07:03,190
I was also new to,
110
00:07:03,430 --> 00:07:04,750
D-Bus, the protocol.
111
00:07:04,940 --> 00:07:06,690
I had used D-Bus a lot.
112
00:07:06,920 --> 00:07:08,190
And I've implemented services.
113
00:07:08,190 --> 00:07:12,920
I had done a lot of things with D-Bus before,
but I had no idea about the protocol itself.
114
00:07:13,130 --> 00:07:16,770
So I had, I didn't know that GVariant is completely incompatible.
115
00:07:16,810 --> 00:07:19,410
So when I started, that's why I named it zvariant.
116
00:07:19,620 --> 00:07:22,080
And I said, Oh, I'll just support both.
117
00:07:22,240 --> 00:07:23,270
And that would be easy.
118
00:07:23,600 --> 00:07:28,190
Tim: If we didn't say to ourselves that it was
going to be easy, we wouldn't start, right?
119
00:07:28,500 --> 00:07:43,715
The if we knew as much as possible, about how difficult things
would be that we, the knowledge that we gained after being part of a
project for a few years, then you probably would never have started.
120
00:07:44,245 --> 00:07:45,495
And so this literally
121
00:07:45,525 --> 00:07:45,705
Zeeshan Ali Khan: That's
122
00:07:45,805 --> 00:07:47,385
Tim: At a three day hack fest.
123
00:07:47,695 --> 00:08:02,095
And now eight years later, you are the maintainer probably of the
most performant, most easy to use IPC system in the Linux ecosystem.
124
00:08:03,705 --> 00:08:04,515
Zeeshan Ali Khan: Sort of.
125
00:08:04,565 --> 00:08:09,705
The g the there, the other bindings, the C bindings,
they, I would say they're more efficient at the moment.
126
00:08:09,945 --> 00:08:11,055
I'm actually working on that.
127
00:08:11,315 --> 00:08:15,120
So I found the hotspot the bottleneck of my performance.
128
00:08:15,460 --> 00:08:17,590
All the CPU usage, basically.
129
00:08:17,940 --> 00:08:24,140
And I have a pretty, I'm pretty confident that I can make
it more efficient than the C implementations out there.
130
00:08:24,630 --> 00:08:26,420
So yeah, I'm currently working on that actually.
131
00:08:26,790 --> 00:08:27,780
So hopefully it will happen.
132
00:08:27,780 --> 00:08:30,370
But at the moment, it's not the case, I would say.
133
00:08:30,660 --> 00:08:42,280
But they are I would say almost as efficient and they
are that's one thing is for sure, they are a lot more
easier to use, like Zbus is a lot more easier to use
than the C libraries or the bindings to the C libraries.
134
00:08:42,280 --> 00:08:49,230
And that was the idea, so I started with making
it possible that it's as easy as possible.
135
00:08:49,630 --> 00:08:50,680
That was the whole idea.
136
00:08:51,290 --> 00:08:51,580
Yeah.
137
00:08:52,980 --> 00:09:06,228
And about starting things like when you start things because
they're easy that's a really cool thing that it happens that
we think it's easy but there's also the other way around like
sometimes there's a thing and you think it's this is going to be
138
00:09:06,228 --> 00:09:17,578
super difficult And you don't start it you're procrastinating for
years or months or whatever and then you start it and then after a
few days You're like, oh, I'm almost done So it wasn't that hard.
139
00:09:17,578 --> 00:09:18,968
So there are like two sides of it.
140
00:09:19,308 --> 00:09:33,465
Tim: Yeah, it's, and actually I am curious about your
impressions about the phrase systems programmer and the Rust
programming language, because I don't have a systems background.
141
00:09:33,644 --> 00:09:37,216
I was, I have a data science background actually.
142
00:09:37,216 --> 00:09:40,788
And so that was, that means Python and the.
143
00:09:43,138 --> 00:09:51,068
And I think that over the last couple of years, has
outgrown the phrase systems programming language.
144
00:09:51,178 --> 00:09:52,953
Like it's become a much more general purpose.
145
00:09:53,003 --> 00:10:05,848
But I actually think that there are a lot of people
who are intimidated, I don't know, by like low
level systems details unnecessarily, but actually.
146
00:10:07,538 --> 00:10:20,638
If you spent a couple of hours, maybe you would find that
actually it's much more approachable or accessible than
you originally expected that you don't need a PhD to start.
147
00:10:22,978 --> 00:10:24,738
Zeeshan Ali Khan: Yeah, that's that's certainly true.
148
00:10:24,838 --> 00:10:35,708
It's it's actually funny to me because what I have noticed
is that there's a lot more, there are a lot more people from
web and from cloud and all those backgrounds than they are
149
00:10:35,708 --> 00:10:44,283
from systems program programming background in Rust, which
is very surprising to me because for me the main thing about
Rust was that it's, It's a systems programming language.
150
00:10:44,508 --> 00:10:45,688
That's what it's designed for.
151
00:10:46,318 --> 00:10:48,198
So where are all the systems programmers?
152
00:10:48,548 --> 00:10:50,588
So I rarely meet actually systems programmers.
153
00:10:50,588 --> 00:10:52,648
I mostly meet people from other backgrounds.
154
00:10:53,108 --> 00:10:56,698
And and I was very surprised also,
like it's, it went into crypto world.
155
00:10:56,758 --> 00:10:59,828
It's like most of the jobs that you see are from crypto world.
156
00:11:00,148 --> 00:11:02,528
And you're like, this is not what it was designed for.
157
00:11:03,998 --> 00:11:04,348
So
158
00:11:04,738 --> 00:11:04,948
Tim: Yeah.
159
00:11:04,948 --> 00:11:09,098
And actually probably C is a lot easier to write a lot of code.
160
00:11:09,598 --> 00:11:10,418
cryptographic primitives.
161
00:11:10,438 --> 00:11:16,558
You've got more access to constant time operations,
you have at least easier access to intrinsics,
162
00:11:17,398 --> 00:11:18,988
Zeeshan Ali Khan: yeah,
163
00:11:19,478 --> 00:11:24,278
Tim: gets out of your way a little bit, whereas
the Rust compiler is much more opinionated.
164
00:11:26,048 --> 00:11:38,348
Zeeshan Ali Khan: I actually wanted to discuss that a
bit later about coming from C background, but the first
thing about what you asked about systems programming,
um, Defining systems programming is very difficult.
165
00:11:38,398 --> 00:11:43,869
I have learned that a bit the hard way because I've been
interviewing people to, for a systems programming job.
166
00:11:44,229 --> 00:11:47,569
And a lot of time they come and they say,
yeah, I have systems programming background.
167
00:11:47,679 --> 00:11:51,419
Then I ask, and it's completely different from what I was expecting.
168
00:11:51,679 --> 00:11:52,749
And they're not lying there.
169
00:11:52,759 --> 00:11:55,559
They do have systems programming from what they understand it.
170
00:11:56,059 --> 00:11:59,692
The main thing is for me is that the system, right?
171
00:11:59,692 --> 00:12:06,102
The operating system, you have some idea of how the
components on your systems are talking to each other.
172
00:12:06,162 --> 00:12:07,492
What are they doing, basically?
173
00:12:07,808 --> 00:12:14,958
And A lot of times these people come for interviews, they are
when I ask them like, Okay, so system D what IPC they talk, right?
174
00:12:15,368 --> 00:12:17,038
And they're like, I don't know.
175
00:12:17,318 --> 00:12:30,963
I'm like, but that's how can yeah, there's very different definitions
and I can't, Put my finger on one specific one, but for me from
my background, it's like knowing the systems services how they
176
00:12:30,963 --> 00:12:40,497
work essentially and all the essential features of them, like what
do they do for example, if there's a service, for example, and
it's, you don't want them to run, be running all the time, right?
177
00:12:40,497 --> 00:12:45,217
If they're not being used, you want them, the
process not to be running, but how would it work?
178
00:12:45,217 --> 00:12:47,887
What Starts the process when there is a call for them.
179
00:12:48,227 --> 00:12:49,717
And what is the process for that?
180
00:12:49,777 --> 00:12:56,947
And the answer is, of course Socket activation, which systemd's,
the systemd's feature but Most people wouldn't know about that.
181
00:12:57,107 --> 00:13:05,615
So for me that's systems programming and also Using
those libraries and those services like to have
some idea of how to use them when you need to.
182
00:13:05,895 --> 00:13:07,895
That's also systems programming skill, right?
183
00:13:08,255 --> 00:13:13,215
So that's how I would very vaguely
describe what I mean by system programming.
184
00:13:13,215 --> 00:13:15,655
But of course, definitions vary.
185
00:13:16,395 --> 00:13:16,835
Tim: They do.
186
00:13:16,875 --> 00:13:24,565
And see, for example, my definition of
systems programming would be something, would
187
00:13:25,565 --> 00:13:27,175
be something closer to middleware.
188
00:13:27,175 --> 00:13:29,685
So
189
00:13:31,945 --> 00:13:45,030
systems programming, involves writing software for other
programs or And at this point, there are two questions
that have been shouting at me, in the back of my mind.
190
00:13:45,030 --> 00:13:46,950
One is we need to introduce you.
191
00:13:46,960 --> 00:13:47,340
Who are you?
192
00:13:47,340 --> 00:13:50,780
And why are you talking to us?
193
00:13:50,780 --> 00:13:53,485
It's now nearly, we're over a quarter of an hour into the interview.
194
00:13:54,128 --> 00:13:58,878
And I haven't given you the courtesy
of allowing you to introduce yourself.
195
00:13:59,248 --> 00:14:08,308
And the other thing that I think we need to discuss
is what is IPC or what is inter process communication?
196
00:14:08,608 --> 00:14:13,458
Yeah who are you and why are you right?
197
00:14:13,488 --> 00:14:17,018
Why do you write D-Bus?
198
00:14:17,433 --> 00:14:18,253
Inrust.
199
00:14:18,658 --> 00:14:24,288
Zeeshan Ali Khan: I'm ZK . The correct pronunciation
is Khan, but you can call it Khan as well.
200
00:14:24,438 --> 00:14:24,978
It's okay.
201
00:14:25,378 --> 00:14:25,588
Yeah.
202
00:14:25,888 --> 00:14:28,178
Tim: Oh, sorry, I shouldn't have interrupted, but
203
00:14:28,733 --> 00:14:28,913
Zeeshan Ali Khan: no.
204
00:14:28,913 --> 00:14:29,298
It's okay.
205
00:14:29,378 --> 00:14:35,108
Tim: so is that the anglicization of the script?
206
00:14:36,328 --> 00:14:36,668
And,
207
00:14:36,843 --> 00:14:37,383
Zeeshan Ali Khan: Yeah, it is.
208
00:14:37,383 --> 00:14:37,633
Yeah.
209
00:14:37,673 --> 00:14:44,753
It's I think in Pakistan, we call it Latin, like
you write it in Latin, Latinization or something.
210
00:14:45,133 --> 00:14:46,403
But yeah, it's it's that.
211
00:14:46,583 --> 00:14:49,013
Actually, no, it's called Romanization or something.
212
00:14:49,023 --> 00:14:49,503
That's weird.
213
00:14:49,553 --> 00:14:49,943
But yeah.
214
00:14:50,573 --> 00:14:50,703
So
215
00:14:50,743 --> 00:14:55,303
Tim: Anglicization from English Latinization about
the script Romanization because of the Latin.
216
00:14:55,303 --> 00:14:59,183
Anyway, sorry from Romans languages, but yeah, that's yeah.
217
00:14:59,183 --> 00:15:00,493
So yeah.
218
00:15:00,523 --> 00:15:00,913
Thank you.
219
00:15:00,913 --> 00:15:01,453
Thank you for that.
220
00:15:01,453 --> 00:15:02,353
Sorry about the division.
221
00:15:02,353 --> 00:15:02,683
Carry on
222
00:15:03,413 --> 00:15:03,853
Zeeshan Ali Khan: no worries.
223
00:15:04,303 --> 00:15:10,493
So yeah my, my nation is called Pashtuns and we are everyone you
meet from that nation is called their last name would be Khan.
224
00:15:10,833 --> 00:15:13,263
So it's it's quite common because of that.
225
00:15:13,653 --> 00:15:16,743
And yeah, I'm from this country called Pakistan originally.
226
00:15:17,063 --> 00:15:23,823
And I moved to Finland and the, in
2005, it's been almost 20 years of that.
227
00:15:24,153 --> 00:15:28,123
And I I went there to work on something called MIMO or MIGO project.
228
00:15:28,143 --> 00:15:31,083
People know it from different names
because I changed names over the time.
229
00:15:31,333 --> 00:15:36,573
And the idea was to make a device by Nokia that is Linux based.
230
00:15:36,823 --> 00:15:45,213
And it was in the beginning, it was just internet tablets,
but then we started also doing these phones at some
point because they wanted to become mainstream, right?
231
00:15:45,723 --> 00:15:47,753
Things didn't go in the end so well.
232
00:15:47,783 --> 00:15:52,023
And Yeah people know about the story, what
happened to Nokia, so I wouldn't go into that.
233
00:15:52,353 --> 00:15:59,483
But for five years, I was working there, and I was doing what I would
call systems programming, but also more embedded systems programming.
234
00:15:59,783 --> 00:16:10,173
And that's, that was a bit different in the sense that we were
mostly using like GNOME software, the stack but we are putting
our own UI on it, and underneath there were our own drivers.
235
00:16:10,503 --> 00:16:19,573
A lot of them were women proprietary, but there was a lot of
stuff that was open source and even Nokia was like funding
creation and development of a lot of open source projects.
236
00:16:19,573 --> 00:16:22,623
They were part of GNOME basically for a long time.
237
00:16:22,953 --> 00:16:29,155
And and we had a really good relationship with with GNOME
and then later it was Qt became very important there.
238
00:16:29,415 --> 00:16:33,285
So I was interacting a bit with that
too, but I was mostly a GNOME guy.
239
00:16:33,505 --> 00:16:35,975
So basically doing desktop stuff.
240
00:16:36,260 --> 00:16:43,130
But some do it in a way that it works performantly on and
then a better device as well with resource constraints.
241
00:16:43,370 --> 00:16:45,720
So that was a, it was a very nice challenge.
242
00:16:45,990 --> 00:16:53,740
And I got because of that background, I got so used to having
things very optimized and having things very like very small.
243
00:16:53,740 --> 00:16:59,040
And it's just in now in my, I would say DNA
that I need things to be super efficient.
244
00:16:59,420 --> 00:17:02,030
And that's why I got into D-Bus as well, because of that.
245
00:17:02,050 --> 00:17:07,800
And and we can define IPC at the same time as we
it's just one process talking to another, right?
246
00:17:08,060 --> 00:17:12,931
On, on Linux, on I, I I guess all pro all
operating systems, you call them processes, right?
247
00:17:12,931 --> 00:17:16,451
Like, when you launch a program and it's running, it's a process then.
248
00:17:16,671 --> 00:17:20,111
So that living instance of a program is called a process.
249
00:17:20,401 --> 00:17:23,946
And when that needs to talk to another one this is called an IPC.
250
00:17:24,166 --> 00:17:26,326
And this can be a very low level thing.
251
00:17:26,356 --> 00:17:30,656
Like a lot of IPCs and RPCs I've seen,
they're actually pretty low level.
252
00:17:30,716 --> 00:17:31,998
They think in terms of messages.
253
00:17:32,026 --> 00:17:35,236
So you have a message and you have defined an encoding and.
254
00:17:35,756 --> 00:17:42,246
When you're both sides agree to what the encoding is how it will be
encoded and decoded then they can talk, basically talk to each other.
255
00:17:42,556 --> 00:17:47,756
And one side sends the message, the other one
decodes it and figures out what message it is.
256
00:17:48,036 --> 00:17:49,786
In Rust world, we will have an enum, right?
257
00:17:49,786 --> 00:17:54,906
Usually oh, the other side sends me a command and what
command it is and you match it on it and stuff like that.
258
00:17:55,526 --> 00:17:56,256
So on a basic,
259
00:17:56,276 --> 00:18:03,566
Tim: this might, so even more low level,
I, so something like zero MQ, for example,
260
00:18:04,746 --> 00:18:05,096
Zeeshan Ali Khan: yeah,
261
00:18:05,396 --> 00:18:14,126
Tim: yeah there are two programs essentially, two processes
and I'm sending messages between one and the other.
262
00:18:14,236 --> 00:18:14,656
And
263
00:18:17,076 --> 00:18:25,376
at the, on the receiving side, there is essentially
no knowledge yet about what the message will contain.
264
00:18:25,836 --> 00:18:39,626
Is this what you mean by, you need to define both a
transport layer, a way to send bytes between two passages
and an encoding so that both sides can actually make sense
of the bytes, the bits that are being sent between one
265
00:18:39,926 --> 00:18:40,266
Zeeshan Ali Khan: yeah.
266
00:18:40,616 --> 00:18:43,046
And they're like self describing formats, right?
267
00:18:43,046 --> 00:18:49,436
Like JSON, where you don't need to any more
information from the other side, except that it's JSON.
268
00:18:49,786 --> 00:18:52,926
And then they can, Sorry, decoded.
269
00:18:53,236 --> 00:18:58,044
But in, then there are non self describing
like D-Bus, which is a binary protocol.
270
00:18:58,074 --> 00:19:00,944
Everything, as I said needed to be super efficient.
271
00:19:00,954 --> 00:19:04,974
They created a binary protocol so that it's not for human eyes, right?
272
00:19:05,164 --> 00:19:08,874
So it's only for programs for code for programmers to decipher.
273
00:19:09,124 --> 00:19:11,734
It, it doesn't need to be self describing.
274
00:19:12,074 --> 00:19:13,194
All you need is how to.
275
00:19:13,329 --> 00:19:14,029
how to decode it.
276
00:19:14,289 --> 00:19:15,969
And the how to is is the important bit.
277
00:19:16,299 --> 00:19:19,516
And it's they also define like alignments.
278
00:19:19,566 --> 00:19:24,686
This, it is defined so that you can
read directly from the encoded message.
279
00:19:24,976 --> 00:19:28,646
So you don't need to put it in, into another thing, right?
280
00:19:28,646 --> 00:19:32,501
Like you, when you're decoding it, you
don't need to deserialize to another thing.
281
00:19:32,801 --> 00:19:36,251
Tim: So this is known as zero copy.
282
00:19:36,726 --> 00:19:37,066
Zeeshan Ali Khan: Yeah.
283
00:19:38,096 --> 00:19:43,696
Yeah, so it was very much designed for zero copy
reading or deserialization or whatever you call it.
284
00:19:44,076 --> 00:19:45,816
And it's the case for the DBS.
285
00:19:46,186 --> 00:19:48,086
That's the important bit.
286
00:19:48,786 --> 00:19:51,606
I have this condition that I forget what I was talking about.
287
00:19:51,607 --> 00:19:54,606
I
288
00:19:54,741 --> 00:19:55,621
Tim: to remind you of this.
289
00:19:55,746 --> 00:19:55,916
It
290
00:19:55,961 --> 00:19:57,001
Zeeshan Ali Khan: was introducing myself.
291
00:19:57,301 --> 00:19:58,021
Tim: Yeah, that's right.
292
00:19:58,231 --> 00:20:02,271
And also, by the way, you described the internals of IPC.
293
00:20:02,431 --> 00:20:02,831
That's okay.
294
00:20:02,861 --> 00:20:05,731
So you are at Is it MeMo?
295
00:20:06,021 --> 00:20:32,524
And the reason why I say that is because I wanted to interrupt
you at that point and say, I think I read every blog post
about MeMo and there were a few other names or It seemed
like there was a lot of A lot or about between 20, 2003,
2005, it seemed like Linux on mobile might actually happen.
296
00:20:32,584 --> 00:20:41,934
And in fact, I think Nokia did actually produce one really
good phone just, and then got acquired by Microsoft.
297
00:20:42,844 --> 00:20:43,544
And then needed
298
00:20:43,649 --> 00:20:43,844
Zeeshan Ali Khan: just,
299
00:20:49,144 --> 00:20:49,434
Tim: Is it
300
00:20:49,499 --> 00:20:53,849
Zeeshan Ali Khan: So they first set up, yeah, it was N9.
301
00:20:54,259 --> 00:20:56,289
And I think N9.
302
00:20:56,589 --> 00:20:58,094
Tim: N95 is the mask.
303
00:20:58,589 --> 00:21:01,719
Zeeshan Ali Khan: It's there was a
developer version of it with a keyboard.
304
00:21:01,789 --> 00:21:03,189
with a slide, sliding keyboard.
305
00:21:03,669 --> 00:21:10,139
But the main one was called N9 at the end, but they had
already signed an agreement with Microsoft of partnership.
306
00:21:10,489 --> 00:21:17,289
So they were going with Windows or whatever it was
for in the future in any case before N9 was produced.
307
00:21:17,729 --> 00:21:19,589
We knew that the ship was going down.
308
00:21:19,589 --> 00:21:22,219
We left so at that point I left and I joined Red Hat.
309
00:21:22,589 --> 00:21:23,609
And then I was doing.
310
00:21:23,859 --> 00:21:24,949
Purely desktop stuff.
311
00:21:24,979 --> 00:21:28,969
So I was not doing like I didn't need
to care about super efficiency anymore.
312
00:21:29,399 --> 00:21:36,609
And I was there for five years and I was doing mostly C in all
this time, but there was also another language called Vala.
313
00:21:36,999 --> 00:21:40,689
Because I was also tired a bit of C
because it was just too low level, right?
314
00:21:40,999 --> 00:21:44,989
So I needed something a bit higher level that can be as efficient as
315
00:21:45,289 --> 00:21:46,079
Tim: Isn't that a scheme?
316
00:21:46,379 --> 00:21:47,509
Zeeshan Ali Khan: Vala sorry Vala.
317
00:21:47,814 --> 00:21:48,974
Tim: Vala a scheme?
318
00:21:49,294 --> 00:21:52,004
Or, oh no, I thought it was a Lisp dialect.
319
00:21:52,074 --> 00:21:52,464
I,
320
00:21:52,504 --> 00:21:53,494
Zeeshan Ali Khan: No, it's not at all.
321
00:21:53,524 --> 00:21:55,834
Actually, it's it's based on C sharp.
322
00:21:55,854 --> 00:22:01,524
The syntax is C sharp based, but it compiles,
transpiles, as people call it, to C.
323
00:22:01,854 --> 00:22:06,424
So it was basically writing C in a higher level language like C sharp.
324
00:22:06,704 --> 00:22:07,984
That was very convenient.
325
00:22:08,179 --> 00:22:23,869
And I wrote my, one of my project called Rigel, it's a I
don't know if people still remember this thing called DLNA or
UPnP, which is about talking from one device to another, it
was more like an RPC, not IPC, but RPC and it, most, a lot of
326
00:22:23,869 --> 00:22:34,209
media servers, media renders, TVs still do that actually and
that, that's what I was working on, and it's an open source
project, Rigel, and it was done in Vala And my library was in C.
327
00:22:34,449 --> 00:22:40,179
So I was doing this thing called this thing, that I was doing
libraries in C and the application I would write in Walla.
328
00:22:40,559 --> 00:22:51,009
And but then like when GNOME like when Nokia, that
was like going in the other direction and I left Nokia
and Walla was The interest was going down very fast.
329
00:22:51,189 --> 00:22:55,679
And then Rust came along and that
interest in Vala, basically a flat line.
330
00:22:55,799 --> 00:23:07,119
It's not it's still like people really like it in GNOME still, and
they still do it some people, but the number of people doing Vala is
like really low and there's a lot more people interested in Rust now.
331
00:23:07,349 --> 00:23:10,139
So I think Rust basically killed Vala at some point.
332
00:23:10,459 --> 00:23:11,609
But I was still.
333
00:23:11,869 --> 00:23:12,449
Interested in it.
334
00:23:12,449 --> 00:23:19,019
So even at Red Hat I was doing Vala until I got into Rust
and then I was like, okay I don't need Vala at all anymore.
335
00:23:19,029 --> 00:23:19,579
It's Rust has,
336
00:23:20,749 --> 00:23:35,169
Tim: Yeah, I think that there are a few languages that
are essentially C With different syntax, and for example,
there's an extension language for Python called Cython
337
00:23:35,329 --> 00:23:48,529
which allows you to write native extensions, and, But the
thing that gets me with these languages is they still have
memory safety issues and you can still have null pointers.
338
00:23:49,099 --> 00:23:49,419
Zeeshan Ali Khan: yeah.
339
00:23:49,499 --> 00:23:51,479
Null pointers is very common.
340
00:23:52,289 --> 00:23:54,129
I think most of my time was spent on that.
341
00:23:54,149 --> 00:23:59,799
And that's actually, that brings me to
why I wanted to rewrite GeoClue, right?
342
00:23:59,799 --> 00:24:05,309
Because all the bugs that I was getting, I was
not that interested in maintaining it anymore.
343
00:24:05,349 --> 00:24:06,419
And I was the maintainer.
344
00:24:07,139 --> 00:24:08,259
Nobody wanted to take it.
345
00:24:08,609 --> 00:24:11,159
And all the bugs I was getting were crash reports.
346
00:24:11,589 --> 00:24:28,954
Basically, and because of some pointer getting in a different way,
and the funny, not so funny actually, in that time, was that I
would solve a crash, and it would solve that specific crash, but And
that fix would introduce other crashes that would come out later.
347
00:24:28,974 --> 00:24:31,244
And I was like, Oh, I have to do this again.
348
00:24:31,684 --> 00:24:33,279
So I was getting really tired of that.
349
00:24:33,589 --> 00:24:37,049
And I was like, if there is a way to,
to just completely remove them, why not?
350
00:24:37,339 --> 00:24:45,389
So I started rewriting in in Rust and all these years later, I
think it's been four years since I started Zebus or maybe even five.
351
00:24:45,479 --> 00:24:46,709
I think at least four years now.
352
00:24:46,959 --> 00:24:49,009
And I still haven't read it in GeoClue.
353
00:24:49,089 --> 00:25:01,659
I actually, in the between, gave up like that project because
Zebus itself became such a big project and it, I have to
do so much for that now that I just don't have the time.
354
00:25:02,009 --> 00:25:04,809
So yeah I'm mostly just doing Zebus now, not GeoClue.
355
00:25:05,439 --> 00:25:06,089
Are you on mute?
356
00:25:06,959 --> 00:25:08,649
Tim: Sorry, the,
357
00:25:11,439 --> 00:25:26,259
so your GeoClue project is currently, it works, but as far
as, but essentially you have the problem that you probably,
you are the quote, the maintainer or the owner of the project.
358
00:25:26,439 --> 00:25:30,269
However, you don't have enough capacity to actually,
359
00:25:30,619 --> 00:25:37,109
Zeeshan Ali Khan: Yeah, so I have given it up like
to other folks who were interested in contributing
and I was like, yeah, you are contributing a lot.
360
00:25:37,109 --> 00:25:38,999
Please, just maintain it from now on.
361
00:25:39,359 --> 00:25:42,099
And they also, at least one of them needed for their work.
362
00:25:42,457 --> 00:25:48,319
So I was like, yeah, it makes sense that for you to take
it over because I for me, it wasn't work project anymore.
363
00:25:48,319 --> 00:25:50,649
It was I wasn't getting paid to work on it at all.
364
00:25:51,069 --> 00:25:52,499
And I just didn't have the capacity.
365
00:25:52,499 --> 00:25:56,839
And as I have a kid now, so it's been two
years that I have a little one as long, as
366
00:25:56,839 --> 00:25:57,479
Tim: I
367
00:25:57,529 --> 00:25:57,749
Zeeshan Ali Khan: it's,
368
00:25:58,049 --> 00:25:59,919
Tim: is it's challenging.
369
00:25:59,919 --> 00:26:11,319
The interesting thing about this that I think is a more broad or more
general discussion that so much work gets pushed onto so few people.
370
00:26:12,624 --> 00:26:21,514
In open source, the, and the, and it even to
hear, Oh, look, now ZBus is doing very well,
371
00:26:22,404 --> 00:26:32,504
that doesn't reduce the amount of work, although it probably
get different bug reports, or at least different feature
reports but it seems As things become more successful,
372
00:26:32,964 --> 00:26:33,394
Zeeshan Ali Khan: yeah,
373
00:26:33,504 --> 00:26:41,554
Tim: the job almost becomes harder because you
don't want to push out a release that is broken or
374
00:26:41,854 --> 00:26:42,314
Zeeshan Ali Khan: Of course.
375
00:26:42,614 --> 00:26:43,364
Tim: And things like this,
376
00:26:44,044 --> 00:26:46,204
Zeeshan Ali Khan: Yeah it's yeah, it's certainly true.
377
00:26:46,204 --> 00:26:50,354
And Zebus is used quite a lot nowadays, like in actual production.
378
00:26:50,704 --> 00:27:03,744
People actually, even I met once a person who was
using a beta version, like I had specifically marked
it as beta because I I did not want anyone to use
it in production, but he was using it in production.
379
00:27:04,044 --> 00:27:12,484
I was like you have to immediately change to a
supported version because i'm not gonna support
you on this so yeah, it's used, quite a lot.
380
00:27:12,534 --> 00:27:21,839
In by so many companies big and small Since it's insane, but the
contribution that are coming they are not They're not in proportion.
381
00:27:21,939 --> 00:27:24,349
They're people just assume yeah, this is the project.
382
00:27:24,349 --> 00:27:24,849
It's cool.
383
00:27:24,849 --> 00:27:25,719
And we will use it.
384
00:27:25,719 --> 00:27:26,109
It works.
385
00:27:26,469 --> 00:27:28,719
If they have a problem, they usually work around it.
386
00:27:28,719 --> 00:27:30,969
I joined a few companies where they were already using it.
387
00:27:31,429 --> 00:27:34,009
And then I found out that they were working around some problems.
388
00:27:34,009 --> 00:27:35,079
I'm like, why are you working around?
389
00:27:35,079 --> 00:27:35,949
Why didn't you tell me?
390
00:27:36,099 --> 00:27:36,919
I could have fixed this.
391
00:27:37,879 --> 00:27:39,359
No they just work around it.
392
00:27:40,189 --> 00:27:48,599
One of them actually had a huge document explaining
how to work around a very small problem in Zebas
that I could have in five minutes fixed it.
393
00:27:48,629 --> 00:27:52,229
But no, he had to write a whole document to work around it.
394
00:27:52,874 --> 00:28:00,934
Tim: I wonder, yeah, it's very hard for commercial
users of open source to speak to maintainers
395
00:28:01,664 --> 00:28:02,024
Zeeshan Ali Khan: Yeah.
396
00:28:02,154 --> 00:28:04,124
Tim: in a sensible way, I think,
397
00:28:04,174 --> 00:28:04,354
Zeeshan Ali Khan: Yeah.
398
00:28:04,354 --> 00:28:11,928
I think they just don't have this sorry to interrupt,
but I just that I think they just don't have
this thing that these are people you can talk to.
399
00:28:11,928 --> 00:28:24,623
I think they think of open source maintainers, developers as
some sort of guards or some out of reach people who are really
awesome, but they, Yeah, it's yeah, that's a bit of a problem.
400
00:28:25,073 --> 00:28:25,873
You can fix it.
401
00:28:25,913 --> 00:28:29,023
It's you just tell them like, yeah, this is a guy like me.
402
00:28:29,093 --> 00:28:30,283
I'm working with you now, right?
403
00:28:30,283 --> 00:28:31,303
Like I'm not a God.
404
00:28:31,493 --> 00:28:32,253
I'm just like you.
405
00:28:32,253 --> 00:28:33,443
Yeah, it is a bit of a problem.
406
00:28:33,483 --> 00:28:33,763
Sorry.
407
00:28:33,813 --> 00:28:34,413
I interrupted you.
408
00:28:34,413 --> 00:28:38,053
Yeah.
409
00:28:38,353 --> 00:28:50,843
Tim: But I am curious around how the process
of developing software in Rust comes across.
410
00:28:51,013 --> 00:28:52,273
So there's two aspects.
411
00:28:52,383 --> 00:28:55,123
One is the friction between communities.
412
00:28:55,363 --> 00:29:05,853
Essentially, you've already talked about how Rust in at
least the GNOME, the context of GNOME project kind of,
destroy, destroyed the momentum for Vala, let's say.
413
00:29:06,213 --> 00:29:08,503
And then the, but I think.
414
00:29:09,103 --> 00:29:18,123
With D-Bus, if the Rust implementation becomes, if
you remove these bottlenecks, you discover that.
415
00:29:18,498 --> 00:29:24,868
You could potentially go faster and you are easier to use that.
416
00:29:25,278 --> 00:29:33,598
Does that not cause issues with the people who
developed the original code in a different language?
417
00:29:33,988 --> 00:29:47,668
And the other related question is what does it feel like to write
rust for something that is spiritually in a different language?
418
00:29:48,288 --> 00:29:52,648
You cannot force D-Bus to change.
419
00:29:52,768 --> 00:30:00,563
You need to comply with It's rules and Rust has its own opinions.
420
00:30:01,113 --> 00:30:12,573
And I assume that there is conflict at a technical
level between what Rust wants or Rust, Rust compiler
wants and the, what the specification requires.
421
00:30:15,268 --> 00:30:18,008
Zeeshan Ali Khan: If you don't mind, I'll answer your, Last question.
422
00:30:18,258 --> 00:30:22,378
No, second question first, because I
understood that question and I know the answer.
423
00:30:22,578 --> 00:30:24,458
And the first question, I have to clarify,
424
00:30:24,973 --> 00:30:25,413
Tim: Okay.
425
00:30:25,413 --> 00:30:25,523
Sure.
426
00:30:25,578 --> 00:30:29,763
Zeeshan Ali Khan: So yeah, so the second
question about compatibility, right?
427
00:30:29,763 --> 00:30:35,565
So that's something I learned fairly early on
because I first provided an API like for zvariant.
428
00:30:35,635 --> 00:30:36,985
It wasn't zBus yet.
429
00:30:37,295 --> 00:30:38,505
zvariant was already there.
430
00:30:38,825 --> 00:30:45,125
And the first issue that was filed against it after the
first release was, why are you not providing a serde API?
431
00:30:45,485 --> 00:30:48,065
And that's like the standard in Rust.
432
00:30:49,540 --> 00:30:55,350
The answer that I probably didn't give to that person,
but the answer was really that I was new to Rust.
433
00:30:55,670 --> 00:31:06,380
I was already struggling with Rust itself and and to go for serde,
which I looked at and I got scared, especially to implement it, right?
434
00:31:06,480 --> 00:31:10,665
Serde, it's so easy, so interesting, so good.
435
00:31:11,135 --> 00:31:15,735
But when you implement it That's where things get
a bit hairy, especially if you're new to Rust.
436
00:31:15,735 --> 00:31:18,835
You see the lifetimes, you're like, what the hell is going on?
437
00:31:19,255 --> 00:31:20,335
So I got scared basically.
438
00:31:20,595 --> 00:31:23,995
And I was like, okay, I can't deal
with multiple things at the same time.
439
00:31:23,995 --> 00:31:25,495
I'm learning D-Bus protocol.
440
00:31:25,675 --> 00:31:26,455
I'm learning Rust.
441
00:31:26,665 --> 00:31:27,485
I can't be learning.
442
00:31:27,845 --> 00:31:28,625
Serde as well.
443
00:31:28,755 --> 00:31:37,445
So I didn't do serde, but the, after that, I was
like, okay, let's create a serde based API because
that's what people would be interested in Rust world.
444
00:31:37,735 --> 00:31:46,275
So when I did that, I realized soon that there was a huge,
there was a fundamental problem between D-Bus and serde.
445
00:31:46,715 --> 00:31:53,620
And the reason is that, When you're doing serde,
implementing serde deserializer or serializer when you're,
446
00:31:53,765 --> 00:31:55,175
Tim: I should pause there just, sorry.
447
00:31:55,435 --> 00:32:00,245
So for people who have not implemented a file format
448
00:32:02,415 --> 00:32:10,345
for serde, serde, so you will be used to the
serialize and deserialize traits that you derive.
449
00:32:10,425 --> 00:32:17,585
They're very common, we just, again, we just bolt them
on to our struct and serde does the rest of the work.
450
00:32:18,055 --> 00:32:44,950
Now, when you want to provide a file format, On the
serialize or deserialize side, you implement different
traits these are called serialize er and deserialize er,
which have this slightly odd visitor pattern API, which
itself seems very mystical and it's difficult and complex.
451
00:32:44,990 --> 00:32:45,670
So carry on.
452
00:32:45,760 --> 00:32:47,810
I just thought I would just explain for people who
453
00:32:47,860 --> 00:32:48,480
Zeeshan Ali Khan: No, no worries.
454
00:32:48,480 --> 00:32:49,560
I should have done that.
455
00:32:49,860 --> 00:32:50,350
Tim: that's okay.
456
00:32:50,360 --> 00:32:50,780
It's okay.
457
00:32:51,130 --> 00:32:52,010
Zeeshan Ali Khan: I should have done that.
458
00:32:52,050 --> 00:32:58,600
Yeah, as as Tim just pointed out it's also for
example, like when you use a specific format, right?
459
00:32:58,600 --> 00:33:02,130
JSON, SerdeJSON and TOML and all that.
460
00:33:02,360 --> 00:33:07,090
So they are implementing behind the scene
for you, the serializer and deserializer.
461
00:33:07,150 --> 00:33:25,533
And for those self describing formats that I talked of before
ser json and toml and stuff it's much easier and serde, it
seems to me from looking at it from internal perspective,
it seems to be very much defined very much created for these
formats, so it's much easier to implement it for those.
462
00:33:25,823 --> 00:33:31,443
But it's much, much harder to implement it for binary
protocols that are not self describing in general.
463
00:33:31,623 --> 00:33:34,993
And also, as Tim pointed out, there's
the visitor pattern for de serializer.
464
00:33:35,143 --> 00:33:38,873
So de serializer is a bit harder to
implement than serializer, but it's similar.
465
00:33:39,153 --> 00:33:47,223
The good thing, the good news was actually that all the basic
types that DBAs has are the same as in rust and survey world.
466
00:33:47,223 --> 00:33:48,393
So they're they match.
467
00:33:48,483 --> 00:33:49,313
So that was a good thing.
468
00:33:49,623 --> 00:33:51,071
But the ba the part that.
469
00:33:51,906 --> 00:34:07,871
That where the things fall apart is when you want to implement a
container like Array, for example, D-Bus calls it Array, but in in
Serde world, it's called a sequence, which is like a whack, or or a
slice, for example that when you encode or decode that's where the
470
00:34:07,871 --> 00:34:18,796
problems comes because a Serde, when when you're serialize, when
you're implementing this serializer or deserializer trait it does not
tell you the type, because Rust doesn't have what do you call that?
471
00:34:18,826 --> 00:34:19,836
Reflections, right?
472
00:34:19,846 --> 00:34:22,936
It doesn't tell you exactly what the type is.
473
00:34:23,196 --> 00:34:25,606
It's very defined in a very generic way.
474
00:34:25,616 --> 00:34:30,496
You get a generic type that, oh, this type
implements serialize and deserialize, and that's it.
475
00:34:30,856 --> 00:34:32,357
And you don't have no other information.
476
00:34:32,596 --> 00:34:36,126
So in, in D-Bus, unfortunately, there is a weird.
477
00:34:36,386 --> 00:34:47,776
Requirement that when you are encoding an empty array, empty
sequence, basically, you have to still pad for the first
first element, even if you don't have the first element.
478
00:34:47,836 --> 00:34:47,996
If
479
00:34:48,076 --> 00:34:50,106
Tim: this is because of the alignment.
480
00:34:50,171 --> 00:34:54,231
Yeah,
481
00:34:54,256 --> 00:34:59,436
Zeeshan Ali Khan: because of this alignment requirement, you
have to add some zeros in the encoding based on what type it is.
482
00:34:59,936 --> 00:35:04,426
And since you don't know what type it is,
what does it contain inside you can't do it.
483
00:35:04,576 --> 00:35:10,576
It's just impossible doing it purely with
serde itself, with the serde API and Rust.
484
00:35:10,896 --> 00:35:19,706
I had to implement a requirement in there, so that
your type doesn't just have to implement serialize
or deserialize depending on what you're doing.
485
00:35:20,036 --> 00:35:30,376
But also, another create, which I called type
which gives me a specific string, which is in
D-Bus, defines what is on, in, inside, right?
486
00:35:30,506 --> 00:35:32,536
Because it's not a self describing format, as I said.
487
00:35:32,706 --> 00:35:40,086
So to decode a series of bytes that you receive from the
other side, you need something to tell you what's in there.
488
00:35:40,366 --> 00:35:42,646
And that thing is called a signature.
489
00:35:42,906 --> 00:35:46,856
And the signature is just a string that tells about each.
490
00:35:47,016 --> 00:35:49,346
Type that is encoded in sequence in there.
491
00:35:49,576 --> 00:35:55,726
Okay, this is an array of strings, and
then now a string so basically a struct.
492
00:35:55,726 --> 00:35:58,306
Everything is a struct of different sizes, right?
493
00:35:58,516 --> 00:35:59,476
And it describes that.
494
00:35:59,686 --> 00:36:06,746
So I had to introduce, I was so annoyed by this,
because I really did not want the, people to have
to do this because you have a random type, right?
495
00:36:06,746 --> 00:36:10,796
Like from a different crate and you have this orphan rule in Rust.
496
00:36:11,156 --> 00:36:16,366
And now all of a sudden you need to, for D-Bus, how
do you encode it or decode it from D-Bus, right?
497
00:36:16,586 --> 00:36:17,046
You need.
498
00:36:17,311 --> 00:36:30,838
The signature, all of a sudden, and it's more work serde, deserialize,
and serialize, they're so common, all those traits crates they
provide serde features usually, and they provide this implementation
499
00:36:30,838 --> 00:36:43,079
for you, but they will not do that for Zebus, because as famous
as it could be, it doesn't matter because it cannot come to the
same, Fame as it says it is and they will not go that far for it.
500
00:36:43,269 --> 00:36:49,849
So it was really annoying, but that's where the incompatibility
happened between the two worlds and I had to do that.
501
00:36:50,079 --> 00:36:51,929
But I did provide a macro.
502
00:36:52,104 --> 00:36:54,504
So that you don't have to do it manually.
503
00:36:54,774 --> 00:36:57,164
It's really hard to prove, to always implement that.
504
00:36:57,434 --> 00:36:59,074
But it's I have, I've done that.
505
00:36:59,074 --> 00:37:00,754
So it's not that hard.
506
00:37:00,844 --> 00:37:04,074
So because in the end, I wanted to make it as easy as possible.
507
00:37:04,304 --> 00:37:11,024
And this is as easy as it could be because of this
fundamental incompatibility between these two worlds.
508
00:37:11,354 --> 00:37:15,304
Now we can talk about your first question,
if I have answered your second question.
509
00:37:16,419 --> 00:37:44,389
Tim: I think that no I appreciate that there is I only
have a half thought in response, which would be something
along the lines that there is a, I want to shake serde
and say, look, I wonder if we, so the thought is,
shouldn't we have some way to tell serde something extra?
510
00:37:45,089 --> 00:38:00,024
Can we provide some sort of context about the type that
we, the information that we expect, and then we could go
back to, I wonder if we have just created the same the
page of documentation about workarounds in the file format.
511
00:38:01,894 --> 00:38:03,984
Maybe we should talk to David Tolman.
512
00:38:04,194 --> 00:38:22,024
However, the, I actually think in the case of serde, that it's design
means that adjusting it now is going to be so hard that effectively
you need the page of documentation or in your case, the macro.
513
00:38:22,429 --> 00:38:23,289
To work around it.
514
00:38:23,579 --> 00:38:39,159
I think I have this personal grumpiness about
how prominent serde is for serialization and
deserialization, because I think that it forces itself.
515
00:38:39,329 --> 00:38:45,339
Anyway, I wish that serialized and deserialized were part of
the standard library and that they were slightly more neutral or
516
00:38:45,689 --> 00:38:56,209
Zeeshan Ali Khan: Yeah the thing is that this specific issue
was filed already by the previous creator, the D-Bus RS,
which was a library, which is a wrapper around a C library.
517
00:38:56,579 --> 00:39:02,229
And I think they wanted to also move away from
C library and create a new API based on serde.
518
00:39:02,449 --> 00:39:07,110
So they filed this issue already and they discussed with
David Tolney and in the end they themselves closed, the issue.
519
00:39:07,570 --> 00:39:12,990
The issue saying that, okay, I think this
is going to require breaking serde API.
520
00:39:13,220 --> 00:39:20,980
And that's not something you want but to make it actually even go even
further one step, because I don't want people to do having to do this.
521
00:39:21,230 --> 00:39:25,140
So all the famous crates, let's say time and What is the other one?
522
00:39:25,180 --> 00:39:31,887
Chrono, and all those kind uuid, everything, all those crits that
are the most famous one that provides types that are used all over.
523
00:39:32,317 --> 00:39:41,637
I in Zebus have provided these features that are that
when you enable it, it provides you serialization,
deserialization for, not deserialization, but the type.
524
00:39:41,857 --> 00:39:42,877
implementation for you.
525
00:39:42,987 --> 00:39:51,397
So you don't, in most cases, you don't actually have
to do this, but mostly for your custom types, for which
you have to implement serialize, deserialize anyway.
526
00:39:51,597 --> 00:39:53,737
So you might as well derive one more thing.
527
00:39:53,987 --> 00:39:55,207
And that's, it's not so bad.
528
00:39:55,397 --> 00:39:58,757
So I think in the end, what I have ended up with is not so bad.
529
00:39:59,057 --> 00:40:05,907
And I can always add more types in in ZBus if Someone comes
around anything so they don't have to work around actually
530
00:40:06,317 --> 00:40:08,427
Tim: you very much for doing the work to,
531
00:40:09,147 --> 00:40:14,347
Zeeshan Ali Khan: No worries, and there's other
people also contributing recently actually
someone contributed more types and stuff.
532
00:40:14,697 --> 00:40:16,507
I think you there was another question from
533
00:40:16,517 --> 00:40:41,297
Tim: there was, and the question was more along the lines of
the social aspect of, do you think that people in the D-Bus
community are, you mentioned, clearly, I should finish my
sentence, they, is the hostility to you as someone coming
in from the outside who didn't know D-Bus when they started?
534
00:40:42,047 --> 00:40:52,362
I suppose now you have established yourself as being, Part of the D-Bus
community at large, but the D-Bus is very important in the Linux world.
535
00:40:52,552 --> 00:40:59,226
It even though it's weird, you've got
these strange paths and okay, fine.
536
00:40:59,226 --> 00:41:02,629
But and
537
00:41:05,249 --> 00:41:18,879
the yeah, so I'm, I am curious about whether or not you
have had any pushback from people who have said it would
have been better if you had just made the C thing better.
538
00:41:21,354 --> 00:41:41,409
Zeeshan Ali Khan: I, I actually never had that because for
C we already had a library like Gile provides GIO, which
already does this in a, and it provides as nice an API as
it possibly could for C, it's like there's a limitation
that you cannot make it much any better than that, I think.
539
00:41:41,789 --> 00:41:44,023
And actually, that was my inspiration.
540
00:41:44,123 --> 00:41:45,163
So I was used to that.
541
00:41:45,313 --> 00:41:50,173
So I wanted something similar in Rust world for yeah, for Rust people.
542
00:41:50,553 --> 00:41:56,183
And then it grew out and I realized that I
could actually provide much better than that.
543
00:41:56,333 --> 00:42:01,733
I think C and C they have reached their limitation and
there's already an API and nobody has asked for it.
544
00:42:01,893 --> 00:42:04,213
Except for one person who was trying it.
545
00:42:04,523 --> 00:42:08,903
to do this, but they were not looking for a better API in C.
546
00:42:09,083 --> 00:42:18,923
What they were trying to look for was trying to introduce Zebus
as a dependency into libraries like GTK a system library in C.
547
00:42:19,183 --> 00:42:27,288
And they were hoping that they can snug it in so that
Rust is a dependency of core GNOME and Linux libraries.
548
00:42:27,598 --> 00:42:30,258
And they were, that's what their main agenda.
549
00:42:30,468 --> 00:42:42,608
Which I agree with, but I was telling them like, there's, it's going
to be hard to get it and make it a C, good C API and then being able
to sell it that, okay this is a better C API than the other one.
550
00:42:42,888 --> 00:42:44,258
And that one cannot be improved.
551
00:42:44,648 --> 00:42:45,458
In the same way.
552
00:42:45,788 --> 00:42:47,288
I think that would be a harder sell.
553
00:42:47,478 --> 00:42:50,878
So I think that this would, this could be a wasted effort.
554
00:42:51,068 --> 00:42:52,088
It would be a big effort.
555
00:42:52,148 --> 00:42:55,208
And if it's wasted, then I really don't want to do it.
556
00:42:55,618 --> 00:42:56,088
There is one.
557
00:42:56,923 --> 00:42:59,828
Tim: do you want to talk a little bit about your thoughts on that?
558
00:43:00,178 --> 00:43:11,268
About Rust and Linux, not in the kernel, but I
suppose in user space or maybe in kernel space
as well, but in all of the utilities and things.
559
00:43:12,658 --> 00:43:29,408
Zeeshan Ali Khan: yeah, so I think it, it also ties into what
you said earlier about you coming from a web background and
I was talking about a lot of people actually come from web
background and other backgrounds, not from this Linux systems
programming background, and that creates a bit of friction.
560
00:43:30,248 --> 00:43:36,928
And the main project where this friction
arises is cargo for us from Rust world.
561
00:43:37,218 --> 00:43:38,898
Like I'm now part of the Rust world.
562
00:43:38,978 --> 00:43:44,528
I'm mostly I really understand the Attraction
of cargo for people from other worlds.
563
00:43:44,728 --> 00:43:50,058
They see cargo as some kind of like
amazing thing that solves all problems.
564
00:43:50,358 --> 00:43:56,358
And actually I don't know if you would be surprised to know
this, but it's not the case for syst Linux systems programmers.
565
00:43:56,718 --> 00:44:04,018
That's actually the project that they point to that's a very
good excuse for C programmers to say, Why should I learn Rust?
566
00:44:04,188 --> 00:44:05,838
It has bad tooling.
567
00:44:06,128 --> 00:44:23,698
It doesn't have good tooling and in a way they're right, because
they're expecting that a very similar tooling to exist for Rust
as well, that they're used to foresee, because when you're a
system programmer especially an open source system programmer,
you have to worry a lot about you provide a package that is very
568
00:44:23,698 --> 00:44:38,613
easy for for distros, for Linux distributions to, to package and
what and give them something they're used to and also to be able
to cross compile in the same way that they're used to and not
what how cargo or there's this thing called I forgot the name.
569
00:44:38,653 --> 00:44:39,013
Cross.
570
00:44:39,013 --> 00:44:39,303
Yeah.
571
00:44:39,593 --> 00:44:40,053
Cross tool.
572
00:44:40,233 --> 00:44:41,123
They're not used to that.
573
00:44:41,313 --> 00:44:42,483
They don't know what that is about.
574
00:44:42,673 --> 00:44:43,903
And where is the my binary?
575
00:44:44,143 --> 00:44:54,473
And especially one aspect of it as installation of because in the
rest of the world, we are more used to of like single binary, like
it compiles to always the same binary as the name of the cargo.
576
00:44:54,773 --> 00:44:55,573
And that's it.
577
00:44:55,673 --> 00:44:56,458
And then you run it.
578
00:44:56,668 --> 00:45:00,113
or you install it and you call it with
the same name, that's the end of it.
579
00:45:00,393 --> 00:45:07,343
But in, in system, Linux system programming, you always
have auxiliary data and that you also have to install.
580
00:45:07,563 --> 00:45:08,863
You don't have just the binary.
581
00:45:09,003 --> 00:45:11,093
And also, the binary, where do you install it?
582
00:45:11,383 --> 00:45:15,503
So all that stuff especially with
installation, that is not there in Cargo.
583
00:45:15,733 --> 00:45:17,243
There is a there are issues.
584
00:45:19,153 --> 00:45:21,273
And they are, they're there for ages.
585
00:45:21,273 --> 00:45:26,373
Nobody really does anything about it because of this friction.
586
00:45:26,413 --> 00:45:32,293
So the cargo people, the people who actually work on cargo and
contribute to it and are into it, they're Rust developers, right?
587
00:45:32,493 --> 00:45:36,023
So they're, they've already bought into
Rust and they're very passionate about it.
588
00:45:36,423 --> 00:45:36,743
And
589
00:45:37,088 --> 00:45:40,648
Tim: So I think what you're saying next is that, they don't.
590
00:45:42,733 --> 00:45:47,793
They don't want to teach, they don't want to change, they
591
00:45:48,093 --> 00:45:52,298
Zeeshan Ali Khan: no, it's not about, Yeah, I
think it's not about being able wanting to teach.
592
00:45:52,298 --> 00:45:56,768
It's more about they want to care about
their own use cases, which is natural.
593
00:45:56,778 --> 00:45:58,818
Like everyone cares about their use cases.
594
00:45:59,278 --> 00:46:02,028
I went Canadian for a bit for some reason.
595
00:46:02,048 --> 00:46:03,178
I'm not a Canadian.
596
00:46:03,968 --> 00:46:06,778
I have family in Canada, but I've never looked there myself.
597
00:46:06,838 --> 00:46:11,728
Anyway they don't naturally they care about their
use cases, which are not Linux systems programming.
598
00:46:12,148 --> 00:46:15,023
But on the other hand, the people who you are teaching.
599
00:46:15,153 --> 00:46:19,063
trying to sell it to Linux system people they wouldn't get into it.
600
00:46:19,073 --> 00:46:20,713
So it's a bit of a chicken and egg problem.
601
00:46:20,983 --> 00:46:25,273
They wouldn't get into it because cargo,
the tooling doesn't offer what they need.
602
00:46:25,543 --> 00:46:29,693
And if they don't get into it, they wouldn't solve
it themselves because they're not interested.
603
00:46:30,343 --> 00:46:31,843
So it's a bit of a chicken and egg problem.
604
00:46:32,263 --> 00:46:38,773
And I've been trying to Actually fighting this war,
actually, trying to get Rust into Linux systems programming.
605
00:46:39,123 --> 00:46:41,783
And that's why one of the reasons I started this project, right?
606
00:46:41,783 --> 00:46:47,283
Now like one year ago, I started this other
project calledbusd, which is the daemon.
607
00:46:47,313 --> 00:46:52,573
I think I should have mentioned this that
D-Bus usually typically involves a broker.
608
00:46:52,783 --> 00:46:57,613
So you don't talk to other processes directly
because it's a bit of a higher level.
609
00:46:58,113 --> 00:47:01,363
Protocol, because you don't have just messages passing between.
610
00:47:01,643 --> 00:47:10,253
You usually have an API and that API means that you have a service
that provides a specific API and and the clients call to that.
611
00:47:10,553 --> 00:47:10,758
And.
612
00:47:11,098 --> 00:47:22,708
Having this broker in the middle takes care of a lot
of things for you and including the fact that if you
are in you have any problem with your service or your
or your client you want to debug it what's going on?
613
00:47:22,718 --> 00:47:24,008
Why am I not getting these messages?
614
00:47:24,208 --> 00:47:27,158
You monitor this broker, and you get your answers.
615
00:47:27,398 --> 00:47:29,598
So this broker solves a lot of problem problems.
616
00:47:29,973 --> 00:47:32,783
And all these brokers currently are written in C.
617
00:47:32,843 --> 00:47:33,483
And they're old.
618
00:47:33,793 --> 00:47:36,973
And I want to change that, and I want to do it in Rust.
619
00:47:37,143 --> 00:47:45,723
And the good thing is that with ZBus, making it Making D-Bus so
easy getting the first version done was a matter of two weekends.
620
00:47:45,973 --> 00:47:49,563
So I, like all the basics all the essentials were already done.
621
00:47:49,693 --> 00:47:51,983
You could talk through it and it would work.
622
00:47:52,333 --> 00:47:56,553
But of course it's a lot more, there's a lot more to it than that.
623
00:47:56,723 --> 00:48:01,523
So that project is part of my effort
to get Rust into systems programming.
624
00:48:01,893 --> 00:48:02,503
World system.
625
00:48:02,648 --> 00:48:03,538
World, linux world.
626
00:48:03,978 --> 00:48:13,368
But it's a bit of a problem because of this cargo
and and the thing that is used in the sea world right
now is called Mason, which is quite sort of new.
627
00:48:13,608 --> 00:48:15,098
It's Python based.
628
00:48:15,098 --> 00:48:20,758
It is in the sense that it's implemented in
Python and it's, it's the syntax is very Python-ish.
629
00:48:21,028 --> 00:48:22,578
It's like a configuration thing.
630
00:48:22,838 --> 00:48:29,638
I guess viewers might have heard of something called CMake
or AutoTools, which are famous for being notoriously bad.
631
00:48:30,028 --> 00:48:30,618
But nowadays
632
00:48:30,658 --> 00:48:39,198
Tim: I, I actually went to a talk at LinuxConfAU in January, 2020.
633
00:48:40,458 --> 00:48:41,178
Like just.
634
00:48:41,543 --> 00:48:44,873
as the gates were closing.
635
00:48:45,838 --> 00:48:46,368
Zeeshan Ali Khan: right?
636
00:48:47,453 --> 00:48:50,363
Tim: and he was there presenting Mason.
637
00:48:50,813 --> 00:48:51,393
Mason?
638
00:48:51,528 --> 00:48:52,163
Zeeshan Ali Khan: mean, Yussi.
639
00:48:52,618 --> 00:48:52,948
Tim: Yeah.
640
00:48:53,158 --> 00:48:54,318
He's, yeah, I was about to say
641
00:48:54,463 --> 00:48:55,588
Zeeshan Ali Khan: He's a good friend of mine, yeah.
642
00:48:55,888 --> 00:48:56,358
Tim: Oh good.
643
00:48:56,493 --> 00:48:57,723
Zeeshan Ali Khan: Yeah, he's a friend of mine.
644
00:48:58,418 --> 00:49:09,958
Tim: and he also, he gave a wonderful talk, very
jet lagged about, about font kerning and and
shaping the Euler curve, which is this sort of.
645
00:49:10,393 --> 00:49:11,833
Perfect spiral.
646
00:49:12,013 --> 00:49:18,713
Anyway, sorry, the, so the, they, so in Linux.
647
00:49:19,088 --> 00:49:21,058
There's a Linux distro.
648
00:49:21,378 --> 00:49:35,708
So the build system is now preferred is Mason, which is very
different in its approach than Cargo, sorry, Rust project.
649
00:49:36,398 --> 00:49:39,368
Mason actually does understand how to build Rust.
650
00:49:39,398 --> 00:49:45,408
It can invoke Rust C, but then you give up on the rest of Cargo.
651
00:49:45,528 --> 00:49:48,113
You don't have the whole of crates
652
00:49:48,413 --> 00:49:49,093
Zeeshan Ali Khan: dependency downloads.
653
00:49:49,093 --> 00:49:52,813
Yeah that's very true.
654
00:49:52,913 --> 00:49:57,963
And the main thing is that what the idea
is that he doesn't want to, talk to Cargo.
655
00:49:58,003 --> 00:49:59,313
He wants to talk to Rust C.
656
00:49:59,893 --> 00:50:02,083
Because that's his approach for all the projects.
657
00:50:02,093 --> 00:50:05,103
So I see his his problem with Cargo.
658
00:50:05,463 --> 00:50:10,763
And and the problem is that Rust people
are like, no, but Cargo is the tool to use.
659
00:50:10,773 --> 00:50:11,643
Like, why don't you use Cargo?
660
00:50:11,673 --> 00:50:16,323
No, I want to talk to the compiler because
my tool is on the same level as Cargo.
661
00:50:16,323 --> 00:50:18,293
So why should I be talking to Cargo?
662
00:50:18,995 --> 00:50:21,465
There is now there's now some momentum in there.
663
00:50:21,465 --> 00:50:25,585
There's one person, Javier, he has done already some work.
664
00:50:25,775 --> 00:50:28,835
You already can have cargo like Crystal.
665
00:50:28,835 --> 00:50:31,515
io dependencies in your Rust projects.
666
00:50:31,515 --> 00:50:36,275
It's already possible, but there is
some Some work you need to do for that.
667
00:50:36,345 --> 00:50:48,895
So you need to write these files I think they're called RAP
files if I'm not mistaken I could be wrong about the name
But you have to for each of your dependency you have to
write that and tell Mason with that what is my dependency?
668
00:50:48,895 --> 00:50:50,535
Where do you get it and all that stuff?
669
00:50:51,425 --> 00:51:03,440
But he's now working on making that obsolete so they can
be automatically generated for all your dependencies And
then after that is done, you there is, this excuse is
gone for not using Rust in systems programming world.
670
00:51:03,772 --> 00:51:06,062
For application, it's already not the case.
671
00:51:06,112 --> 00:51:11,642
There is projects in GNOME world a
lot of actually new apps in, in GNOME.
672
00:51:11,977 --> 00:51:21,927
They are in done in Rust, so because the new blood, they want
to use some, a new modern programming language that is out there
that they don't want to use, see that is going away, hopefully.
673
00:51:22,427 --> 00:51:23,307
So yeah it's there.
674
00:51:23,317 --> 00:51:23,827
It's coming.
675
00:51:24,197 --> 00:51:25,347
And I'm talking to people, right?
676
00:51:25,387 --> 00:51:29,382
I'm, friends with Leonard the system D guy, and friends with UC.
677
00:51:29,482 --> 00:51:32,362
And so I'm trying my best, but it's a bit hard.
678
00:51:32,382 --> 00:51:41,422
It's especially if you have developed a huge
project, very successful, huge project, it has a
huge momentum like system D moving towards Rust.
679
00:51:41,702 --> 00:51:42,752
It's not an easy task.
680
00:51:42,782 --> 00:51:46,472
So you want everything to be in place before you start that project.
681
00:51:46,652 --> 00:51:47,462
That whole project.
682
00:51:47,812 --> 00:51:47,942
So
683
00:51:48,112 --> 00:51:49,052
Tim: it here, folks.
684
00:51:49,062 --> 00:51:51,482
They are rewriting system D and Rust.
685
00:51:51,532 --> 00:51:52,212
Linut.
686
00:51:52,422 --> 00:51:59,852
Zeeshan Ali Khan: are many folks who have tried that,
and I think the only time it will happen is that when
Lennart says, okay, enough is enough let's do it.
687
00:52:00,102 --> 00:52:04,792
And the thing is, Lennart is very, is an extremely pragmatic guy.
688
00:52:05,092 --> 00:52:10,707
He he has his points, and it will take time, but I
think eventually I'm hopeful that it will happen.
689
00:52:10,897 --> 00:52:12,147
He hasn't said no ever.
690
00:52:12,497 --> 00:52:16,437
Whenever I talk to him about Rust, coding
in Rust, he has never, ever said no.
691
00:52:16,627 --> 00:52:19,437
He has always talked about problems, why he's not doing it.
692
00:52:19,887 --> 00:52:21,857
So there is, that's a very good sign.
693
00:52:22,517 --> 00:52:23,507
Eventually it will happen.
694
00:52:24,687 --> 00:52:37,597
Tim: I look, I think that the things that are
so fundamental like system D should no longer
be written in languages that are memory unsafe.
695
00:52:39,217 --> 00:52:40,127
Zeeshan Ali Khan: Yeah, for sure.
696
00:52:40,577 --> 00:52:42,757
Tim: It's too dangerous.
697
00:52:43,177 --> 00:52:43,827
We,
698
00:52:44,127 --> 00:52:44,947
Zeeshan Ali Khan: Lennart agrees.
699
00:52:45,007 --> 00:52:45,737
He agrees to that.
700
00:52:45,767 --> 00:52:47,787
Like it's on theoretical level.
701
00:52:47,787 --> 00:52:48,577
He does agree.
702
00:52:48,627 --> 00:52:50,047
So yeah, you're right.
703
00:52:51,177 --> 00:52:59,117
Tim: Or you probably had a few questions or that you
would like to talk about and I don't think I've given
you the opportunity to ask or to add to the conversation.
704
00:53:00,447 --> 00:53:00,997
Zeeshan Ali Khan: No worries.
705
00:53:01,047 --> 00:53:06,207
What I could share it's interesting because,
as like I came from the C world, right?
706
00:53:06,207 --> 00:53:10,162
So for me, Everything was less unsafe, right?
707
00:53:10,262 --> 00:53:20,562
I was just not used to this way of always thinking in
terms of safety, but when I started doing Rust more
and more, I stopped thinking in those terms, right?
708
00:53:20,562 --> 00:53:22,302
I was more thinking in terms of how do you do it?
709
00:53:22,492 --> 00:53:26,502
And I would never, I was never really
thinking how to do it in unsafe Rust.
710
00:53:26,702 --> 00:53:29,652
Even if in some cases it would be fine.
711
00:53:30,292 --> 00:53:42,144
So I feel like I lost a skill because in, in Rust,
you have that opportunity to still do like possibly
unsafe things, but it doesn't have to be unsafe, right?
712
00:53:42,144 --> 00:53:45,964
Like just because you're saying unsafe doesn't really mean that.
713
00:53:46,404 --> 00:53:52,614
And there's a lot of times when I had later thought
about my code and I was like, why did I do it this way?
714
00:53:52,614 --> 00:53:53,694
So inefficient.
715
00:53:54,044 --> 00:53:55,704
So this was not needed.
716
00:53:56,344 --> 00:54:04,874
All I had to do was use some unsafe API or just even
myself do some pointer Stuff and then I could do it.
717
00:54:05,064 --> 00:54:17,154
And also because of that when I have to inter interface
each time with any c which I rarely do nowadays, but
each time I have to do it with the FFII I'm bit lost.
718
00:54:17,609 --> 00:54:31,929
I'm trying to understand how the C call is working, even for example,
even with libc recently, or windows sys, I was doing something with
it, and it took me half a day to understand how to make that call.
719
00:54:31,939 --> 00:54:37,509
It was just one function call with four parameters, and I
just couldn't figure it out, like, how do I do it safely?
720
00:54:38,239 --> 00:54:40,559
So that was a bit of a skill.
721
00:54:40,579 --> 00:54:41,969
I feel like I lost it.
722
00:54:42,359 --> 00:54:47,247
And I regret that, and I want to Get that back a bit.
723
00:54:47,547 --> 00:54:50,607
Because it, it has its advantages, those skills.
724
00:54:50,927 --> 00:54:54,527
So that's something I would say to anyone who comes from C background.
725
00:54:54,907 --> 00:54:58,367
If if you're to start writing Rust, just be careful.
726
00:54:58,577 --> 00:55:00,017
Don't lose that completely.
727
00:55:00,017 --> 00:55:01,647
Don't be afraid of unsafe.
728
00:55:02,037 --> 00:55:10,402
I know I read it in the book in the beginning, but I feel like I
am a bit scared of unsafe still because of how Rust works, right?
729
00:55:10,402 --> 00:55:11,572
Like you become scared of it.
730
00:55:11,902 --> 00:55:13,802
Just don't be scared of it.
731
00:55:13,852 --> 00:55:14,692
Sometimes it's okay.
732
00:55:14,792 --> 00:55:15,602
Just do unsafe.
733
00:55:15,962 --> 00:55:16,542
It will be okay.
734
00:55:17,797 --> 00:55:26,427
Tim: I think of the word the keyword unsafe as
meaning I am taking responsibility for the safety.
735
00:55:27,287 --> 00:55:42,420
Not that what you're doing is inherently unsafe, although yeah,
and maybe it comes back to the other point that you made earlier
that sometimes you think things that are very difficult actually
turn out to be quite easy or at least easier than you expected.
736
00:55:42,965 --> 00:55:51,173
And on the other side, you have, things that look
easy, like doing everything safely or using safe APIs.
737
00:55:51,543 --> 00:55:53,333
It turns out to be much, much harder.
738
00:55:53,413 --> 00:56:10,913
And so if you do have the experience of manipulating pointers or
doing lots of pointer arithmetic, and you understand represent
internal representations and Indian ness and lots of other
you have lots of knowledge about systems programming, then.
739
00:56:11,933 --> 00:56:17,363
You have tools available inside of Rust too,
and so you should feel free to use them.
740
00:56:18,313 --> 00:56:18,643
Zeeshan Ali Khan: Yeah.
741
00:56:19,123 --> 00:56:26,003
And I actually, I just got, I just remembered that
you are the author of the book that talks about it.
742
00:56:26,343 --> 00:56:27,953
I think you mentioned right in your book.
743
00:56:27,953 --> 00:56:28,813
It was a long time ago.
744
00:56:28,813 --> 00:56:29,203
I read it.
745
00:56:29,203 --> 00:56:29,893
I don't remember.
746
00:56:29,893 --> 00:56:33,963
But I think you talked about how to see unsafe and how to use unsafe.
747
00:56:34,013 --> 00:56:34,243
And
748
00:56:34,543 --> 00:56:35,343
Tim: Yeah I did.
749
00:56:35,343 --> 00:56:39,853
So I I wrote Rust in Action the book with the with the boxer
750
00:56:40,963 --> 00:56:46,513
Zeeshan Ali Khan: yeah, I know that you have written that book,
but I just remembered that you talk about unsafe bits in there.
751
00:56:46,813 --> 00:56:49,403
Tim: Yeah I actually I received a lot of criticism.
752
00:56:49,773 --> 00:56:50,303
Zeeshan Ali Khan: Oh, really?
753
00:56:51,433 --> 00:56:53,753
Tim: From anonymous reviewers.
754
00:56:54,433 --> 00:57:03,693
So these are people, when you write a technical book, the publisher
will send your book around to people to provide anonymous feedback.
755
00:57:03,693 --> 00:57:09,043
And I got some comments saying, Oh, you shouldn't
introduce unsafe for a book and for beginners.
756
00:57:10,333 --> 00:57:16,413
I'm like no, it's part of the language and
don't be scared of, it's just software.
757
00:57:17,758 --> 00:57:24,038
Zeeshan Ali Khan: Guess maybe they came from a different
background where they didn't need this ever and they thought
like they will never need it and they probably are right.
758
00:57:24,583 --> 00:57:24,863
Tim: yeah.
759
00:57:24,863 --> 00:57:33,333
And I, and the other thing is I thought it was fun to say
let's try mem transmute and let's treat a floating point.
760
00:57:34,203 --> 00:57:42,708
It's like an unsigned integer and it's just bits and we can, yeah
but if the time has come where we really need to wrap up the call,
761
00:57:43,008 --> 00:57:44,948
Zeeshan Ali Khan: yeah, it's good.
762
00:57:44,978 --> 00:57:45,738
It's so interesting.
763
00:57:45,778 --> 00:57:47,148
I don't want to wrap it up, but
764
00:57:48,963 --> 00:57:49,993
Tim: We just got to the good bit.
765
00:57:50,363 --> 00:57:54,363
Maybe we will schedule another call to talk about
766
00:57:54,438 --> 00:57:55,418
Zeeshan Ali Khan: sure, I'm here.
767
00:57:56,248 --> 00:57:56,558
Yeah,
768
00:57:57,363 --> 00:57:59,693
Tim: In a few months time, I'll give you a break.
769
00:57:59,813 --> 00:58:01,803
Enjoy your time off.
770
00:58:01,863 --> 00:58:05,393
I hope everything is well with you and your family.
771
00:58:05,673 --> 00:58:07,183
It's been a real pleasure to talk.
772
00:58:07,193 --> 00:58:11,823
Thank you very much for supporting me on on this new podcast idea.
773
00:58:12,083 --> 00:58:13,553
It's been a pleasure.
774
00:58:13,843 --> 00:58:17,063
Zeeshan and I met in Berlin.
775
00:58:17,513 --> 00:58:18,548
When did we first meet?
776
00:58:18,848 --> 00:58:20,238
Zeeshan Ali Khan: That was no, that was second time.
777
00:58:20,398 --> 00:58:22,118
I think we met in the rest.
778
00:58:22,208 --> 00:58:23,048
EuroRust, I think.
779
00:58:23,373 --> 00:58:24,043
Tim: Oh, EuroRust.
780
00:58:24,063 --> 00:58:24,423
Okay.
781
00:58:24,828 --> 00:58:25,118
Zeeshan Ali Khan: Yeah.
782
00:58:25,123 --> 00:58:29,423
Yeah, we were hanging out in the I don't even
remember which city it was, but Brussels, I think.
783
00:58:29,723 --> 00:58:30,413
Tim: It was Brussels.
784
00:58:30,413 --> 00:58:30,493
Yeah.
785
00:58:30,643 --> 00:58:30,703
Zeeshan Ali Khan: it?
786
00:58:31,143 --> 00:58:31,383
Yeah.
787
00:58:31,543 --> 00:58:33,013
Tim: Oh yeah, Brussels, we had lunch.
788
00:58:34,123 --> 00:58:36,773
Zeeshan Ali Khan: We had breakfast but I think we had lunch too.
789
00:58:37,223 --> 00:58:37,703
Anyway, yeah,
790
00:58:38,003 --> 00:58:38,663
Tim: Yeah, okay.
791
00:58:38,843 --> 00:58:39,263
Okay.
792
00:58:39,293 --> 00:58:39,993
You have a nice day.
793
00:58:40,393 --> 00:58:41,413
I am going to go to bed.
794
00:58:41,463 --> 00:58:42,943
I will see you online.
795
00:58:42,963 --> 00:58:43,273
Take care.
796
00:58:43,273 --> 00:58:43,533
Bye.
797
00:58:44,023 --> 00:58:44,503
Zeeshan Ali Khan: Yeah.
798
00:58:44,563 --> 00:58:45,203
Thanks so much, Tim.