TRASCRIZIONE 🔗
WEBVTT
00:00:01.610 --> 00:00:06.710
This is Rust in Production, a podcast about companies who use Rust to shape
00:00:06.710 --> 00:00:07.790
the future of infrastructure.
00:00:08.210 --> 00:00:09.830
My name is Matthias Endler from
00:00:09.830 --> 00:00:13.770
corrode, and I welcome you to this very special episode of the podcast.
00:00:14.070 --> 00:00:18.710
I had the pleasure to travel to Berlin and meet with Scott Chacon and Kiril
00:00:18.710 --> 00:00:20.130
Videlov from GitButler.
00:00:20.290 --> 00:00:24.890
We talk about GitHub, Git Internals, and how the team at GitButler is refining
00:00:24.890 --> 00:00:26.490
Git branching with Rust.
00:00:29.450 --> 00:00:35.890
Scott, Kiril, thanks so much for having me and if you have a few minutes to
00:00:35.890 --> 00:00:37.350
introduce yourself that would be amazing.
00:00:37.830 --> 00:00:41.870
Yeah, thanks for inviting us. So my name is Scott Chacon, I was one of the co-founders
00:00:41.870 --> 00:00:44.530
of GitHub way back in the day, I'm very old,
00:00:44.670 --> 00:00:48.870
and today Kiril and I and Anne have started a new company called Git Butler
00:00:48.870 --> 00:00:52.250
and so we're spending all of our time on that which is partially written in
00:00:52.250 --> 00:00:55.530
Rust which is I think why we're on the show. Yeah, that's me.
00:00:57.050 --> 00:01:00.930
All right. Thanks for having me on the show as well. My name is Kiril.
00:01:01.130 --> 00:01:04.430
I'm a software engineer, co-founder of GitButtler.
00:01:04.710 --> 00:01:08.670
I've been working with version control stuff for a number of years now.
00:01:08.830 --> 00:01:13.230
So I'm kind of really, really excited about what we're building at GitButtler.
00:01:15.740 --> 00:01:19.100
So a couple of weeks ago, I was at the We Are Developers conference,
00:01:19.120 --> 00:01:21.660
and this is where I met you guys.
00:01:21.920 --> 00:01:26.000
But in fact, I know one of you at least for a very, very long time,
00:01:26.180 --> 00:01:29.560
because, Scott, you wrote a book called ProGit.
00:01:29.820 --> 00:01:34.240
And yeah, you taught me Git back in the day. It's kind of crazy.
00:01:34.600 --> 00:01:40.660
And it was amazing. So I know that you are amazing when it comes to communication,
00:01:40.660 --> 00:01:45.540
when it comes to developer products. I guess you care a lot about developers.
00:01:45.740 --> 00:01:49.000
In general and what i
00:01:49.000 --> 00:01:54.320
find interesting about git butler is that i think it's an iteration on what
00:01:54.320 --> 00:02:01.400
you did before so it's maybe you can express it in your own words how would
00:02:01.400 --> 00:02:05.760
you describe git butler to someone who maybe is aware of github and git already.
00:02:05.760 --> 00:02:08.880
Yeah i mean i think i think kind of the impetus
00:02:08.880 --> 00:02:11.700
for this was was a product that Kiril had done
00:02:11.700 --> 00:02:14.740
before which was called sturdy and it
00:02:14.740 --> 00:02:17.420
was a different take on version control that that was kind
00:02:17.420 --> 00:02:20.280
of asking questions like you know why is version control not
00:02:20.280 --> 00:02:23.360
more like google docs you know where you're not committing
00:02:23.360 --> 00:02:26.360
stuff but it is doing version control right like there's other ways
00:02:26.360 --> 00:02:29.640
of doing version control than than how software developers do it and i
00:02:29.640 --> 00:02:33.540
found that really compelling of just rethinking sort of the client i think i
00:02:33.540 --> 00:02:38.940
think github did a relatively good job of making sort of how people are using
00:02:38.940 --> 00:02:43.040
mailing lists type type things approachable but there was no we never really
00:02:43.040 --> 00:02:47.240
owned the client right like when we never really tried to make the client experience better.
00:02:47.340 --> 00:02:50.940
We just kind of relied on Git and all of the existing Git clients,
00:02:51.200 --> 00:02:53.860
most of which wrapped the Git CLI and those commands.
00:02:54.080 --> 00:02:58.420
And nobody really stepped back and said, if we did this from scratch,
00:02:58.600 --> 00:02:59.480
how would we do this, right?
00:02:59.560 --> 00:03:02.200
If the GitHub guys sort of created the client in the first place,
00:03:02.340 --> 00:03:03.520
what might it look like today?
00:03:03.800 --> 00:03:08.680
And I find that fascinating. So I think that's kind of where it started.
00:03:09.520 --> 00:03:14.100
And, and it's, it's a, an interestingly difficult thing to do, right.
00:03:14.240 --> 00:03:18.040
To, to kind of, to take, to go to first principles on something that you've
00:03:18.040 --> 00:03:19.240
been using for a really long time.
00:03:19.320 --> 00:03:22.980
Like it's been around for, I mean, like you said that I wrote ProGit the first
00:03:22.980 --> 00:03:26.060
version of that in 2009, right. So that was 15 years ago.
00:03:26.480 --> 00:03:29.820
And so there's, there's a whole generation of people that have never used anything other than git.
00:03:29.820 --> 00:03:36.120
And so to take a step back and say, let's just throw everything away and figure
00:03:36.120 --> 00:03:42.300
out what can we imagine would be an ideal workflow, like not sort of leaning
00:03:42.300 --> 00:03:44.560
on anything that came before, what might that look like?
00:03:44.560 --> 00:03:48.680
And that's exciting to me every day like it's always fun to work on it's always
00:03:48.680 --> 00:03:51.600
fun to reimagine kind of review processes or,
00:03:52.120 --> 00:03:57.200
how to share work or how to talk about work and how to get work integrated into
00:03:57.200 --> 00:04:02.080
some sort of production mainstream you know line and so that's where it started
00:04:02.080 --> 00:04:07.420
it's actually kind of funny because I feel like you mentioned ProGit like I think.
00:04:08.380 --> 00:04:11.800
One of the reasons that I've been successful in these
Load full transcript
things that I'm doing
00:04:11.800 --> 00:04:17.300
is that I'm not very smart so I think You know, if Linus or something creates
00:04:17.300 --> 00:04:19.380
a CLI, you know, version control system,
00:04:19.560 --> 00:04:22.960
it's really hard to use because he's very smart and he just assumes that everybody
00:04:22.960 --> 00:04:24.800
else is going to take the time to learn it.
00:04:25.100 --> 00:04:27.740
And I had I really struggled with it.
00:04:27.860 --> 00:04:30.940
And so when I finally figured out kind of how to learn it and use it,
00:04:31.040 --> 00:04:35.180
I started writing about it because I was like this took me way too long to do.
00:04:35.280 --> 00:04:38.680
And so I want to do and it's kind of the same with the CLI, right?
00:04:38.740 --> 00:04:41.940
It took me a really long time kind of to learn how to be good at Git.
00:04:41.940 --> 00:04:46.460
And so I want to make something that makes it makes you be able to do the same
00:04:46.460 --> 00:04:48.980
things where you're not worrying about that and spending your time and your
00:04:48.980 --> 00:04:51.500
effort on on how do I rebase, you know,
00:04:51.780 --> 00:04:54.380
stuff properly, but but to give
00:04:54.380 --> 00:04:57.520
you the same tools, but make it much more approachable and much more easy.
00:04:59.830 --> 00:05:05.250
A while ago, you wrote a blog post that kind of became a phenomenon.
00:05:05.550 --> 00:05:10.870
It was on Hacker News. I saw it all around the web. It was titled Why GitHub Won.
00:05:11.290 --> 00:05:17.110
And in that article, you also compare Git with things that came before Git, like SVN.
00:05:17.590 --> 00:05:21.690
And sometimes it helps to learn from the past. Are there things out there that
00:05:21.690 --> 00:05:24.850
you got inspired by when starting Git Butler?
00:05:25.270 --> 00:05:31.230
Any new ideas that have not been integrated into any version control system right now?
00:05:31.770 --> 00:05:34.030
Yeah, there's lots of stuff. I mean, there's lots of stuff in,
00:05:34.170 --> 00:05:38.730
like I said, in Kiril's product Sturdy, where it would kind of be live streaming
00:05:38.730 --> 00:05:39.990
the changes that you're doing.
00:05:40.710 --> 00:05:46.810
I think one of the main things that we looked at was, I feel like the git commit is overloaded.
00:05:46.930 --> 00:05:51.850
And so you use it to save your work. So people do work in progress commits, right?
00:05:51.990 --> 00:05:54.610
When that's not really committing, it's not really documenting a change.
00:05:54.610 --> 00:05:57.490
It's just saving your work, which I think is kind of stupid.
00:05:57.670 --> 00:06:00.110
Like with Kiril's, you didn't have to do that because it was constantly saving
00:06:00.110 --> 00:06:01.670
and it was constantly pushing in the background.
00:06:01.930 --> 00:06:05.270
And Git Brothers has this timeline thing that kind of does a version of that
00:06:05.270 --> 00:06:06.390
that I think is really nice.
00:06:06.830 --> 00:06:10.950
It also, Git commit is used to share your change. You can't push anything over
00:06:10.950 --> 00:06:12.170
the wire unless you commit it.
00:06:12.270 --> 00:06:17.010
So people will also do commits just to be able to push it somewhere,
00:06:17.310 --> 00:06:19.490
right? So one is saving, one is sharing.
00:06:19.770 --> 00:06:23.230
And then the third is actually documenting, which is what people think it's
00:06:23.230 --> 00:06:27.450
used for, right? But it's actually used for all of these other things and it's
00:06:27.450 --> 00:06:30.070
kind of overloaded to do these things because it's the only way you can do them.
00:06:30.210 --> 00:06:34.010
And I think being able to separate that in a client is one of the main important
00:06:34.010 --> 00:06:37.190
things that we want to try to hit first, right, is we're backing up your stuff
00:06:37.190 --> 00:06:38.210
whether you commit or not.
00:06:39.220 --> 00:06:42.300
We're able to save and push that and share that with people,
00:06:42.420 --> 00:06:45.180
whether you commit or not, right? Like even work in progress stuff,
00:06:45.180 --> 00:06:46.380
you can get some review on, right?
00:06:46.700 --> 00:06:51.960
And then you can use your commits to actually have a nice documentation of what you're doing.
00:06:52.220 --> 00:06:56.380
And so, yeah, there's a lot of, I think, tools that came before, even like,
00:06:56.540 --> 00:07:02.220
you know, I feel like we were trying to solve one very specific problem with
00:07:02.220 --> 00:07:05.760
distributed version control systems, but we lost other strengths of centralized
00:07:05.760 --> 00:07:08.020
version control systems. Like they're not all horrible, right?
00:07:08.100 --> 00:07:12.620
Like being able to say, hey, I'm working on this file. Like we all got frustrated.
00:07:12.820 --> 00:07:15.880
Those of us that are old enough to have used centralized version control systems.
00:07:16.020 --> 00:07:20.040
Like you get frustrated that a file is locked and you can't edit it or you can't,
00:07:20.060 --> 00:07:22.620
you know, if somebody locks it in per force or something, right?
00:07:22.980 --> 00:07:26.180
Like it's very frustrating, but you know that they're working on that file.
00:07:26.180 --> 00:07:32.320
And so, you know, or if it doesn't necessarily mean like we need to get to the
00:07:32.320 --> 00:07:35.220
point where I can't edit it, but it would be nice to say, hey,
00:07:35.400 --> 00:07:37.920
did you know that Kiril is working on that too, right?
00:07:38.040 --> 00:07:40.300
Like you guys are probably going to have merge conflicts at some point.
00:07:40.700 --> 00:07:43.380
You might want to look at that before it becomes too bad, right?
00:07:43.540 --> 00:07:47.700
The way that people tend to do it with sort of GitHub-based workflows now is,
00:07:47.840 --> 00:07:50.140
you know, you work on something, somebody else works on something.
00:07:50.260 --> 00:07:54.360
Whoever merges first has 0% of the work and whoever merges second has 100% of
00:07:54.360 --> 00:07:55.400
the merge conflict work, right?
00:07:55.400 --> 00:07:58.820
And so like, I think there's a middle, there's some middle grounds in some of
00:07:58.820 --> 00:08:01.880
these things where we can look at older systems and say, what were they actually
00:08:01.880 --> 00:08:05.720
good at that Git and GitHub is not good at and, you know, what.
00:08:06.890 --> 00:08:10.970
You know, what's interesting from Bitkeeper, what's interesting from from mailing
00:08:10.970 --> 00:08:12.530
list patch workflows, right?
00:08:12.650 --> 00:08:16.690
Like, there are there are interesting things that they did that they do better
00:08:16.690 --> 00:08:19.390
than the workflows that we have today with sort of GitHub pull requests.
00:08:19.550 --> 00:08:23.110
And I think trying to learn from that and pull that into how can we productize
00:08:23.110 --> 00:08:27.250
that in a way that GitHub might have, right, like that makes it accessible and easy to use.
00:08:27.410 --> 00:08:31.290
I think that's a something only a slightly stupid person can do because I you
00:08:31.290 --> 00:08:33.270
know, you have to you have to get frustrated by it, right?
00:08:33.270 --> 00:08:39.870
I mean, one thing to add to your answer, like one thing that I think I did wrong
00:08:39.870 --> 00:08:44.530
in my previous project in version control was trying to reinvent everything, right?
00:08:44.650 --> 00:08:48.710
Like trying to reinvent version control entirely from scratch or like inventing
00:08:48.710 --> 00:08:51.670
the snapshotting entirely from zero.
00:08:51.950 --> 00:08:55.810
And that, well, that is very difficult. It turns out that Git is really,
00:08:55.890 --> 00:09:02.130
really good at that part. But it's also really difficult to have people adopt
00:09:02.130 --> 00:09:06.310
something that is not compatible with Git because Git is not just a tool.
00:09:06.850 --> 00:09:11.370
It's a format. It's a protocol. It's a protocol for distributing the software
00:09:11.370 --> 00:09:14.550
from your machine or from CI to a production environment.
00:09:14.810 --> 00:09:19.730
So I think that's a big one. So I think what's really interesting that we're
00:09:19.730 --> 00:09:23.830
doing at the moment is we are thinking about the workflow and we're thinking
00:09:23.830 --> 00:09:25.230
about the user interaction.
00:09:25.230 --> 00:09:31.110
But at the same time always producing compatible data structures like git data
00:09:31.110 --> 00:09:35.550
structures so at the end of the day what what the two outputs is is just git
00:09:35.550 --> 00:09:41.070
git trees that become branches and you can you can have that consumed by other
00:09:41.070 --> 00:09:42.470
tools that are in the ecosystem.
00:09:44.460 --> 00:09:48.760
I interacted with Git mostly from the command line. So I typed in my commands
00:09:48.760 --> 00:09:50.420
and then it would do something magically.
00:09:50.780 --> 00:09:55.380
But behind that, there's this .git folder, which a lot of people might know of.
00:09:55.560 --> 00:09:59.660
And there's an entire structure of objects and hashes and so on.
00:10:00.020 --> 00:10:06.380
Is that ill-specified or is it in effect really well-specified so that you can
00:10:06.380 --> 00:10:07.920
reimplement parts of it in Rust?
00:10:09.660 --> 00:10:13.680
It depends on what you're trying to abuse, right? So like we're,
00:10:13.800 --> 00:10:16.300
there's, there's a couple of, of libraries in Rust that are very good.
00:10:16.460 --> 00:10:20.080
LibGit2 is, or Git2RS is built on LibGit2.
00:10:20.280 --> 00:10:22.900
So it's, it's actually C, but it has the Rust bindings.
00:10:23.260 --> 00:10:27.300
And we worked on that at GitHub, you know, years ago. And now Git Oxide,
00:10:27.460 --> 00:10:31.560
and we, we work with Sebastian on, on trying to see which is sort of faster
00:10:31.560 --> 00:10:32.380
implementations of these.
00:10:32.480 --> 00:10:36.120
But, but the, the actual data structure in Git is relatively straightforward,
00:10:36.120 --> 00:10:39.220
I think most from, you know, what we're trying to do.
00:10:39.740 --> 00:10:43.880
The, but you know, we, we try to do some other stuff. We're learning some stuff
00:10:43.880 --> 00:10:45.920
from jujutsu from some other systems.
00:10:46.280 --> 00:10:49.780
And, you know, we want to inject things into the header and it took us a while
00:10:49.780 --> 00:10:53.900
to figure out there's no like RFC on sort of, you know, git like formats or
00:10:53.900 --> 00:10:54.980
protocols or anything. Right.
00:10:55.400 --> 00:10:59.000
Even, even like some of the server protocols are still documented by me,
00:10:59.200 --> 00:11:03.900
like just like learning it, but like, no, no, it's not written down in lots of places. Right.
00:11:03.960 --> 00:11:06.900
And so it's, it's, you have to kind of guess what's
00:11:06.900 --> 00:11:10.340
going to break because there's lots of different implementation there was no the
00:11:10.340 --> 00:11:13.360
one of the problems with git is that there was no like standard linkable
00:11:13.360 --> 00:11:17.060
library for for a very long time which is why libgit2 which is why it's called
00:11:17.060 --> 00:11:21.420
libgit2 right because originally it was libgita libgit.a but it was non-reentrant
00:11:21.420 --> 00:11:24.680
so just anytime you hit an error condition it would just exit and so you can't
00:11:24.680 --> 00:11:28.820
link anything to it because it'll just kill you know a gui or whatever and so
00:11:28.820 --> 00:11:32.840
they had this like unix philosophy of just shell out and run these commands and fork exec.
00:11:33.100 --> 00:11:39.800
And, and, and so, yeah, now it's, it's difficult to know what did JGit do the
00:11:39.800 --> 00:11:41.180
Java implementation, right?
00:11:41.340 --> 00:11:43.980
Or what did libgit2 do, or what does core git do?
00:11:45.020 --> 00:11:49.400
If it sees a null byte here, is it going to explode? If you add a header in
00:11:49.400 --> 00:11:52.540
the wrong place, like which of these implementations is going to have a problem?
00:11:52.720 --> 00:11:56.460
Will GitOxide, you know, it re-implemented a lot of this as well. Will it have a problem?
00:11:56.720 --> 00:12:00.740
And so since they didn't have a linkable library, there was just five,
00:12:01.600 --> 00:12:04.540
15, you know, re-implementations of this that different people use.
00:12:04.620 --> 00:12:08.680
And so we have to be a little careful of like, or try it out in lots of things.
00:12:08.780 --> 00:12:11.460
If we're going to do something that's very non-standard, something that core
00:12:11.460 --> 00:12:15.860
Git wouldn't do and be like, is this, I mean, I know it's not core Git,
00:12:16.020 --> 00:12:17.120
but like, is it acceptable?
00:12:17.280 --> 00:12:20.080
Like, well, everything else, ignore it so that we can, we can use it.
00:12:20.180 --> 00:12:22.220
Right. I mean, so that's always, that's always kind of fun.
00:12:23.500 --> 00:12:25.840
Did those implementations diverge over time?
00:12:26.780 --> 00:12:31.220
They've tried. I mean, diverge in that, in that, you know, nothing does everything
00:12:31.220 --> 00:12:34.600
that libgit A does, right? Like that the core Git library does.
00:12:34.760 --> 00:12:38.240
So even libgit 2 only does, you know, maybe 80% of stuff.
00:12:38.240 --> 00:12:41.240
Like there's even you know stuff that was merged maybe
00:12:41.240 --> 00:12:44.340
a year ago ref table stuff that that isn't that
00:12:44.340 --> 00:12:47.120
it doesn't work at all right and libgit2 or and
00:12:47.120 --> 00:12:50.340
gitoxide or in probably jgit even even though
00:12:50.340 --> 00:12:54.980
sean came up with the spec 10 years ago but yeah it's it's so it depends on
00:12:54.980 --> 00:12:58.260
what you're trying to do i think most of the core stuff is you know the old
00:12:58.260 --> 00:13:03.080
pack files and loose objects and all that stuff is is very standardized sub
00:13:03.080 --> 00:13:07.420
modules like once you start getting into things that the 10% of people use or 5% of people,
00:13:07.600 --> 00:13:10.480
then, then it gets a little bit, a little bit more iffy.
00:13:10.600 --> 00:13:15.000
A lot of the stuff in Git in the last, you know, eight years or so has been
00:13:15.000 --> 00:13:18.280
done by GitHub and Microsoft and GitLab and stuff like that,
00:13:18.360 --> 00:13:19.540
that are mostly server side anyways.
00:13:19.720 --> 00:13:23.200
Like it's trying to scale large server sort of implementation.
00:13:23.200 --> 00:13:26.020
So most of us don't run into it when we're doing it on client stuff.
00:13:26.280 --> 00:13:29.360
And that's a lot of the stuff that isn't implemented everywhere because it's
00:13:29.360 --> 00:13:31.240
just not worth it for most, most implementations.
00:13:31.400 --> 00:13:34.160
But, but yeah, it's, it's definitely, it's not standard, right?
00:13:34.160 --> 00:13:38.620
Like there's lots of different degrees of percentage of implementation from
00:13:38.620 --> 00:13:39.420
these different libraries.
00:13:40.350 --> 00:13:43.850
It makes it pretty hard, or at least in my mind as an engineer,
00:13:43.850 --> 00:13:45.890
I wouldn't even know where to start.
00:13:46.570 --> 00:13:51.110
So I wonder, Kiril, when you started working on the predecessor of GitButler,
00:13:51.290 --> 00:13:53.930
Sturdy, how did you get started with that?
00:13:54.230 --> 00:13:59.070
And did you just literally pop up .git folder and then start implementing?
00:13:59.770 --> 00:14:06.430
The error in my initial approach was trying to implement a brand new incompatible
00:14:06.430 --> 00:14:11.670
implementation of a version control system. So that was not even attempting to be compatible.
00:14:11.990 --> 00:14:15.670
So I think I'm ill-equipped to answer this in a good way.
00:14:15.850 --> 00:14:20.610
We tried something that was – so we had a file system watcher that would observe
00:14:20.610 --> 00:14:24.690
what happened on disk and then pick those changes up and attempt to create a
00:14:24.690 --> 00:14:30.770
snapshot and attempt to record that snapshot and then do that continuously and
00:14:30.770 --> 00:14:35.390
then handle the various corner cases that you can encounter accordingly.
00:14:35.490 --> 00:14:38.130
And that particular bit is really, really hard.
00:14:38.390 --> 00:14:43.470
So it was not long until we kind of, at the time, gave up on this approach and
00:14:43.470 --> 00:14:49.690
kind of shifted towards using Git as an engine, as a database for what we're trying to do.
00:14:50.010 --> 00:14:53.570
And did you shell out to the command line to use Git?
00:14:53.950 --> 00:14:57.470
So for applications that are trying to do something with Git,
00:14:57.770 --> 00:15:00.570
there are a number of ways of trying to do it.
00:15:00.650 --> 00:15:06.170
One is shelling out fork exec to the Git binary, perform the command and pick
00:15:06.170 --> 00:15:12.250
up the output. And that kind of can be limiting, and it can also be slow if
00:15:12.250 --> 00:15:13.770
you do it in a kind of tight loop.
00:15:14.050 --> 00:15:19.410
So for a lot of things, we would use libgit, libgit2 rather,
00:15:19.690 --> 00:15:26.050
in order to actually bind a proper library that would interface with Git structures.
00:15:26.450 --> 00:15:34.230
And for GitButler, this is actually our approach that we take in GitButler is we use O3.
00:15:34.230 --> 00:15:37.250
We have so we
00:15:37.250 --> 00:15:40.570
have libgit through a rust crate so
00:15:40.570 --> 00:15:43.970
we're interfacing with libgit libgit2 rather and we
00:15:43.970 --> 00:15:47.070
do a lot of tree manipulation or
00:15:47.070 --> 00:15:52.410
you know modifying git data structures that way and then for certain operations
00:15:52.410 --> 00:15:58.550
like fetching and
pushing it is difficult to do that with libgit because of
00:15:58.550 --> 00:16:05.810
you know differences in operating systems libgit2 has a its own transport for.
00:16:07.400 --> 00:16:13.440
SSH, you know, fetch and push. And that is difficult. So specifically for those
00:16:13.440 --> 00:16:15.360
operations, we fork exec.
00:16:15.780 --> 00:16:20.800
And now since recently, we have been playing around with GitOxide.
00:16:21.060 --> 00:16:26.900
And GitOxide is attempting to be, you know, a Git library, a Git compatible library.
00:16:27.060 --> 00:16:32.080
And that allows you to do the same things that you could do with LibGit2,
00:16:32.240 --> 00:16:36.320
but ideally in a faster way, ideally in a more flexible way.
00:16:36.900 --> 00:16:40.340
And it is faster. It is faster for a lot of use cases.
00:16:41.220 --> 00:16:44.280
Yeah, it's interesting. In the early days of GitHub, this was one of the first
00:16:44.280 --> 00:16:47.920
things that I worked on when I started at GitHub was we were fork-execing everything.
00:16:48.100 --> 00:16:52.740
But like fork-exec has a pretty big overhead if you're doing it thousands of
00:16:52.740 --> 00:16:55.800
times, right? And you're trying to do it in one web request or something like that.
00:16:56.060 --> 00:16:59.860
And so I would go in and look at what was the slowest and try to reimplement
00:16:59.860 --> 00:17:04.380
those things in Ruby, like just in pure Ruby, because that's what we were using
00:17:04.380 --> 00:17:06.400
on the back end. And we're kind of doing the same thing, right?
00:17:06.460 --> 00:17:10.120
It's like, if we can take a fork exec overhead, it's almost always faster and
00:17:10.120 --> 00:17:11.420
definitely compliant, right?
00:17:11.880 --> 00:17:16.860
If we can do it in libgit2, then there's a nice interface for that in Rust,
00:17:17.080 --> 00:17:19.480
right? And it runs in C and it's fairly cross-platform.
00:17:19.600 --> 00:17:23.760
And then if we can do it as fast as possible, like if we can do it in git oxide,
00:17:23.860 --> 00:17:25.560
then it's nice because it's purely in Rust, right?
00:17:25.620 --> 00:17:28.700
And so like now it's not even doing the C bindings or anything.
00:17:28.880 --> 00:17:31.620
And so, yeah, I mean, it's fun.
00:17:32.000 --> 00:17:33.920
It makes for a really interesting code base.
00:17:33.920 --> 00:17:36.020
I have not shared this with you, Scott, yet.
00:17:36.400 --> 00:17:37.060
Oh, no.
00:17:37.680 --> 00:17:42.760
So recently we migrated the way we fetched the branches, the branches data,
00:17:43.040 --> 00:17:45.480
or listing just branches in a repository.
00:17:45.960 --> 00:17:50.980
We're now using GitOxite for that. And it appears that at the minute we have
00:17:50.980 --> 00:17:55.460
the fastest client at fetching all branches.
00:17:56.580 --> 00:18:01.540
So the test repository had 20,000 branches, which I think is a ludicrous amount of branches.
00:18:01.540 --> 00:18:06.460
I don't know who needs that many. But in that scenario, our app is currently
00:18:06.460 --> 00:18:11.880
faster than the CLI in answering the question, what are my 20,000 branches?
00:18:12.280 --> 00:18:18.240
How do you measure that? Do you have some sort of benchmarking tool for this? Or how do you do that?
00:18:18.240 --> 00:18:21.320
A very primitive timestamp-based approach.
00:18:21.740 --> 00:18:29.220
And you get some granularity by having a lot of branches and working with big repository, I guess.
00:18:29.280 --> 00:18:36.040
So the particular repository is the GitLab repo. And that one has a lot of branches. I don't know why.
00:18:36.400 --> 00:18:40.820
And just listing them, all of them in the CLI is...
00:18:41.580 --> 00:18:43.540
A little bit slow and we do it faster.
00:18:43.540 --> 00:18:49.860
Maybe it sounds almost tautological but at some point you needed to decide what
00:18:49.860 --> 00:18:54.580
language to use to write git butler in and of course you could have picked c
00:18:54.580 --> 00:19:01.060
but you could have picked any other language but you chose Rust to do so so.
00:19:01.060 --> 00:19:06.480
For our use case i think it's not necessarily the language characteristics that
00:19:06.480 --> 00:19:12.800
were a driving driving force, but rather the ecosystem or the libraries and
00:19:12.800 --> 00:19:14.440
the tools that are available.
00:19:14.620 --> 00:19:20.100
In particular, in terms of what we're trying to achieve with the application,
00:19:20.400 --> 00:19:25.500
so we're building something that manipulates Git data structures on your computer.
00:19:25.680 --> 00:19:31.140
So we need to be able to interface with Git and with the file system in a good way.
00:19:31.280 --> 00:19:37.100
We need to be able to create custom user interfaces. We need to have that set
00:19:37.100 --> 00:19:39.360
up in a secure way, in a performant way.
00:19:39.460 --> 00:19:43.440
We need to be able to cross-compile for different platforms.
00:19:44.000 --> 00:19:49.520
And it just so happens that on that point of being able to create custom interfaces,
00:19:49.540 --> 00:19:52.100
there is this toolkit called Tauri.
00:19:52.320 --> 00:19:58.000
So Tauri is a framework or a toolkit that allows you to create desktop apps and
00:19:58.000 --> 00:20:00.960
use web technologies for the user interface.
00:20:00.960 --> 00:20:07.060
In a way, it's similar to Electron, but what's different from Electron is they
00:20:07.060 --> 00:20:08.860
use the native operating system
00:20:08.860 --> 00:20:14.600
WebView, so they don't need to package the Chromium with the binary.
00:20:15.540 --> 00:20:21.240
And also, they have a very strict and specific way of communicating between
00:20:21.240 --> 00:20:28.880
the user interface code and the core of the application with the positive impact
00:20:28.880 --> 00:20:31.020
for security. right now so yeah.
00:20:31.020 --> 00:20:34.460
No i was gonna say i i just from a i
00:20:34.460 -->
00:20:37.220
i was trying to remember us talking about this like when
00:20:37.220 --> 00:20:40.560
we first approached it because we did his so sturdy
00:20:40.560 --> 00:20:44.160
was was an electron app right right right so he had some electron experience
00:20:44.160 --> 00:20:48.280
i obviously you know i came from from github so we did Atom and extracted electron
00:20:48.280 --> 00:20:52.360
out of it and so i i've i even wrote some documentation for electron or for
00:20:52.360 --> 00:20:56.520
Atom actually back in back in the day and so i was familiar with that but like
00:20:56.520 --> 00:20:59.240
when we were looking at how do we build the desktop app,
00:20:59.750 --> 00:21:03.690
that is interesting, right? I think those are really the only two options that
00:21:03.690 --> 00:21:07.870
came up that are, that could, you know, we could easily put it out on all the
00:21:07.870 --> 00:21:08.910
platforms that we wanted to.
00:21:09.070 --> 00:21:12.730
It worked more or less the same. We could do the user interface in HTML and JavaScript.
00:21:13.470 --> 00:21:16.330
And then really the question was the difference of the backend.
00:21:16.530 --> 00:21:18.530
Is it going to be a node or is it going to be in Rust?
00:21:18.870 --> 00:21:21.610
And there was a node backend for a couple of days.
00:21:21.830 --> 00:21:25.530
Yeah, I mean, I mean, the, you know, when it comes down to it,
00:21:25.670 --> 00:21:30.550
I hate JavaScript, but I don't think that's actually what the deciding factor was.
00:21:30.710 --> 00:21:35.470
I think the deciding factor was, was A, we assumed that it would probably be
00:21:35.470 --> 00:21:41.430
faster and B, we want to do a CLI, I think, version of it at some point.
00:21:41.570 --> 00:21:46.230
And so it was kind of a nice concept to me, at least, that we could have the
00:21:46.230 --> 00:21:50.250
one user interface be in HTML and JavaScript, the backend, sort of the core
00:21:50.250 --> 00:21:54.450
crates and stuff be entirely in Rust, purely in Rust with nice APIs.
00:21:54.450 --> 00:21:58.510
And then we could write a CLI interface or TUI interface or something that would
00:21:58.510 --> 00:22:03.310
have all of the important stuff already done, right? And it would kind of work the same everywhere.
00:22:03.650 --> 00:22:07.410
And CLIs and Rust are much nicer to distribute than CLIs in Node, right?
00:22:07.530 --> 00:22:11.430
And so all of those things, I think, were kind of what tipped us over.
00:22:11.490 --> 00:22:16.370
I mean, it is nicer that it has smaller binaries because of using the operating
00:22:16.370 --> 00:22:21.050
system's sort of default web view, but it also causes some issues because we
00:22:21.050 --> 00:22:21.870
don't control it, right?
00:22:21.910 --> 00:22:27.590
And so there are problems with you know, some Linux distro using some ridiculous,
00:22:27.750 --> 00:22:32.150
you know, web view that we have to debug and be like, why isn't it working on this thing?
00:22:32.270 --> 00:22:35.650
Right. So I think, I feel like that's, that's pluses and minuses,
00:22:35.710 --> 00:22:40.210
but the, the, the, the idea of Rust being sort of the core library that we can
00:22:40.210 --> 00:22:43.730
throw whatever user interface on to do the things that we're, we're, you know,
00:22:44.030 --> 00:22:48.370
hopefully is battle tested and good at and not have to rewrite it in Swift and
00:22:48.370 --> 00:22:51.730
rewrite it, you know, do it, do it in a bunch of different languages or something per platform.
00:22:51.930 --> 00:22:56.890
Like all of those, I think made it fairly clear that Tauri would be a good idea.
00:23:00.160 --> 00:23:05.220
It's surprising because I don't hear that a lot, that people come to Rust also
00:23:05.220 --> 00:23:07.040
because of the nice UI libraries.
00:23:07.280 --> 00:23:11.340
And it feels like that was at least some factor. I don't know if Rust would
00:23:11.340 --> 00:23:14.900
have been a non-starter, if Tauri didn't exist. I don't think so.
00:23:15.180 --> 00:23:18.760
Maybe you would have split it up and maybe kept the back end written in Rust
00:23:18.760 --> 00:23:20.320
and the front end written in something else.
00:23:20.980 --> 00:23:24.540
It was certainly the gateway drug, right? We never.
00:23:24.820 --> 00:23:26.680
I don't think we ever would have chosen Rust.
00:23:26.680 --> 00:23:34.160
Nobody on the team had Rust experience. So we started working on this with zero Rust background.
00:23:34.760 --> 00:23:37.520
Yeah. It was a struggle for me.
00:23:38.100 --> 00:23:42.160
I've done systems programming in such a long time. Like I'm a Ruby guy,
00:23:42.260 --> 00:23:45.660
right? And like I'm coming in, I'm like, why can't I just fucking...
00:23:45.660 --> 00:23:48.360
I've seen the light. I think it's fantastic.
00:23:48.840 --> 00:23:51.960
I used ChatGPT a lot in the first days.
00:23:52.220 --> 00:23:56.580
And then I sat down and read the Rust book, thank God.
00:23:56.680 --> 00:24:00.120
Helped a lot that was the first time i'd even thought about the stack in the
00:24:00.120 --> 00:24:04.920
heap and like like since i was from college it was it's been such a long time we.
00:24:04.920 --> 00:24:10.260
Had Steve Klabnik on the podcast just a couple episodes ago so shout out to him.
00:24:10.260 --> 00:24:14.980
Yeah he was he's in the jj discord and and we we sort of said hi to each other
00:24:14.980 --> 00:24:19.080
there not not too long ago as well he's he actually wrote like speaking of other
00:24:19.080 --> 00:24:21.640
version control systems if you've done something on jujutsu yet,
00:24:22.400 --> 00:24:25.380
But Steve wrote like the tutorial book for that.
00:24:25.500 --> 00:24:29.320
So if you do want to learn Jujutsu, you have to kind of find his tutorial
00:24:29.320 --> 00:24:36.220
book that's online somewhere and read through that because it's a great sort of intro to that system.
00:24:37.800 --> 00:24:41.880
Yeah, he
also mentioned that on the podcast. So yeah, definitely if you want,
00:24:41.960 --> 00:24:43.200
you should definitely check it out.
00:24:43.200 --> 00:24:48.840
I've only sent one patch via Jujutsu, like one actual thing.
00:24:49.040 --> 00:24:54.080
And it was to correct some stuff in that tutorial book. So I'm also a co-author.
00:24:54.500 --> 00:24:58.460
I'm kidding. There's like, it's like a change of two lines or something.
00:24:58.620 --> 00:25:03.740
But I used that to learn how to use that system, actually. It was pretty cool. Thanks, Steve.
00:25:05.500 --> 00:25:08.720
Kiril, you had some previous Rust experience before? No, no.
00:25:08.760 --> 00:25:11.480
None of us. Nobody in the team had any Rust experience.
00:25:11.480 --> 00:25:15.460
Oh, wow. Okay. And how long did it take the both of you to pick up the language?
00:25:15.820 --> 00:25:19.920
It's not a competition. I'm just curious. Is it days, weeks, months, years?
00:25:20.160 --> 00:25:26.400
There are really different levels of competence. Like you can get started with
00:25:26.400 --> 00:25:28.640
messing things up very quickly, right?
00:25:29.060 --> 00:25:33.440
But to be truly productive and to truly know what you're doing,
00:25:33.620 --> 00:25:35.180
maybe like a month or something.
00:25:35.420 --> 00:25:36.020
What's your background?
00:25:36.540 --> 00:25:39.860
I mean, I'm a software engineer. So I've done a number of languages.
00:25:39.860 --> 00:25:44.660
I have enjoyed Go, I've done a bunch of Java, I've done some C.
00:25:45.480 --> 00:25:50.360
I had a phase of really being into Clojure. Like I really, really liked the
00:25:50.360 --> 00:25:53.200
Lisp style of programming.
00:25:53.760 --> 00:25:56.280
But essentially you have a different background than Scott.
00:25:57.470 --> 00:26:00.830
I mean, you're much, he's much more hardcore programmer than I am.
00:26:01.010 --> 00:26:02.510
I mean, computers are cool.
00:26:03.510 --> 00:26:06.410
I've, I've just done, I'm very, I'm a very practical programmer.
00:26:06.410 --> 00:26:08.710
Like I, I like whatever gets the job done easiest.
00:26:08.830 --> 00:26:11.810
And so that's usually been Ruby for me because I usually do websites.
00:26:11.990 --> 00:26:15.990
And so I, I, before that it was PHP, but I've been doing Ruby for,
00:26:16.090 --> 00:26:18.130
for 20 years now, at least.
00:26:18.390 --> 00:26:20.710
And I'm very comfortable with it. And anytime I try to do something,
00:26:20.830 --> 00:26:22.030
it usually comes down to that.
00:26:22.170 --> 00:26:24.950
Unless if I'm trying to do mobile apps, I'll do like react native or something
00:26:24.950 --> 00:26:28.030
because, you know, exposed like a nice, I'll just do, I'll do whatever's easiest
00:26:28.030 --> 00:26:30.190
to see if an idea works, I think.
00:26:30.470 --> 00:26:34.270
And so for, for Rust, I kind of still learned the minimal amount to get something
00:26:34.270 --> 00:26:37.830
to work. Like I'll still, I'll throw a patch in every once in a while.
00:26:37.990 --> 00:26:40.330
And then, you know, somebody will come in and be like, Jesus,
00:26:40.490 --> 00:26:44.130
Scott, and you know, make it, they'll fix it, but like, I'll get it to work
00:26:44.130 --> 00:26:46.570
and make sure that it's even a good idea.
00:26:46.750 --> 00:26:49.410
Right. And so that's, that's, you know, I'm old enough now that I don't have
00:26:49.410 --> 00:26:52.830
to, I don't have to learn new things. but.
00:26:52.830 --> 00:26:56.370
If you can maybe remember one of the things that you learned from rust which
00:26:56.370 --> 00:26:59.070
turned out to be surprisingly good what would it be.
00:26:59.070 --> 00:27:02.370
I mean i like yeah again
00:27:02.370 --> 00:27:05.090
i from the ruby world it's it's it couldn't be a more
00:27:05.090 --> 00:27:10.350
different language right and so i i do like the the compiler stuff like like
00:27:10.350 --> 00:27:15.230
it's it is nice to be like if it compile like you know most of it is dealing
00:27:15.230 --> 00:27:19.730
with compiler issues rather than runtime issues so so if it compiles and it
00:27:19.730 --> 00:27:22.630
actually runs something then it probably runs the way that I meant it to.
00:27:22.990 --> 00:27:26.850
Whereas in Ruby, you don't know until it runs into an issue and there's no good
00:27:26.850 --> 00:27:30.170
debugger and things like that in the same world.
00:27:30.250 --> 00:27:34.010
But like, it's very different doing systems programming and doing sort of Ruby,
00:27:34.150 --> 00:27:36.050
you know, almost scripting type programming, right?
00:27:36.270 --> 00:27:41.150
The error messages are so good. So good from the compiler. I think I'm still impressed.
00:27:41.370 --> 00:27:44.390
You know, like just having the compiler tell you, all right,
00:27:44.450 --> 00:27:49.450
you move this over here on this line, this part, this is super useful.
00:27:49.450 --> 00:27:53.330
I think you don't get this in C++ to my knowledge.
00:27:55.370 --> 00:27:57.590
So that's also ergonomics.
00:27:58.570 --> 00:28:02.890
Exactly. The getting started experience for me was fairly pleasant.
00:28:03.150 --> 00:28:10.190
There is some mountains to climb, but it's obvious that there is some thought
00:28:10.190 --> 00:28:14.650
put into getting people up to speed with Rust.
00:28:14.930 --> 00:28:18.250
I've also found that there's not a lot of boilerplate. like
00:28:18.250 --> 00:28:21.570
like i feel like if when i write you know like i
00:28:21.570 --> 00:28:24.330
don't know c c code i have to do a bunch of header files that kind of
00:28:24.330 --> 00:28:27.950
you know redeclares the same stuff like you're not you're not doing a lot of
00:28:27.950 --> 00:28:31.750
or java java has a lot of that right like just random bullshit that you're that
00:28:31.750 --> 00:28:34.910
you're typing out because you have to not because it actually tells the compiler
00:28:34.910 --> 00:28:39.790
something that's
valuable right or or new like i i feel like rust is relatively
00:28:39.790 --> 00:28:42.370
fast to write in i i don't always,
00:28:42.870 --> 00:28:45.010
have the entire memory model.
00:28:45.210 --> 00:28:49.210
Like I suck at lifetimes and things like that. And so I tend not to deal with
00:28:49.210 --> 00:28:52.690
them as little as possible until somebody's like, this is not how you do this.
00:28:52.930 --> 00:28:58.490
But I feel like it's still a fairly succinct language for a systems language, right?
00:28:58.650 --> 00:29:01.690
I was kind of constantly impressed by that.
00:29:03.130 --> 00:29:06.450
It was one thing that I found very difficult while getting started,
00:29:06.450 --> 00:29:13.290
which is the approach challenge for error handling or the way you want to structure
00:29:13.290 --> 00:29:14.790
your application error-wise.
00:29:15.270 --> 00:29:19.270
Now, I understand that there is the anyhow camp, and then there is the camp
00:29:19.270 --> 00:29:27.050
of using typed errors and just finding the balance or understanding which way one would use for,
00:29:27.270 --> 00:29:32.770
let's say, building a library versus building an application like ours, the trade-offs.
00:29:33.590 --> 00:29:38.370
Yeah, it is more challenging for... I think there's no right answer,
00:29:38.450 --> 00:29:43.730
right? And therefore, the ecosystem has not standardized on one thing. Yeah.
00:29:44.070 --> 00:29:46.070
Any tips on how to navigate that ecosystem?
00:29:46.610 --> 00:29:51.830
Well, I think understand what you're trying to achieve with errors. I think if you...
00:29:52.570 --> 00:29:55.490
I'm now repeating, I think, advice that I've read.
00:29:55.630 --> 00:29:59.890
But if you are creating a library, you have one set of...
00:29:59.890 --> 00:30:04.010
You're trying to set the expectations that other people have.
00:30:04.010 --> 00:30:08.190
In our case, we are building an application and creating.
00:30:09.410 --> 00:30:15.230
It so happens that for us creating types for all the different subsystems and
00:30:15.230 --> 00:30:21.530
functionalities in our application does not necessarily add the value to warrant
00:30:21.530 --> 00:30:24.270
the additional type creation and type conversion.
00:30:24.530 --> 00:30:29.750
So that was creating a boilerplate for us. And we've recognized that,
00:30:30.350 --> 00:30:32.110
okay, we care about what,
00:30:32.960 --> 00:30:38.640
So our application works on like an API. So you have commands that git processed
00:30:38.640 --> 00:30:40.900
and we do care what happened.
00:30:41.040 --> 00:30:46.380
We do care if there is an error at the end such that we can present it in a
00:30:46.380 --> 00:30:47.600
meaningful way to the user.
00:30:47.700 --> 00:30:54.180
But we seldomly have the application flow switch on the error types.
00:30:54.400 --> 00:30:59.600
And for that reason, because we have this user interface that is interacting
00:30:59.600 --> 00:31:01.380
with a core of Git Butler,
00:31:01.700 --> 00:31:07.480
we're using Anyhow, we're using Anyhow, and we're adding context to errors where appropriate,
00:31:07.660 --> 00:31:14.240
and we're adding error codes as context in such a way that that gets passed
00:31:14.240 --> 00:31:18.900
on to the front end, and then the front end knows what to do with the error codes.
00:31:19.040 --> 00:31:23.180
It was pretty funny having a team coming in that all had sort of different,
00:31:23.380 --> 00:31:26.840
like we all read books and we all copied from different code,
00:31:26.900 --> 00:31:29.820
and so we had three different ways of doing error reporting,
00:31:29.980 --> 00:31:31.840
like throughout the, throughout the application. Right.
00:31:32.080 --> 00:31:34.760
And then kind of had to go and clean all, had to choose one,
00:31:35.040 --> 00:31:37.380
right. Like figure out like what, what would be a good way?
00:31:37.480 --> 00:31:40.740
Is it anyhow, like, is it typed or like how, like, what do we choose?
00:31:40.880 --> 00:31:42.980
And now can we go through and make everything the same? Right.
00:31:43.100 --> 00:31:46.480
And it was like waves of, I mean, Kiril did a lot of this, right.
00:31:46.540 --> 00:31:50.600
Like going through and changing all of the error sort of handling stuff to try
00:31:50.600 --> 00:31:51.640
to be somewhat consistent.
00:31:51.800 --> 00:31:54.920
Right. But like, this is another thing of having a bunch of people start not
00:31:54.920 --> 00:31:58.420
knowing, like not really having a lot of previous background in this and just
00:31:58.420 --> 00:31:59.660
doing whatever seemed right.
00:31:59.980 --> 00:32:03.920
And not knowing, like nobody really had any particular taste at the beginning,
00:32:04.080 --> 00:32:07.420
but it's definitely gotten better as the longer that we've worked with it.
00:32:07.940 --> 00:32:13.900
Yeah, I think that error handling and also structuring an application that is growing and evolving.
00:32:15.170 --> 00:32:19.690
It's a non-obvious thing. How do you structure it? Do you have one crate or
00:32:19.690 --> 00:32:20.790
do you have multiple crates?
00:32:20.970 --> 00:32:26.390
Yeah, we went from like one crate to 50 crates, and now we're like at 20 crates or something.
00:32:26.750 --> 00:32:27.470
Actually, it's 31.
00:32:28.990 --> 00:32:36.490
How do you strike the balance there? So when to crate, crate, and when not to?
00:32:36.490 --> 00:32:39.490
So we we started off from a place of having
00:32:39.490 --> 00:32:42.910
very few and we had code
00:32:42.910 --> 00:32:46.350
depending on other code that should not have so
00:32:46.350 --> 00:32:49.810
i think when it
00:32:49.810 --> 00:32:52.790
comes to software in general i think a lot about this idea
00:32:52.790 --> 00:32:55.850
of optimizing for deletion what does
00:32:55.850 --> 00:32:58.610
it mean to optimize for deletion it means to be able to say
00:32:58.610 --> 00:33:01.430
okay i don't like this feature i want
to just delete it and if that
00:33:01.430 --> 00:33:04.210
feature is intertwined in 20 different places it's hard
00:33:04.210 --> 00:33:07.310
to delete but what i just said is just
00:33:07.310 --> 00:33:10.230
a fancy way of saying make modular software right it's
00:33:10.230 --> 00:33:14.370
it's not a new concept and so we
00:33:14.370 --> 00:33:19.150
recognized that this this was an issue for us we were adding things and old
00:33:19.150 --> 00:33:24.150
things were difficult to clean up so at some point we we just bit the bullet
00:33:24.150 --> 00:33:29.650
and and started splitting things off now i had i come from a background of using
00:33:29.650 --> 00:33:31.190
build systems like Bazel.
00:33:31.930 --> 00:33:36.430
And there you are really encouraged to make build targets or compilation targets
00:33:36.430 --> 00:33:37.990
that are small, kind of modular.
00:33:38.230 --> 00:33:43.610
And this also forces the dependency graph to be unidirectional and very explicit.
00:33:43.950 --> 00:33:46.070
And I think this explicitness.
00:33:47.310 --> 00:33:51.050
It forces you to think about the boundaries, forces you to consider,
00:33:51.530 --> 00:33:53.970
okay, do I want this to depend on these other things?
00:33:54.110 --> 00:33:56.870
Or you recognize that, oh, there's going to be a cycle here.
00:33:56.930 --> 00:34:00.330
It's impossible for me to make it a separate crate. Why is that?
00:34:00.590 --> 00:34:03.830
Maybe that should belong to this other functionality.
00:34:04.630 --> 00:34:09.710
So we mostly take package by feature approach or crate by feature.
00:34:11.010 --> 00:34:17.330
Or we strive to put different aspects of the client in separate crates.
00:34:17.850 --> 00:34:23.930
That means if I delete a crate, then I make a couple modifications and it mostly just works again.
00:34:24.270 --> 00:34:28.970
This is the cool thing about Rust. We've made such dramatic changes to the structure
00:34:28.970 --> 00:34:34.270
of not just where the code lives, but the interfaces and such.
00:34:34.630 --> 00:34:41.130
And it all just works because you have a statically typed language with a compiler that helps.
00:34:41.670 --> 00:34:48.930
So if you can get it to compile, it will work. That's the beauty of the setup that we've got.
00:34:49.170 --> 00:34:53.050
Yeah, I doubled down on that as well. Like you were asking what I liked about
00:34:53.050 --> 00:34:58.910
Rust and refactoring stuff is so nice in Rust compared to Ruby or any other
00:34:58.910 --> 00:35:02.290
language that I've done because you change the one thing to be kind of what
00:35:02.290 --> 00:35:03.650
do you want this call to look like now?
00:35:03.850 --> 00:35:07.530
And then it's like, here's the 47 other places that you're going to have a problem
00:35:07.530 --> 00:35:09.910
with. And you're like, I'll just start going through the list, right?
00:35:10.010 --> 00:35:12.910
Like it's, it's, if, you know, if you don't have some tool kind of helping you
00:35:12.910 --> 00:35:16.570
do this type of stuff, it's very clear that you've done your job or not. Right.
00:35:16.770 --> 00:35:20.230
And like 99% of the time you fix all those things and then you run it and it's
00:35:20.230 --> 00:35:21.470
like, yep, everything works. That's great.
00:35:21.890 --> 00:35:26.130
I've never, that's not in my, my, you know, history of working with software
00:35:26.130 --> 00:35:27.930
before. So it's, it's very nice.
00:35:29.610 --> 00:35:33.090
There is one thing on this subject matter that I've been thinking about,
00:35:33.190 --> 00:35:35.090
and I don't know the exact answer that is good.
00:35:35.270 --> 00:35:41.130
So now that we have our code base relatively modular, we have 31 crates.
00:35:42.590 --> 00:35:47.330
Well, some crates have modules, and in some cases we export the entire modules.
00:35:47.330 --> 00:35:50.270
And it is more difficult to discover
00:35:50.270 --> 00:35:52.990
what the API of a crate is when you
00:35:52.990 --> 00:35:55.850
have like a more nested or like more
00:35:55.850 --> 00:35:58.850
hierarchical surface area that is
00:35:58.850 --> 00:36:01.850
exported and I've recently been
00:36:01.850 --> 00:36:05.190
toying around with this idea of putting the or
00:36:05.190 --> 00:36:10.090
exporting the functions that are from inner modules of a crate just putting
00:36:10.090 --> 00:36:16.870
them in the root for easier discoverability and making it more obvious what
00:36:16.870 --> 00:36:22.390
the API is and what one can do with something. I do not know if that's a good idea.
00:36:23.270 --> 00:36:27.970
I would love to hear from somebody. Do you know if this is a good idea?
00:36:28.170 --> 00:36:33.150
So there is a blog post by Matt Clad, the creator of Rust Analyzer,
00:36:33.290 --> 00:36:37.730
and he describes that he likes to keep his hierarchy extremely flat,
00:36:38.070 --> 00:36:42.570
mostly for pragmatic reasons because he has a hard time coming up with names for things.
00:36:42.750 --> 00:36:46.890
And then if you put things into the wrong directory or into the wrong crate
00:36:46.890 --> 00:36:51.650
and sub-crate and module and whatever, then it becomes harder to move that out again.
00:36:51.810 --> 00:36:53.870
So it tries to keep it as flat as possible.
00:36:54.050 --> 00:36:56.370
So it goes along the lines of what you just described.
00:36:56.710 --> 00:36:57.970
So not totally wrong.
00:36:59.290 --> 00:37:02.990
It's a bit like Git branching. You can have branches upon branches,
00:37:02.990 --> 00:37:08.450
but at some point I do like to keep my hierarchy flat at least because I need
00:37:08.450 --> 00:37:10.010
to keep track of it in the end.
00:37:10.630 --> 00:37:14.850
Do you use something like preludes or a glob import?
00:37:16.320 --> 00:37:20.640
We avoid that. I don't think we do that anywhere.
00:37:21.040 --> 00:37:26.980
Yeah. I agree because I literally also wrote a blog post about it that maybe
00:37:26.980
--> 00:37:29.140
you shouldn't have a glob import or a preload for that.
00:37:30.800 --> 00:37:34.580
Does it mean you have something like an application and then on top of it you
00:37:34.580 --> 00:37:40.120
have a couple of library craze that technically you could use for any other reason?
00:37:40.360 --> 00:37:42.480
For example, interacting with Git itself.
00:37:43.260 --> 00:37:46.580
Well so we we have 31 crates
00:37:46.580 --> 00:37:49.380
and most of the if you if you just read what the
00:37:49.380 --> 00:37:52.660
titles are they're like different features from from the app and
00:37:52.660 --> 00:37:58.600
one of those crates is the to gitbutler-tauri that is the binary crate that
00:37:58.600 --> 00:38:03.040
bootstraps everything so we mentioned earlier that we yeah we're using Tauri
00:38:03.040 --> 00:38:08.100
but we are not really the core of the app is not necessarily dependent on There
00:38:08.100 --> 00:38:11.720
is one crate that combines the APIs,
00:38:12.260 --> 00:38:13.780
sets everything up, and exposes.
00:38:14.060 --> 00:38:20.740
But then we also have a CLI, a GitButler-CLI crate, which is mostly useful testing.
00:38:20.740 --> 00:38:22.800
But we have multiple binaries.
00:38:23.000 --> 00:38:30.080
So nothing in there is necessarily library-grade to be used or to be consumed
00:38:30.080 --> 00:38:32.740
by another application necessarily.
00:38:33.520 --> 00:38:38.780
But we have multiple things that can be built and composed. we can just as easily
00:38:38.780 --> 00:38:44.120
create a web server if that's what we needed to do out of the API.
00:38:45.060 --> 00:38:51.400
Nowadays, there's also Leptos and Dioxus and a couple of other UI libraries like Slint.
00:38:51.660 --> 00:38:56.840
Are you still content and happy with Tauri or did you run into any issues so far?
00:38:57.120 --> 00:39:00.840
Well, I mean, the user interface is Svelte, right?
00:39:01.000 --> 00:39:07.240
So it's basically just, here's a WebKit thing. It gives us a way to invoke calls to Rust.
00:39:09.140 --> 00:39:12.160
And so I think we're relatively happy with that because, you know,
00:39:12.240 --> 00:39:12.900
we have a bunch of JavaScript,
00:39:13.760 --> 00:39:18.140
programmers who are good at, I mean, we like CSS, we like, you know,
00:39:18.280 --> 00:39:22.060
we like, we like being able to, to build user interface with the tooling that
00:39:22.060 --> 00:39:24.600
we know from, from web, from building on the web.
00:39:25.480 --> 00:39:29.180
And, and Svelte gives us a lot of stuff that I think it would be difficult to go.
00:39:29.420 --> 00:39:33.120
I, I, I find it would be really difficult, I think, for what we're trying to
00:39:33.120 --> 00:39:37.500
do, which is, which is very doable in, in HTML and JavaScript to,
00:39:37.520 --> 00:39:40.460
to go down like the, the Zed route, right.
00:39:40.600 --> 00:39:45.180
Of, of being like, let's, let's do a completely new sort of user interface stuff.
00:39:45.280
--> 00:39:48.740
Cause that's now you're, you're reinventing all the wheels and it can be much
00:39:48.740 --> 00:39:51.580
faster, right. Or it can be, it can be great for what you're trying to do.
00:39:51.860 --> 00:39:57.520
But, but right now I think we're not a hundred percent sure of exactly where we want to land.
00:39:57.520 --> 00:40:01.160
And it would be, it's easier to kind of use the wheels that are there to,
00:40:01.240 --> 00:40:04.480
to get us real close to that before we go down some, some larger,
00:40:04.480 --> 00:40:07.380
road that's that difficult.
00:40:07.620 --> 00:40:11.840
Zed builds their own UI library, GPU accelerated and everything,
00:40:12.000 --> 00:40:17.080
and it's fascinating, but it would be so much more difficult to iterate and
00:40:17.080 --> 00:40:19.440
try things with such an approach.
00:40:20.770 --> 00:40:25.690
We had them on the show. So if you want to check it out, listen to the episode
00:40:25.690 --> 00:40:28.610
we've said where they described that UI approach.
00:40:28.790 --> 00:40:33.090
I think it's nice to compare those two approaches because I looked at GitButler
00:40:33.090 --> 00:40:35.110
and what I found was it looks nice.
00:40:35.290 --> 00:40:39.170
It's clean, it's snappy, it almost feels native.
00:40:39.610 --> 00:40:43.650
And I don't know how you'd pull it off, but definitely you did a great job there.
00:40:44.170 --> 00:40:47.170
Yeah, I mean, it's an interesting question, right?
00:40:47.250 --> 00:40:49.030
Like going back to what do we want
00:40:49.030 --> 00:40:52.510
to build? Like we are still very much experimenting with stuff, right?
00:40:52.610 --> 00:40:57.270
Like we, we, we, we're, all we know is we want to throw everything off the table
00:40:57.270 --> 00:41:00.870
and then figure out, you know, what do we want to be on the table a year from now?
00:41:01.090 --> 00:41:04.450
And we're still constantly kind of arguing about stuff and, and we try stuff
00:41:04.450 --> 00:41:07.250
out and we see what works and we use it ourselves and we dog food it.
00:41:07.330 --> 00:41:08.970
And we're like, okay, this feels good.
00:41:09.090 --> 00:41:11.310
This needs to be changed. This is going in the right direction.
00:41:11.510 --> 00:41:12.690
Let's rethink this, blah, blah, blah.
00:41:12.950 --> 00:41:16.650
I think with the Zed guys, you know, I mean, I've known Nathan for,
00:41:16.750 --> 00:41:21.250
for since GitHub days. So, but like, I feel like they knew what they wanted
00:41:21.250 --> 00:41:24.130
to build, right? They want to build an editor.
00:41:24.410 --> 00:41:26.690
Like they know what editors look like. They know what, you know,
00:41:26.750 --> 00:41:29.630
VS Code looks like. They know what Atom, he worked on Atom before that.
00:41:29.950 --> 00:41:33.570
And so he had a good idea of like, really, where do we want this to go down?
00:41:33.650 --> 00:41:35.430
They had a lot of taste and they knew where they wanted to go.
00:41:35.750 --> 00:41:39.810
And so I think they could be, it was much, it made more sense to say,
00:41:39.950 --> 00:41:44.590
here's what we need a UI library to do because we want to do kind of this, but much faster.
00:41:44.830 --> 00:41:48.270
Right. And, and so that, that makes it, whereas we, we haven't,
00:41:48.370 --> 00:41:50.570
I feel like we have no idea where we're going to land, you know,
00:41:50.670 --> 00:41:53.170
two years from now, what this is really going to look like and how it's going to feel.
00:41:53.270 --> 00:41:55.950
We just, we know that we're getting closer to what makes us happy,
00:41:56.130 --> 00:41:59.390
sort of doing, doing these, these code management things every day.
00:41:59.870 --> 00:42:02.910
And, and so, yeah, it really depends on what you're trying to build.
00:42:03.050 --> 00:42:07.570
Like, do you really know what it's going to be and, and making it faster or
00:42:07.570 --> 00:42:11.170
doing it a rust or, you know, whatever will definitely help you get there.
00:42:11.170 --> 00:42:15.950
Or are you inventing and if you're inventing then then it's much easier to have a general toolkit.
00:42:16.870 --> 00:42:19.690
And is it the same experience when you move things
00:42:19.690 --> 00:42:22.950
around on the front end side in the ui do
00:42:22.950 --> 00:42:26.110
you have the same feeling like when you do something in the rust core
00:42:26.110 --> 00:42:31.470
where refactoring is easy and the language helps you move things around and
00:42:31.470 --> 00:42:36.710
you can make changes with confidence or do you have this i would say chasm from
00:42:36.710 --> 00:42:40.770
the front end to the back end a typical thing where you change something and
00:42:40.770 --> 00:42:43.370
then you throw things over the fence yeah.
00:42:43.370 --> 00:42:46.790
I mean that's really a question of like what's easier or harder than that like
00:42:46.790 --> 00:42:52.050
javascript or or rust like i prefer to do stuff in rust because because i feel
00:42:52.050 --> 00:42:54.830
more confident that i'm not screwing something up than i do in typescript but
00:42:54.830 --> 00:42:57.410
yeah you work more in both of those than i do i.
00:42:57.410 --> 00:43:01.570
Work in both but my preference would be yeah refactoring the back end we have
00:43:01.570 --> 00:43:06.230
the api or in in the Tauri language we have those commands that are,
00:43:07.010 --> 00:43:11.090
the kind of the thing that needs to be stable or when we change it,
00:43:11.170 --> 00:43:12.630
we change it consciously.
00:43:12.990 --> 00:43:16.490
But yeah, change to me, change in Rust is much, much easier.
00:43:17.960 --> 00:43:22.620
The other thing I noticed when I played around with Git Butler was that certain
00:43:22.620 --> 00:43:27.860
operations were snappy, even though they were, I guess, in the background, quite complex.
00:43:28.160 --> 00:43:33.280
And I wonder how you pulled this off. Do you have a lot of async Rust
code in the core?
00:43:33.460 --> 00:43:38.160
Or how do you handle that part? Because is Tauri essentially async as well?
00:43:38.380 --> 00:43:44.520
So, yeah, it's specific. So if you look at our functions, the whole chain,
00:43:44.660 --> 00:43:47.040
the whole stack, there's no async mentioned.
00:43:47.940 --> 00:43:55.220
However, on the top level where we define the Tauri command, there is a macro
00:43:55.220 --> 00:43:59.020
where we annotate it or we declare it as an async function.
00:43:59.260 --> 00:44:03.740
So my understanding of the framework is that it will certainly run this in its
00:44:03.740 --> 00:44:06.440
own thread, the entire command.
00:44:06.980 --> 00:44:16.060
But within that scope, it is all synchronous functions. And this is actually,
00:44:16.280 --> 00:44:21.040
at some point, we did have async functions in those calls.
00:44:21.300 --> 00:44:28.080
And as you may know, mixing sync and async code is very, very, or can be painful.
00:44:28.340 --> 00:44:36.300
There is a constraint for our use case where certain structures that come from
00:44:36.300 --> 00:44:41.560
git2 or the libgit2 bindings in Rust, Because there is this C operation,
00:44:41.880 --> 00:44:44.660
those structures are not sent sync.
00:44:45.020 --> 00:44:50.200
And because of that, yeah, they need to be in this sync context.
00:44:50.620 --> 00:44:54.860
And that made it quite difficult to do certain things. We had to do a spawn
00:44:54.860 --> 00:44:57.320
thread manual and do certain things.
00:44:58.180 --> 00:45:04.160
So I think we are in a much better place now that everything within an API code
00:45:04.160 --> 00:45:06.260
or within a command is sync.
00:45:07.440 --> 00:45:13.140
Yeah. I personally also believe that the core of an application should be sync
00:45:13.140 --> 00:45:16.760
ideally because then you can use it in other contexts. As you say,
00:45:16.900 --> 00:45:18.740
mixing sync and async is not easy.
00:45:18.920 --> 00:45:24.200
And if you have a library that cannot use async, then you're kind of bound to
00:45:24.200 --> 00:45:26.620
building a weird bridge between the two.
00:45:26.860 --> 00:45:29.840
For example, you could technically run that thing on an embedded system,
00:45:29.980 --> 00:45:32.840
which maybe is not fit to run async code.
00:45:32.980 --> 00:45:36.180
It could be with embassy, but it's not necessarily the case.
00:45:36.180 --> 00:45:41.760
So keeping that separate I think was a good decision and this is how you keep
00:45:41.760 --> 00:45:43.580
the UI snappy too because at
00:45:43.580 --> 00:45:46.860
the end of the day this macro that you described is that a part of Tauri?
00:45:47.020 --> 00:45:48.820
Is that something that is built into the yes.
00:45:48.820 --> 00:45:49.780
This is a Tauri.
00:45:49.780 --> 00:45:57.360
Macro okay and they dispatch it in the back and then it comes back with the result this.
00:45:57.360 --> 00:45:59.960
Is my understanding that they do the dispatching themselves.
00:46:01.820 --> 00:46:07.000
So all the git operations they complete at some point and then you update the user interface.
00:46:09.120 --> 00:46:13.960
So if you look at our API, we have commands, which are things that you trigger,
00:46:14.140 --> 00:46:16.940
and we have subscriptions or one subscription.
00:46:18.220 --> 00:46:27.440
Which is for for the state of of of the workspace so there is things that happen
00:46:27.440 --> 00:46:31.200
let's say on the file system or things that you've triggered in the user interface
00:46:31.200 --> 00:46:36.340
and doesn't matter on which thread that happened or it's just things that can happen,
00:46:37.560 --> 00:46:45.300
that is that is being propagated to the interface through through um yeah a subscription almost.
00:46:45.300 --> 00:46:46.280
Like an event system.
00:46:46.280 --> 00:46:54.620
Yeah i think from the java so we we use the we use the the tooling uh by by
00:46:54.620 --> 00:47:02.640
Tauri and to me that looks very much like a web socket subscription on the javascript side and yeah,
00:47:03.260 --> 00:47:08.480
on the rust side we have a uh how
00:47:08.480 --> 00:47:13.160
to say like a file system watching that that is observing the file system if
00:47:13.160 --> 00:47:17.780
something occurs it gets picked up it gets processed and then then you know
00:47:17.780 --> 00:47:22.820
we have a channel in which uh that that change is propagated and then ends up
00:47:22.820 --> 00:47:25.280
in the user user interface or in the javascript code.
00:47:25.280 --> 00:47:28.580
So that's a nice separation of concerns.
00:47:28.580 --> 00:47:31.960
Right so there's no need to do polling for example in the front end.
00:47:31.960 --> 00:47:35.580
How many people write rust at git butler.
00:47:35.580 --> 00:47:38.820
You count me probably not i Actually.
00:47:38.940 --> 00:47:39.600
Give me a 0.5.
00:47:40.460 --> 00:47:47.460
Well, if we can't you. Okay, so we actually, I want everybody to be writing Rust.
00:47:47.800 --> 00:47:52.800
So we encourage everybody to, including folks that have, I have to say,
00:47:52.940 --> 00:47:55.380
primarily front-end JavaScript background.
00:47:55.680 --> 00:47:58.560
We encourage everybody to get their hands dirty or rusty.
00:47:58.780 --> 00:47:59.240
Let's say.
00:48:01.380 --> 00:48:03.300
You're waiting the whole episode for that one.
00:48:04.340 --> 00:48:10.940
We should do the joke part. No, so we encourage everybody to get into this because
00:48:10.940 --> 00:48:14.740
A, everybody's asking for it. Like it's interesting.
00:48:14.860 --> 00:48:17.380
It's interesting to try to expand one's horizon.
00:48:17.580 --> 00:48:20.200
And B, actually it makes sense to work full stack.
00:48:20.640 --> 00:48:25.740
With that said, the people who work regularly in the Rust side of the code is
00:48:25.740 --> 00:48:30.780
probably three, four people out of say seven.
00:48:32.570 --> 00:48:33.910
Yeah,
engineering-wise, yeah.
00:48:34.290 --> 00:48:38.030
How does the onboarding work when you tell someone to write some Rust code?
00:48:38.970 --> 00:48:43.250
Do you just throw them into the cold water? Do you have them go through the
00:48:43.250 --> 00:48:45.370
Rust book or some tutorial?
00:48:45.770 --> 00:48:47.330
Or do you sit with them for a while?
00:48:47.930 --> 00:48:53.510
They just jump straight into it. I think this is what we did.
00:48:55.070 --> 00:49:00.090
I mean, there is a pattern that one can follow, right? You can see how,
00:49:00.450 --> 00:49:05.830
just let's imagine any front-end developer that has never touched Rust.
00:49:06.410 --> 00:49:13.130
So the part where the front-end or the JavaScript code talks to the Tauri part, that's obvious.
00:49:13.250 --> 00:49:17.750
You can see how other commands or requests work. So you can copy-paste that.
00:49:17.890 --> 00:49:20.710
And then you can see, you can search for the string in the code base.
00:49:20.790 --> 00:49:23.110
And you can see, oh, this is where we declare those.
00:49:23.290 --> 00:49:25.390
Okay, this is the name of the thing. I can see what we're doing.
00:49:25.390 --> 00:49:29.290
And you can just, you know, copy paste yourself into something.
00:49:29.570 --> 00:49:30.290
That's how I do it.
00:49:30.570 --> 00:49:35.810
That's how we all do it, you know. And then hopefully you're following a good pattern.
00:49:36.230 --> 00:49:39.170
And, you know, you should be brave. You should try things.
00:49:39.330 --> 00:49:42.710
I think this is what makes us also happy as developers, you know,
00:49:42.770 --> 00:49:46.870
just trying things and seeing what works and what doesn't.
00:49:48.090 --> 00:49:51.430
And still, I also do the same. I'm with you on this one.
00:49:52.070 --> 00:49:56.790
Still, sometimes I wish for some coding guidelines when I start with a new project
00:49:56.790 --> 00:49:58.170
or start with a new company.
00:49:58.810 --> 00:50:01.270
I'd like to be a good citizen of the code base.
00:50:01.410 --> 00:50:01.510
Right?
00:50:01.850 --> 00:50:04.250
Do you have something like that? Any internal guidelines?
00:50:04.430 --> 00:50:10.430
So we use Clippy. So we have rules. We also, I mean, the way I do it for me
00:50:10.430 --> 00:50:12.050
is I look at other projects.
00:50:12.050 --> 00:50:17.810
I look at how other projects structure their application logic and how they
00:50:17.810 --> 00:50:22.570
approach abstracting things, to what extent they use traits and how they use
00:50:22.570 --> 00:50:24.790
traits, how they, I mean,
00:50:25.350 --> 00:50:28.470
you know, extension traits for certain things, but not for certain other things,
00:50:28.610 --> 00:50:33.290
or just multiple implementation blocks, just getting into the dramatic rust process.
00:50:33.900 --> 00:50:39.060
I sometimes would write some code and I would reach out to somebody more experienced
00:50:39.060 --> 00:50:42.340
on the team and be like, is this idiomatic?
00:50:42.600 --> 00:50:46.560
Is this how you do it? And then I would learn that you can actually express
00:50:46.560 --> 00:50:49.780
it in a more beautiful way or in a more succinct way.
00:50:50.140 --> 00:50:57.040
One phrase that I've heard within the Rust ecosystem score is this idea or this
00:50:57.040 --> 00:51:00.100
sentence of make invalid state unrepresentable.
00:51:00.100 --> 00:51:07.420
So you can express the states of your application or of that particular piece
00:51:07.420 --> 00:51:13.500
of logic in a way that you can't have the wrong state using the some types,
00:51:13.940 --> 00:51:16.100
enums and such.
00:51:16.100 --> 00:51:22.880
Which is really cool to think about just your programming as putting a puzzle
00:51:22.880 --> 00:51:28.560
together and just creating a structure that ultimately represents the kind of
00:51:28.560 --> 00:51:33.260
your application truth or the thing that it's supposed to do and it's not supposed
00:51:33.260 --> 00:51:35.260
to do, like thinking in terms of invariance.
00:51:36.020 --> 00:51:41.920
I come from Python, and it's a bit similar to Ruby in a sense that sometimes
00:51:41.920 --> 00:51:47.900
I had a larger change and I would run the project for maybe 20 or 30 minutes or so.
00:51:48.020 --> 00:51:53.620
And then it would crash, crash way down in the stack with some silly mistake
00:51:53.620 --> 00:51:57.780
that I made because the type system wasn't saving me. It wasn't a compiled language.
00:51:58.540 --> 00:52:02.900
And I think at GitHub, you had some sort of code style guide.
00:52:03.000 --> 00:52:05.780
You had something like that. I guess there was something.
00:52:06.000 --> 00:52:09.720
I can remember you wrote a bit about it on the blog, on a GitHub blog,
00:52:09.980 --> 00:52:14.120
and at least the code itself was written by expert Ruby programmers.
00:52:15.720 --> 00:52:20.720
Some of that do you miss it in rust sometimes where there are not that those
00:52:20.720 --> 00:52:25.260
clean guidelines for example when to write functional code when to write object-oriented
00:52:25.260 --> 00:52:26.780
code and and stuff like that.
00:52:27.580 --> 00:52:32.060
I don't i mean i don't miss it like i like i said i'm fairly practical i i i
00:52:32.060 --> 00:52:37.500
do there's a lot more now i think especially than in the ruby world there's
00:52:37.500 --> 00:52:42.400
a lot of stuff like clippy and prettier and, and with like, there's, there's,
00:52:43.120 --> 00:52:47.680
you know, I save the file in VS code and it, it fixes sort of idiomatically,
00:52:47.880 --> 00:52:50.940
you know, what, like, like what everything kind of should look like from a formatting
00:52:50.940 --> 00:52:54.200
perspective or tells me when I'm doing something wrong in JavaScript or something.
00:52:54.380 --> 00:52:58.540
So, you know, I have, I have at least a little bit of a hint beforehand that
00:52:58.540 --> 00:53:01.660
I'm, that I'm formatting something
wrong or, or that it's, it's going to look
00:53:01.660 --> 00:53:06.100
wrong or something like there's no, there's no spaces tab sort of like arguments
00:53:06.100 --> 00:53:07.580
and, you know, anymore, right?
00:53:07.660 --> 00:53:11.000
Like, like, I think the whole industry has kind of moved on from that.
00:53:11.440 --> 00:53:16.000
But from a – man, I don't know. It's like from this type of thing, I think –.
00:53:16.750 --> 00:53:20.070
I've been around enough of these where it changes over time.
00:53:20.110 --> 00:53:22.490
And I've seen a lot of this in the Ruby community as well, right?
00:53:22.590 --> 00:53:25.130
Where people are saying, here's how you should, you know, do you have,
00:53:25.310 --> 00:53:28.050
you know, fat model, skinny controllers or blah, blah, blah.
00:53:28.290 --> 00:53:30.870
And they'll come up with something and then everybody will try to do that.
00:53:31.030 --> 00:53:33.670
And then five years later, it'll kind of change a little bit.
00:53:33.770 --> 00:53:37.310
And then you'll like refactor code and the new kids will come in and be like,
00:53:37.410 --> 00:53:38.390
this is all bullshit, right?
00:53:38.450 --> 00:53:42.410
And so like, like, I think as long as the code works and customers are happy,
00:53:42.510 --> 00:53:44.790
like they're not looking at your code, right? Like a lot of it is going to be
00:53:44.790 --> 00:53:49.030
what does the next person that comes on, can they understand your code?
00:53:49.190 --> 00:53:50.430
Can they contribute to your code?
00:53:50.790 --> 00:53:52.790
I don't like clever code, right?
00:53:52.890 --> 00:53:57.210
Like I like dumb code that is easy to understand and easy to modify.
00:53:57.490 --> 00:54:03.170
And so I always kind of go away from super clever stuff because even though
00:54:03.170 --> 00:54:04.990
it makes you feel smart, it may not.
00:54:05.110 --> 00:54:08.450
And that's why it makes you feel smart is because somebody else has a harder
00:54:08.450 --> 00:54:11.710
time understanding it or figuring it out. Like I don't like magic.
00:54:11.890 --> 00:54:13.110
Anyways, yeah, I don't know. I
00:54:13.110 --> 00:54:19.050
would move towards as simple and as understandable as it possibly can be.
00:54:19.930 --> 00:54:25.190
But you have to make the next person that comes on feel like they can own the code too, right?
00:54:25.570 --> 00:54:30.550
And to your point, if you optimize for deletion, if you optimize for making
00:54:30.550 --> 00:54:34.590
the code base modular, you can always take bits out, replace,
00:54:34.750 --> 00:54:37.230
reimplement, and swap parts out.
00:54:37.230 --> 00:54:43.490
I think that's what makes it easier to move faster because that's one of the
00:54:43.490 --> 00:54:47.350
things that are really important for us, to be able to iterate on our ideas.
00:54:47.750 --> 00:54:49.590
As Scott said, we have no idea what we're doing.
00:54:51.290 --> 00:54:57.010
That may not be the message that we want to put across. We're slowly getting
00:54:57.010 --> 00:54:58.470
a better idea of what we're doing.
00:54:59.070 --> 00:55:03.010
I mean, this is tongue-in-cheek, but we iterate, we get feedback,
00:55:03.030 --> 00:55:06.530
and we always need to incorporate those learnings.
00:55:07.230 --> 00:55:11.590
And sometimes our approach for a particular solution is not ideal.
00:55:11.590 --> 00:55:16.250
So we take it out or we want to be able to take it out and replace it with something better. Yeah.
00:55:17.420 --> 00:55:21.400
How much of the code base is functional and how much is object-oriented?
00:55:22.980 --> 00:55:28.000
Well, object-oriented, I don't think we necessarily have any object-oriented.
00:55:28.420 --> 00:55:33.660
I mean, not everything is purely functional. We would have mute, if that's what you mean.
00:55:33.840 --> 00:55:40.760
We would have things that we mutate. But in terms of state, you start up GitButler
00:55:40.760 --> 00:55:47.380
as an application, and there is very little to no state that the application holds,
00:55:48.280 --> 00:55:53.240
when you get a command or a request, something happens and now there is more state.
00:55:53.400 --> 00:55:59.600
But that state goes out of scope when that command is over or has been completed.
00:55:59.900 --> 00:56:04.620
The only kind of state that is, the ultimate piece of state is,
00:56:04.760 --> 00:56:10.120
okay, which repository are we working on? Like which is the repository?
00:56:10.320 --> 00:56:15.140
And that's just the path. So a path is the core piece of state.
00:56:15.320 --> 00:56:24.200
And then, because if you consider that our application is dealing with, well, Git structures,
00:56:24.540 --> 00:56:30.380
files on disk and the Git state, which the source of truth is on disk,
00:56:30.640 --> 00:56:34.640
not in our application's memory while it's running.
00:56:34.880 --> 00:56:41.080
And for that reason, after each operation, there is no more state that is relevant.
00:56:41.080 --> 00:56:46.920
We completed the operation, we return, and that's that. Which is, I think, beautiful.
00:56:47.480 --> 00:56:51.500
It's nice to not have to maintain controllers that...
00:56:52.120 --> 00:56:54.120
That means you don't have any
00:56:54.120 --> 00:56:59.220
long-running mutexes, any synchronization that you need to take care of.
00:56:59.320 --> 00:56:59.540
Correct.
00:57:00.600 --> 00:57:04.580
Mostly depend on the file system, and then you do your next operation.
00:57:04.820 --> 00:57:10.180
Correct. So we initially had those simply because of our background,
00:57:10.180 --> 00:57:12.260
and we assumed that we did need that.
00:57:12.460 --> 00:57:17.940
And then through some help and guidance, we've come to understand that we don't
00:57:17.940 --> 00:57:20.060
need it, and we've been able to take it out.
00:57:20.060 --> 00:57:25.560
And by taking it out a lot of things have become simpler things that used to
00:57:25.560 --> 00:57:31.820
get
a control project controller or a user controller now get nothing the only
00:57:31.820 --> 00:57:36.040
thing that you need to know is okay what which which path am i dealing with
00:57:36.040 --> 00:57:39.880
and then everything can be derived at any point in time.
00:57:40.860 --> 00:57:44.000
It's very cool because what you said was you
00:57:44.000 --> 00:57:47.980
optimize for deletion and that makes a lot of sense in my opinion and what you
00:57:47.980 --> 00:57:51.960
said is that you also have a very pragmatic approach and you want the next person
00:57:51.960 --> 00:57:56.880
to have a good time do i hear that you also want to have simple rust you want
00:57:56.880 --> 00:58:01.560
to have a code base that is understandable is simplicity a core value.
00:58:01.560 --> 00:58:10.180
Yes my very soft yes no actually i want to say i want to share a piece for for
00:58:10.180 --> 00:58:16.340
the audience early in my career i watched a video by Rich Hickey called Simple Made Easy.
00:58:16.600 --> 00:58:21.280
And he makes the distinction between simple and easy. And he talks about the
00:58:21.280 --> 00:58:23.200
value of simplicity in software.
00:58:23.580 --> 00:58:29.900
So I watched that talk and it really changed my perspective on software engineering profoundly.
00:58:30.180 --> 00:58:36.460
And I have since rewatched that talk together with colleagues at any given time
00:58:36.460 --> 00:58:38.060
with different set of colleagues.
00:58:38.220 --> 00:58:45.960
But I've seen this talk, I would say more than 10 times and I think it's really valuable.
00:58:46.240 --> 00:58:49.720
So simplicity in software is a core value for us.
00:58:49.960 --> 00:58:52.240
And what's the difference between simple and easy?
00:58:53.220 --> 00:58:56.900
Well, I would not do it justice. I think people should watch the talk,
00:58:57.020 --> 00:59:04.180
but in a nutshell, simple relates to having not interleaving concepts.
00:59:04.260 --> 00:59:07.920
If you have something that is dealing with let's say.
00:59:08.990 --> 00:59:12.010
Okay, firstly, you don't want to mix up state and functionality.
00:59:12.010 --> 00:59:13.670
So there is that separation.
00:59:13.910 --> 00:59:20.570
And secondly, you don't want to have or you want to avoid this endangling of
00:59:20.570 --> 00:59:25.450
concerns. Like you have a struct that is responsible for this and that.
00:59:25.930 --> 00:59:29.210
Can it be separate? Is it appropriate for it to be separate?
00:59:29.530 --> 00:59:32.930
And the difference with easy is so
00:59:32.930 --> 00:59:35.950
rich makes a very eloquent point about how easy
00:59:35.950 --> 00:59:38.890
it's more relates more
00:59:38.890 --> 00:59:41.930
to if if a if something is at hand
00:59:41.930 --> 00:59:45.530
or familiar so it's it's a distinction in okay
00:59:45.530 --> 00:59:48.270
familiarity so this is resembles something i've
00:59:48.270 --> 00:59:51.450
done before and and that familiarity is
00:59:51.450 --> 00:59:56.350
good it's great if something can be familiar but simple is has a has a more
00:59:56.350 --> 01:00:01.710
more pure and and this this talk he he talks about actually simple comes from
01:00:01.710 --> 01:00:08.170
from from the latin or simplex and that means one braid you're not yeah you're
01:00:08.170 --> 01:00:11.210
not complecting it i'll not do it i will not do it in the podcast,
01:00:11.870 --> 01:00:17.170
the talk is called simple made easy by rich hickey this is the creator of the
01:00:17.170 --> 01:00:23.410
closure programming language and i had a closure phase for lasted many years yeah.
01:00:23.410 --> 01:00:28.190
And in that talk he also refers to that and says just because something is familiar
01:00:28.190 --> 01:00:32.370
doesn't mean that it's simple because maybe you got used to it in some weird
01:00:32.370 --> 01:00:38.110
way maybe we got used to svn at some point or We got used to the complexity,
01:00:38.490 --> 01:00:42.030
maybe not complexity, but with the familiarity of Git.
01:00:42.270 --> 01:00:46.650
And maybe that might not have been the perfect abstraction. We just got used
01:00:46.650 --> 01:00:50.610
to it, to branching and naming things and rebasing and so on.
01:00:50.690 --> 01:00:54.550
But those things are easy in the sense that you said is familiar,
01:00:54.550 --> 01:00:56.370
but maybe not simple. Yeah.
01:00:57.640 --> 01:00:59.800
Not intertwined with other ideas.
01:00:59.800 --> 01:01:01.280
Right yeah and.
01:01:01.280 --> 01:01:05.140
When you when you talk about deletion i guess you enforce it somehow because
01:01:05.140 --> 01:01:07.940
if you can only delete things that are isolated.
01:01:07.940 --> 01:01:14.120
Correct yes yes so packaging or creating by by feature as like a core tenant
01:01:14.120 --> 01:01:21.900
like that way preventing the the complecting the word is complect common word in english.
01:01:21.900 --> 01:01:27.080
I thought you said it was latin so So I've never heard the word complect before, so.
01:01:27.440 --> 01:01:27.960
Okay.
01:01:28.540 --> 01:01:30.320
If it is, I'm going to look it up now.
01:01:30.420 --> 01:01:35.860
Yeah, I think that word spiked in popularity in 2011 after that talk.
01:01:37.160 --> 01:01:43.360
Was that a similar principle that you lived up to at GitHub where you said,
01:01:43.500 --> 01:01:46.640
make it easy to, I'm sorry, make it simple,
01:01:49.760 --> 01:01:56.160
make it isolated? Or was it a large code base and it kind of grew organically?
01:01:56.400 --> 01:02:05.040
That's a great question. I mean, it really depended. I feel like for our user
01:02:05.040 --> 01:02:07.840
interface, for user-facing stuff, it was different, right?
01:02:07.980 --> 01:02:13.760
Like we really wanted, there was a lot of thinking about and understanding what
01:02:13.760 --> 01:02:19.580
do we present our users and this concept of everything added dilutes everything else, right?
01:02:19.740 --> 01:02:23.820
So we didn't want
to be Jira or something. Like we didn't want to just add features
01:02:23.820 --> 01:02:28.460
because people said that they wanted features or said that they would pay for
01:02:28.460 --> 01:02:30.500
features. Like we really wanted to keep it.
01:02:31.270 --> 01:02:35.690
I mean, we wanted to keep it simple, right? Like we wanted to keep it that there
01:02:35.690 --> 01:02:40.190
were only so many things you could do and that we felt that these were the important
01:02:40.190 --> 01:02:45.450
things to do because everything else that you add makes it more complex by definition, right?
01:02:45.950 --> 01:02:49.510
From a backend standpoint, from a code standpoint, from an infrastructure standpoint,
01:02:49.870 --> 01:02:54.830
I think because it wasn't customer facing, you know, we could experiment more.
01:02:54.970 --> 01:02:57.970
We had a lot of people coming on at a relatively fast rate at some point.
01:02:58.210 --> 01:03:03.730
And so like a lot of it, it just depended on what system you were in and what
01:03:03.730 --> 01:03:05.830
that particular team cared about, right?
01:03:05.930 --> 01:03:08.930
Like, did it care about performance? Did it care about maintenance?
01:03:09.450 --> 01:03:12.730
Did it care about observability, right? Like there were different things that
01:03:12.730 --> 01:03:15.630
different teams cared about and would optimize for. So I don't know that we,
01:03:15.730 --> 01:03:19.770
I would say that, you know, every team had like some, like GitHub had some overarching
01:03:19.770 --> 01:03:22.070
sort of concept. I think it really depends.
01:03:22.190 --> 01:03:25.730
It was very, it was very, I don't know, tribal, right?
01:03:25.810 --> 01:03:28.970
Like, like there were groups and they had their things and it wasn't like,
01:03:29.090 --> 01:03:30.470
here's the GitHub philosophy.
01:03:32.410 --> 01:03:36.830
When GitHub started, Ruby was also pretty new, I guess, wasn't it?
01:03:36.930 --> 01:03:41.990
I mean, boy, that's a good question. I mean, Rails was new-ish,
01:03:42.330 --> 01:03:44.730
I think, you know, five years or four years or something.
01:03:45.170 --> 01:03:49.650
Ruby was around longer, but I think Rails really kind of picked up Ruby.
01:03:49.890 --> 01:03:51.410
It was the prime time of Rails.
01:03:51.850 --> 01:03:57.390
Yeah. I mean, it was when, I mean, there's still, you know, Shopify and Twitter
01:03:57.390 --> 01:03:58.970
and, you know, like all of these.
01:03:59.030 --> 01:03:59.350
Airbnb.
01:03:59.690 --> 01:04:02.670
Airbnb, like all of these companies. And they were all in San Francisco and
01:04:02.670 --> 01:04:03.610
we knew all these guys, right?
01:04:03.730 --> 01:04:11.410
And so, like, I think it was a really nice culture of entrepreneurship and building
01:04:11.410 --> 01:04:14.490
interesting things, right? And having customer focus.
01:04:14.930 --> 01:04:18.490
Like it was a great environment for, for all of that. I think the Ruby community
01:04:18.490 --> 01:04:22.250
and, and, you know, like I may have said at the beginning, I think it really
01:04:22.250 --> 01:04:25.810
helped make Git the, the thing that won, right.
01:04:25.990 --> 01:04:30.150
Is, is because, you know, we started part of the reason I think is we started
01:04:30.150 --> 01:04:34.770
GitHub and we were giving everybody, we obviously preferred Git and everybody in these,
01:04:34.890 --> 01:04:38.190
all of these communities started using Git to, to some degree because of,
01:04:38.310 --> 01:04:41.310
of GitHub or because of us personally, just, we knew a lot of these, these people.
01:04:41.310 --> 01:04:44.910
I'm really curious if GitHub hadn't come along, if Mercurial would be what everybody's
01:04:44.910 --> 01:04:46.550
using now, right, or something else.
01:04:47.930 --> 01:04:52.130
But, yeah, I mean, like you were saying before, like, we're all familiar with Git.
01:04:52.350 --> 01:04:56.790
There's kind of this local maxima problem. Like, it's not, there's nothing better
01:04:56.790 --> 01:04:59.030
than that. It's where everybody's kind of entrenched to some degree.
01:04:59.190 --> 01:05:03.030
So we do, we are familiar with it. It does have this easy, you know,
01:05:03.170 --> 01:05:06.350
even though it's not easy, like, it's easier than learning something else.
01:05:06.550 --> 01:05:09.390
So I- It is not easy, but it's simple. Yeah.
01:05:10.550 --> 01:05:10.970
Is it?
01:05:12.530 --> 01:05:13.510
Okay, maybe not.
01:05:13.990 --> 01:05:16.510
Maybe. It works.
01:05:17.630 --> 01:05:22.730
The reason why I was asking was that back in the day when you started a new
01:05:22.730 --> 01:05:27.990
application, Ruby, was it a positive signal to the outsiders, maybe investors?
01:05:27.990 --> 01:05:30.790
I know that GitHub never took any investments as far as I remember,
01:05:30.930 --> 01:05:32.850
but would it have raised any eyebrows?
01:05:33.790 --> 01:05:36.090
Or did investors not care at all?
01:05:36.090 --> 01:05:41.630
You know, I, so we, we bootstrapped until we were four years in,
01:05:41.750 --> 01:05:45.350
we had almost, almost a hundred employees from, from, you know,
01:05:45.430 --> 01:05:47.010
such a sort of a bootstrap background.
01:05:47.450 --> 01:05:50.990
So when we talked to investors, it was, they didn't care what we were building it on, right?
01:05:51.050 --> 01:05:55.750
Like we, we had millions of users at that point and everybody, we had taken no VC.
01:05:55.950 --> 01:05:59.930
So, so everybody wanted in on that. So I didn't have normal VC conversations
01:05:59.930 --> 01:06:05.830
at that time. I, I don't, even now I don't, I do some angel investing or I have,
01:06:05.970 --> 01:06:08.390
I've talked to lots of investors about this.
01:06:09.310 --> 01:06:12.550
Nobody's cared about the tech stack so far.
01:06:13.230 --> 01:06:15.950
I don't remember seeing it in lots of decks or something like,
01:06:16.030 --> 01:06:20.030
I don't know that, that
most investors care so much about how you're building
01:06:20.030 --> 01:06:21.850
it as much as what you're building.
01:06:22.170 --> 01:06:27.310
Like, like that is important. Like, is there conceivably a market, right?
01:06:27.430 --> 01:06:32.750
Like doing it in Rust versus Ruby versus whatever, like whatever you're familiar
01:06:32.750 --> 01:06:37.450
with and whatever you think you can move fast on or get to product market fit quickly.
01:06:37.930 --> 01:06:40.850
I'm not sure that there's that many investors. I mean, I haven't run into a
01:06:40.850 --> 01:06:42.370
lot of investors who have really cared.
01:06:43.750 --> 01:06:48.290
If you talk to someone else, a friend from another company and they started
01:06:48.290 --> 01:06:52.770
building up their tech stack and they were considering Rust and maybe other
01:06:52.770 --> 01:06:57.230
languages like Go or Zig, what would you tell them, what advice would you give?
01:06:57.230 --> 01:07:02.510
Yeah, I mean, I would say work with whatever the founders or the technical founders,
01:07:03.410 --> 01:07:06.790
enjoy working in right can can move fast in because
01:07:06.790 --> 01:07:09.490
you can always i mean you know twitter's not ruby anymore i think
01:07:09.490 --> 01:07:12.710
they they moved to Scala or something at some point like once
01:07:12.710 --> 01:07:15.470
you get once you once you find product market fit
01:07:15.470 --> 01:07:19.310
like once you start getting users and you start getting traction like and you
01:07:19.310 --> 01:07:22.410
make it you can rewrite it in anything you want like it's it's actually kind
01:07:22.410 --> 01:07:26.190
of interesting that that shopify and github and you know some of these big big
01:07:26.190 --> 01:07:29.470
companies are still running on ruby stacks because they they still like using
01:07:29.470 --> 01:07:31.830
it i think for the most part i'm sure there are people in those companies that
01:07:31.830 --> 01:07:33.470
are like we should rewrite this and go or whatever.
01:07:33.650 --> 01:07:38.490
But, but yeah, in the beginning, I think honestly, from a VC or from a,
01:07:38.590 --> 01:07:44.250
from a startup standpoint, I, I would, I would heavily say it does not matter,
01:07:44.570 --> 01:07:46.350
right? Like we could have chosen Electron.
01:07:46.510 --> 01:07:51.490
I think we'd be roughly as far as, as we are today that I, I think that Rust
01:07:51.490 --> 01:07:57.410
and Tauri were a better choice for, for, you know, future reasons and things like that.
01:07:57.490 --> 01:08:01.090
But like, you know, From trying to find out, is what I'm building valuable,
01:08:01.330 --> 01:08:04.950
I honestly, I have a hard time saying you can't work your way around.
01:08:05.090 --> 01:08:08.370
Everything has problems in some way and everything has strengths in some way.
01:08:08.450 --> 01:08:12.810
And so, you know, like it just depends. I think it's all shakes out.
01:08:13.130 --> 01:08:16.210
Like you'll work around the problems if you make it.
01:08:16.890 --> 01:08:21.850
But that's also a very positive thing because maybe someone is considering to use Rust.
01:08:22.670 --> 01:08:26.190
Maybe they are considering that it would be harder to get investments.
01:08:26.190 --> 01:08:30.190
And you as an angel investor, you know how these conversations work.
01:08:30.710 --> 01:08:32.410
So they shouldn't be concerned about that.
01:08:32.590 --> 01:08:35.570
Yeah, no, I don't think any, from a VC, from a raising money standpoint,
01:08:35.630 --> 01:08:37.390
I don't think anybody really cares.
01:08:37.650 --> 01:08:42.210
I think they'd much rather that you do what you're comfortable with and you
01:08:42.210 --> 01:08:44.470
feel like you don't have to have a big learning curve, you know,
01:08:44.530 --> 01:08:46.810
so that you can experiment and figure it out.
01:08:47.790 --> 01:08:50.830
But it's the same in any, like it's like, you know, what JavaScript framework
01:08:50.830 --> 01:08:52.930
do I use if I like job? Like who cares, right?
01:08:53.410 --> 01:08:56.770
Use Angular, use Svelte, use React, who cares?
01:08:57.690 --> 01:09:00.350
There's pluses and minuses to all these things. It's just, you know,
01:09:00.470 --> 01:09:02.770
what can we move fast with at first and then we'll figure it out.
01:09:03.630 --> 01:09:07.630
Do you like to work on the code base every day, Kiril? How does it feel to
01:09:07.630 --> 01:09:10.530
come to work and touch the Rust code?
01:09:10.970 --> 01:09:14.510
Do you feel you know, do you feel,
01:09:16.960 --> 01:09:20.800
Like you're making progress? Do you feel like there's a lot of velocity?
01:09:21.180 --> 01:09:22.120
Like it's maintainable?
01:09:22.540 --> 01:09:24.980
What's your feeling on the current code base right now?
01:09:25.120 --> 01:09:26.660
I mean, it's very exciting. I think
01:09:26.660 --> 01:09:29.560
it's a little bit like a puzzle that's coming together more and more.
01:09:29.760 --> 01:09:34.860
It's coming together in terms of performance or fixing issues that people are
01:09:34.860 --> 01:09:36.560
having. So that's very exciting to me.
01:09:36.840 --> 01:09:43.460
Like knowing that you fix an issue that somebody has reported gives me a huge kick.
01:09:43.720 --> 01:09:47.540
Actually, just this morning, we made a release. And I know that in that release
01:09:47.540 --> 01:09:52.920
comes some fixes that I made yesterday and people have reported those problems
01:09:52.920 --> 01:09:54.100
and that feels really good.
01:09:54.260 --> 01:09:59.040
So that's the part that gives me the biggest satisfaction. But just from a technical
01:09:59.040 --> 01:10:02.420
standpoint, like working with Rust, it is satisfying.
01:10:02.420 --> 01:10:07.120
It is interesting because I feel like I'm over the initial hump where,
01:10:07.380 --> 01:10:12.100
you know, I struggle with, you know, the systems that are different in Rust.
01:10:12.100 --> 01:10:17.680
And
now I can just focus on what we're building rather than what we're building with.
01:10:18.320 --> 01:10:24.300
So from that perspective, it's cool. I'm very happy with Rust as a choice.
01:10:24.440 --> 01:10:29.840
I feel, so to add to what Scott said, iteration speed is everything.
01:10:30.040 --> 01:10:34.380
The ability to say, all right, I have an idea, I wanna try it and see if it
01:10:34.380 --> 01:10:36.560
works and then iterate from there.
01:10:36.700 --> 01:10:41.720
That's critical for somebody who is making something new and trying to understand
01:10:41.720 --> 01:10:44.980
if other people want it. So...
01:10:45.810 --> 01:10:52.770
With that said, I mean, Rust can be slower to prototype in if one is not at
01:10:52.770 --> 01:10:56.170
all familiar with Rust or if it's something that is...
01:10:56.170 --> 01:11:00.970
I actually honestly think the user interface stuff would be quite difficult
01:11:00.970 --> 01:11:04.770
to do in Rust just because of the nature of user interaction.
01:11:05.090 --> 01:11:10.430
But for something that feels very functional, like I described earlier with
01:11:10.430 --> 01:11:15.190
a command that gets executed, that fits very nicely with the Rust model.
01:11:15.190 --> 01:11:19.150
Like you don't need a lot of state you don't have to think about state very
01:11:19.150 --> 01:11:23.010
much you're you're transforming something on disk you you it's something that
01:11:23.010 --> 01:11:26.930
you can test in a good way and then it's a very good fit so depending on the
01:11:26.930 --> 01:11:34.550
use case depending on the kind of context yeah it can be just the right to to to for the job you.
01:11:34.550 --> 01:11:38.170
Say you're happy with the code base but one thing that people always criticize
01:11:38.170 --> 01:11:43.930
are the compile times the rust compile times do you have any issues with that in your code pace i.
01:11:43.930 --> 01:11:56.790
Wish it was faster i wish it was in in developer mode it takes about if it's
01:11:56.790 --> 01:12:02.330
if it's an iterative build and i've made a change to one crate for us it takes about,
01:12:03.330 --> 01:12:09.070
two seconds or three seconds to to kind of make the new target and run it again
01:12:09.070 --> 01:12:13.050
of course i wish it was faster and i wish it can do it as fast as go go is really
01:12:13.050 --> 01:12:20.250
fast if if i need to build everything from scratch it takes about a minute with
01:12:20.250 --> 01:12:22.510
that said it's not a huge issue.
01:12:25.410 --> 01:12:26.430
I've seen way worse.
01:12:26.630 --> 01:12:30.150
Yeah, I haven't. I was, I've never really, like when I'm working on the Rust
01:12:30.150 --> 01:12:33.070
code, I haven't really noticed it being horrible.
01:12:33.270 --> 01:12:37.010
I mean, the big thing for us is that we're dogfooding it, right?
01:12:37.130 --> 01:12:40.870
So we're working on the version control system that we're using to try to version
01:12:40.870 --> 01:12:43.250
control the version control system that we're working on.
01:12:43.310 --> 01:12:48.130
And so, like, we have, we can't have our main code base in the development build
01:12:48.130 --> 01:12:51.510
of the thing because then you change some Rust code and it dies, right?
01:12:51.550 --> 01:12:54.270
Or you do something and it corrupts, like, your database, right?
01:12:54.270 --> 01:12:56.990
Like i've run into that several times so like i have to have the
01:12:56.990 --> 01:13:00.650
nightly now that we have a nightly it's much nicer because i do the nightly
01:13:00.650 --> 01:13:04.650
for the for the gip other code and then and then other repositories with the
01:13:04.650 --> 01:13:07.930
development build but like yeah that that type of thing where it just kill it
01:13:07.930 --> 01:13:11.910
and then start it back up again was but i mean yeah it only takes a couple seconds
01:13:11.910 --> 01:13:15.750
even even for this this larger sort of gui type program it's it's not bad at all.
01:13:15.750 --> 01:13:18.370
We need to keep an eye on the time because you need to go
01:13:18.380 --> 01:13:19.050
the jokes we.
01:13:19.050 --> 01:13:22.470
Haven't done the jokes can we do the jokes so.
01:13:23.190 --> 01:13:24.310
Yes but
01:13:24.310 --> 01:13:24.630
be
01:13:24.630 --> 01:13:26.270
careful what you say in the podcast.
01:13:26.270 --> 01:13:27.090
So whatever
01:13:27.090 --> 01:13:27.990
you say we'll be able.
01:13:27.990 --> 01:13:31.910
Okay i have a good one so firstly let
01:13:31.910 --> 01:13:38.230
me set this up well we at gate butler have a dad joke culture we like puns we
01:13:38.230 --> 01:13:44.410
like funny dad jokes to the extent where during our friday all hands meeting
01:13:44.410 --> 01:13:50.270
we do an event where everybody goes on a stage, tells their dad joke of the week.
01:13:50.530 --> 01:13:55.570
And then whoever gets the biggest laughs wins a little trophy.
01:13:55.790 --> 01:14:01.490
And then we pass the trophy around. So we got it out, that, that joke off and yeah.
01:14:01.630 --> 01:14:06.230
So today we are having an old hands and I've prepared a joke.
01:14:06.390 --> 01:14:07.110
I want to hear your joke.
01:14:07.250 --> 01:14:13.070
So what do you call a dog that can make magic tricks?
01:14:15.130 --> 01:14:17.110
You call it the labracadabrador.
01:14:21.470 --> 01:14:23.450
That's a good one. I like that one.
01:14:23.670 --> 01:14:27.890
Make sure you laugh just as much later when the jury's out.
01:14:30.230 --> 01:14:35.930
So last night I was just about to fall asleep and the ghost of Gloria Gaynor came into my room.
01:14:36.550 --> 01:14:39.050
First I was afraid. I was petrified.
01:14:41.910 --> 01:14:44.750
It's a song. That one didn't land as well.
01:14:44.750 --> 01:14:45.890
I didn't know the song.
01:14:45.910 --> 01:14:46.390
I liked it.
01:14:48.410 --> 01:14:53.950
Oh, first I was afraid. I was petrified. Is that better? Should I do it that way?
01:14:54.250 --> 01:14:54.650
Yes.
01:14:54.850 --> 01:14:55.590
Yeah, I got to sing it.
01:14:55.650 --> 01:14:59.170
I'm so sorry. You should sing it for the job. Oh, this is good.
01:15:02.390 --> 01:15:03.470
You should sing it later.
01:15:05.070 --> 01:15:08.130
He's rethinking all of his decisions, inviting us on this podcast.
01:15:09.950 --> 01:15:14.130
A friend of mine is trying to date a woman from the south of France.
01:15:14.750 --> 01:15:20.630
And he was unsure if he could approach her and talk to her. And I said Corsican.
01:15:23.770 --> 01:15:24.570
That's a good one.
01:15:24.630 --> 01:15:26.170
Oh, my God. That's a good one.
01:15:29.090 --> 01:15:31.130
So you should make this a thing on your podcast.
01:15:31.150 --> 01:15:36.530
Too. You should make all of your guests at least share one to start it out with.
01:15:36.550 --> 01:15:37.610
We should do it on our YouTube channel.
01:15:37.810 --> 01:15:38.730
Yeah, we should. Yeah.
01:15:39.510 --> 01:15:44.190
Okay. And it has become a bit of a tradition in this show. That's the actual tradition.
01:15:46.190 --> 01:15:50.750
To have one last statement about the Rust community.
01:15:51.170 --> 01:15:54.650
So if you had the chance to address the Rust community as a whole,
01:15:55.270 --> 01:15:57.630
anything you could say, what would you say?
01:16:00.580 --> 01:16:03.800
Could be positive or negative, could be about the community ecosystem,
01:16:04.020 --> 01:16:04.800
compile times, whatever.
01:16:06.460 --> 01:16:12.580
I mean, I love the crates system and the crates ecosystem actually like coming
01:16:12.580 --> 01:16:16.460
from, you know, sort of Ruby gems and, you know,
01:16:16.820 --> 01:16:21.980
sort of the, I don't know, crating the gem sort of system there.
01:16:21.980 --> 01:16:26.640
I feel like it's, it's, or like, you know, NPM or, or whatever,
01:16:26.820 --> 01:16:31.000
like I, I actually really, really appreciate how nice it is and how nice it
01:16:31.000 --> 01:16:33.580
has been to work with and to find stuff and to get documentation.
01:16:34.000 --> 01:16:38.880
So, you know, from my perspective, I've, I've been very, very surprised by, by how good that is.
01:16:38.980 --> 01:16:44.680
And then, you know, and then from a personal standpoint, I would say it's funny. Steve has been great.
01:16:44.920 --> 01:16:50.300
Like, like he's my, he's like the biggest introduction to the Rust community that I know.
01:16:50.500 --> 01:16:53.820
And I found him in the JJ chat rooms. And he was like, hey, Scott,
01:16:54.040 --> 01:16:55.120
thanks for the pro git book.
01:16:55.300 --> 01:16:59.240
And I was like, hey, Steve, thanks for the Rust book. Fantastic.
01:16:59.580 --> 01:17:03.160
And then everybody's like, oh, these guys patting each other on the back.
01:17:04.060 --> 01:17:07.700
I love the language. Thanks for Rust. Thanks for the ecosystem things.
01:17:08.020 --> 01:17:09.820
I mean, the libraries have been great.
01:17:10.300 --> 01:17:13.460
Yeah, I mean, it's interesting. Like if we I think if we think back,
01:17:13.600 --> 01:17:16.600
like we didn't really know at the beginning of this, like, is,
01:17:16.600 --> 01:17:18.640
is Electron the right call?
01:17:18.860 --> 01:17:22.500
Is, is Tauri the right call? I think, you know, after having worked it in,
01:17:22.540 --> 01:17:27.120
in, in two years, we would, I believe we would both probably recommend that
01:17:27.120 --> 01:17:30.040
somebody uses that use, use Tauri, learn Rust.
01:17:30.260 --> 01:17:33.360
Like, I think we've, if we had to do it again, we would do the same thing again,
01:17:33.500 --> 01:17:36.140
which is actually very nice. Like, like, as opposed to being like,
01:17:36.220 --> 01:17:38.180
man, I wish we'd gone down the Electron route or something.
01:17:38.320 --> 01:17:43.840
So So we really do like using the system to build our company on,
01:17:43.920 --> 01:17:47.680
which is not a not scary thing to do.
01:17:48.080 --> 01:17:52.660
Actually, I have something useful here. And now that I've thought about this a little bit longer,
01:17:53.000 --> 01:18:01.900
I like that the Rust community is generally very thoughtful for making things
01:18:01.900 --> 01:18:06.000
in the ecosystem that work and that are relatively well thought through.
01:18:06.000 --> 01:18:11.000
It's not not just tossing tossing crates out in the open and it's like okay,
01:18:11.960 --> 01:18:18.200
that doesn't matter there is there is some some consideration for for okay producing
01:18:18.200 --> 01:18:20.940
high quality software i think there
01:18:20.940 --> 01:18:25.220
there are i was thinking about the dependencies that we use uh we have.
01:18:26.220 --> 01:18:29.140
As we discussed git 2 which is bindings for libgit 2
01:18:29.140 --> 01:18:33.380
which works really well it's uh it's documented and it functions very really
01:18:33.380 --> 01:18:39.340
well we we have used a library called notify for file system watching and that
01:18:39.340 --> 01:18:44.500
works slightly differently under the hood for different platforms but it works
01:18:44.500 --> 01:18:47.620
for us in a transparent way which is brilliant.
01:18:48.360 --> 01:18:53.060
You have Tauri which has a very healthy
01:18:53.060 --> 01:18:56.000
attitude towards security like the way they treat
01:18:56.000 --> 01:19:00.700
isolating let's say the JavaScript code from the Rust which has access to the
01:19:00.700 --> 01:19:06.100
file system and just handling things in a secure way and not least Git Oxide
01:19:06.100 --> 01:19:12.820
which is a piece of software that is well thought through as well in terms of
01:19:12.820 --> 01:19:15.040
security, in terms of performance.
01:19:15.240 --> 01:19:23.180
And it feels like the tooling in the ecosystem produced by the community is of high quality.
01:19:23.480 --> 01:19:27.640
So I think this is probably the highest praise I can give.
01:19:27.920 --> 01:19:35.520
Just the median quality of a library or crate that you can find it's greater
01:19:35.520 --> 01:19:39.080
than the medium quality of other ecosystems.
01:19:39.400 --> 01:19:47.240
And I have been exploring languages for many years now, and I genuinely feel this way.
01:19:49.060 --> 01:19:52.820
Amazing clothing words. Where can people find out more about Git Butler?
01:19:53.340 --> 01:19:57.120
Yeah, I mean, the easiest thing is to go to gitbutler.com, and we have links
01:19:57.120 --> 01:20:02.400
to our source code on GitHub and our Discord, which is kind of interesting.
01:20:02.400 --> 01:20:07.260
We just recently kind of did this experiment where our entire corporate chat
01:20:07.260 --> 01:20:09.520
is on the same Discord that is public.
01:20:09.680 --> 01:20:12.980
So we have some private rooms for just us. But for the most part,
01:20:13.140 --> 01:20:16.060
a lot of what we do is build in public and it's on Discord.
01:20:16.300 --> 01:20:19.380
So you can find our blog there, which you mentioned, I think,
01:20:19.420 --> 01:20:20.420
at the beginning of this as well.
01:20:20.540 --> 01:20:24.620
But yeah, gitbutler.com is also a really pretty website.
01:20:24.880 --> 01:20:28.680
Actually, Pavel, our designer, approached it in a really interesting,
01:20:28.860 --> 01:20:32.560
awesome way that I think is very unique. So it's not hard on the eyes.
01:20:34.520 --> 01:20:39.540
Find all the links in the show notes. And I guess that sums it up.
01:20:39.720 --> 01:20:42.940
Scott, Kiril, thanks so much for taking the time.
01:20:43.240 --> 01:20:43.940
Yeah, thanks for having us.
01:20:43.940 --> 01:20:44.360
Thank you very much.
01:20:45.660 --> 01:20:49.960
Rust in Production is a podcast by corrode. It is hosted by me,
01:20:50.240 --> 01:20:52.780
Matthias Endler, and produced by Simon Brüggen.
01:20:53.320 --> 01:20:58.000
For show notes, transcripts, and to learn more about how we can help your company
01:20:58.000 --> 01:21:03.880
make the most of Rust, visit corrode.dev Thanks for listening to Rust in Production.