WEBVTT

00:00:01.490 --> 00:00:05.730
<v Matthias>It's Rust in Production, a podcast about companies who use Rust to shape the

00:00:05.730 --> 00:00:06.650
<v Matthias>future of infrastructure.

00:00:07.010 --> 00:00:11.010
<v Matthias>My name is Matthias Endler from Corode, and today I'm talking to Andrew Tinka

00:00:11.010 --> 00:00:14.490
<v Matthias>from Scythe about grassroots robotics with Rust.

00:00:18.850 --> 00:00:23.450
<v Matthias>Andrew, thanks so much for taking the time today for the interview.

00:00:23.990 --> 00:00:27.190
<v Matthias>Can you please say a few words about yourself and about Scythe?

00:00:27.950 --> 00:00:33.370
<v Andrew>Absolutely. My name is Andrew Tinka. I'm the Director of Software Engineering at Scythe Robotics.

00:00:33.830 --> 00:00:39.170
<v Andrew>Scythe designs and manufactures professional-grade autonomous lawnmowers for

00:00:39.170 --> 00:00:40.670
<v Andrew>the commercial landscaping industry.

00:00:40.910 --> 00:00:46.470
<v Andrew>So when I say autonomous lawnmowers, many people think of a Roomba for your front lawn.

00:00:46.650 --> 00:00:50.790
<v Andrew>What we build is larger and more heavy-duty.

00:00:50.970 --> 00:01:00.510
<v Andrew>It is a 1,400-pound machine, roughly 650 kilograms. It is a fully capable stand-on lawnmower.

00:01:00.690 --> 00:01:07.290
<v Andrew>So you can watch crews use this machine as a fully capable electric manual lawnmower,

00:01:07.310 --> 00:01:12.190
<v Andrew>or they can put it to work to autonomously mow large areas.

00:01:12.390 --> 00:01:15.190
<v Andrew>The value that Scythe brings is to...

00:01:16.120 --> 00:01:21.900
<v Andrew>Increase the efficiency of taking care of green spaces, parks,

00:01:22.560 --> 00:01:28.580
<v Andrew>athletic fields, corporate campuses, large areas of grass where mowing it all

00:01:28.580 --> 00:01:31.540
<v Andrew>manually is not a great use of people's time.

00:01:32.100 --> 00:01:37.300
<v Andrew>Ideally, a landscaping crew would get more done with the same number of people

00:01:37.300 --> 00:01:39.720
<v Andrew>because while the lawn mowing is happening,

00:01:40.080 --> 00:01:44.180
<v Andrew>the rest of the crew is handling the string trimming and the weeding and all

00:01:44.180 --> 00:01:48.640
<v Andrew>of the other more manually involved jobs around the property,

00:01:48.900 --> 00:01:53.320
<v Andrew>while the bulk of the just mowing the grass is getting done by a robot.

00:01:53.540 --> 00:01:58.260
<v Matthias>That means it's very much a heavy-duty machine and it's for industry use.

00:01:58.800 --> 00:02:06.440
<v Andrew>Absolutely. Our ideal customer is a commercial landscaper who is serving a lot of contracts.

00:02:06.620 --> 00:02:09.600
<v Andrew>And so they're mowing 40 hours a week. They're loading these machines up and

00:02:09.600 --> 00:02:13.280
<v Andrew>going from one property to another, taking care of a park in the morning,

00:02:13.480 --> 00:02:19.820
<v Andrew>taking care of a big field in the afternoon, and doing this work every day throughout the week.

00:02:20.180 --> 00:02:24.980
<v Matthias>Yeah. You get really good value out of it when you use that machine as often

00:02:24.980 --> 00:02:29.160
<v Matthias>as possible, ideally throughout the workday. throughout the week.

00:02:30.600 --> 00:02:34.200
<v Matthias>And for how long has Scythe been in existence?

00:02:34.780 --> 00:02:39.580
<v Andrew>Scythe got started in 2018 as a classic garage startup.

00:02:39.780 --> 00:02:43.540
<v Andrew>Just a few engineers in a small space putting together the first prototype.

00:02:44.260 --> 00:02:50.120
<v Andrew>And so since then, we have gone through several successive generations of our

00:02:50.120 --> 00:02:54.020
<v Andrew>hardware, and our fleet has grown every year, and the number of customers we've

00:02:54.020 --> 00:02:55.980
<v Andrew>served has been growing every years since 2018.

00:02:56.540 --> 00:03:01.500
<v Matthias>And was the idea always to have an automated robot? Was that the idea?

00:03:01.960 --> 00:03:08.860
<v Andrew>Absolutely. The founding principle of the company was to use robotics to help

00:03:08.860 --> 00:03:11.060
<v Andrew>take care of the earth better.

00:03:11.300 --> 00:03:15.560
<v Andrew>And so there's a couple of ways in which that decision played out.

00:03:16.280 --> 00:03:22.540
<v Andrew>The first one was to find the activities that people do to take care of green

00:03:22.540 --> 00:03:27.360
<v Andrew>spaces and see which ones are a place where a robot can bring value.

00:03:27.640 --> 00:03:32.840
<v Andrew>And the second aspect of that decision is our commitment to build all electric machines.

00:03:33.380 --> 00:03:36.440
<v Andrew>Gas-powered landscaping equipment

00:03:36.440 --> 00:03:42.520
<v Andrew>is often uniquely polluting even for internal combustion engines.

00:03:42.520 --> 00:03:49.920
<v Andrew>And so bringing a valid replacement to the market to allow these kind of operations

00:03:49.920 --> 00:03:55.780
<v Andrew>to be done with electric machines instead of internal combustion engines is

00:03:55.780 --> 00:03:57.620
<v Andrew>a real positive contribution.

00:03:57.620 --> 00:04:02.860
<v Matthias>But in my mind, it also sounds very daunting to start such an endeavor,

00:04:02.860 --> 00:04:07.540
<v Matthias>because you deal with a lot of moving parts,

00:04:07.860 --> 00:04:13.780
<v Matthias>you deal with potentially safety-critical systems, you want to make sure not

00:04:13.780 --> 00:04:18.300
<v Matthias>to harm anyone, nor the environment. How do you navigate that space?

00:04:18.300 --> 00:04:21.900
<v Andrew>Yeah, the design of the machine is a big part of it.

00:04:22.060 --> 00:04:26.080
<v Andrew>I mentioned earlier that it's a fully capable manual machine.

00:04:26.220 --> 00:04:30.540
<v Andrew>It has manual controls. You can jump on board and start mowing the grass yourself.

00:04:31.120 --> 00:04:37.760
<v Andrew>And that was a really clever strategy to allow us to approach the autonomy problem incrementally.

00:04:38.240 --> 00:04:41.900
<v Andrew>We could, in our early stages, as our autonomy stack was maturing,

00:04:42.480 --> 00:04:47.240
<v Andrew>essentially see it as a mixed autonomy problem where the robot would handle

00:04:47.240 --> 00:04:51.340
<v Andrew>the big, bulky, easy parts of the job, just the center of the field where you

00:04:51.340 --> 00:04:53.040
<v Andrew>just have to go back and forth a bunch of times.

00:04:53.890 --> 00:04:59.570
<v Andrew>And the parts of the mowing job that are more difficult, the edges,

00:05:00.050 --> 00:05:04.450
<v Andrew>the obstacles, crinkly bits around the corners, we could say,

00:05:04.570 --> 00:05:07.150
<v Andrew>all right, well, this is a place where humans do a better job.

00:05:07.250 --> 00:05:10.410
<v Andrew>And so humans can take over and mow those areas.

00:05:10.710 --> 00:05:14.370
<v Andrew>And that gives us kind of a continuous space to refine our autonomy.

00:05:14.830 --> 00:05:19.110
<v Andrew>We start out saying, okay, we take the easy middle. And as we got better every

00:05:19.110 --> 00:05:22.710
<v Andrew>year, we start saying, okay, actually, we can take over more and more of these

00:05:22.710 --> 00:05:23.950
<v Andrew>tricky bits around the edges.

00:05:24.410 --> 00:05:29.150
<v Andrew>The company is based in Colorado, which means there's a lot of skiers on the team.

00:05:29.310 --> 00:05:33.330
<v Andrew>And so we have a skiing-based metaphor for difficulty.

00:05:33.550 --> 00:05:36.910
<v Andrew>We can look at a field and say, oh, this is a green circle, or this is a blue

00:05:36.910 --> 00:05:38.370
<v Andrew>square, or this is a black diamond.

00:05:38.370 --> 00:05:41.530
<v Andrew>So we we talk about our

00:05:41.530 --> 00:05:47.430
<v Andrew>our progress on autonomy and saying okay this year we moved from doing 80 of

00:05:47.430 --> 00:05:52.430
<v Andrew>the the blue squares to 95 of the blue squares that's that's a big step forward

00:05:52.430 --> 00:05:56.890
<v Andrew>in our autonomy and so we're chipping away at the gradient of of autonomous

00:05:56.890 --> 00:06:01.430
<v Andrew>difficulty one step at a time would.

00:06:01.430 --> 00:06:06.310
<v Matthias>You describe scythe as a software company a hardware company a robotics company

00:06:06.310 --> 00:06:07.610
<v Matthias>or something else entirely.

00:06:07.610 --> 00:06:10.670
<v Andrew>I think it is a robotics company in

00:06:10.670 --> 00:06:14.710
<v Andrew>that the hardware and the software teams both

00:06:14.710 --> 00:06:18.170
<v Andrew>have an essential contribution and they have to pull together the

00:06:18.170 --> 00:06:21.990
<v Andrew>the designs are are closely coupled the

00:06:21.990 --> 00:06:24.970
<v Andrew>software we build relies on the information that

00:06:24.970 --> 00:06:28.250
<v Andrew>we gather from the sensors that the hardware team chose

00:06:28.250 --> 00:06:31.850
<v Andrew>to to install on the machine and so

00:06:31.850 --> 00:06:35.310
<v Andrew>when the hardware team designs the next

00:06:35.310 --> 00:06:39.990
<v Andrew>generation of a robot the software team gets consulted to say okay well what

00:06:39.990 --> 00:06:45.790
<v Andrew>what areas are are most difficult for this generation how can the next generation

00:06:45.790 --> 00:06:50.230
<v Andrew>make the problem different the software problem different so that it is more

00:06:50.230 --> 00:06:53.330
<v Andrew>amenable to to be solved the.

00:06:54.810 --> 00:07:00.330
<v Andrew>The nature of design cycles does give it this back and forth character.

00:07:01.170 --> 00:07:06.470
<v Andrew>Hardware designs on annual cycle, if you're lucky, if you're lucky,

00:07:06.470 --> 00:07:09.350
<v Andrew>you can manage a one-year turnaround on your hardware designs.

00:07:09.550 --> 00:07:14.610
<v Andrew>We work very, very hard to essentially get that one-year turnaround on our hardware designs.

00:07:14.970 --> 00:07:18.530
<v Andrew>Whereas software is so much more protean.

00:07:18.730 --> 00:07:27.790
<v Andrew>It moves so much faster. We can release software on timescales of weeks as opposed to years.

00:07:28.090 --> 00:07:35.610
<v Andrew>And so that makes the software design more adaptable and more flexible and allows

00:07:35.610 --> 00:07:44.450
<v Andrew>us to be closer to an agile kind of methodology for our work than the hardware team has to.

00:07:44.450 --> 00:07:52.390
<v Andrew>The hardware team must follow a more solid and heavyweight design process because

00:07:52.390 --> 00:07:56.890
<v Andrew>the nature of their design commitments are so much higher impact.

00:07:57.350 --> 00:08:01.990
<v Matthias>Yeah. And you said it yourself, that hardware is in the field,

00:08:02.410 --> 00:08:07.470
<v Matthias>like literally in the field for a very long time, if you allow me the pun.

00:08:07.790 --> 00:08:11.430
<v Matthias>That means you need to select that hardware really carefully.

00:08:11.670 --> 00:08:14.870
<v Matthias>What's inside of these machines? What keeps them running?

00:08:15.250 --> 00:08:18.530
<v Matthias>Speaking of the CPU, the sensors, everything that makes it tick.

00:08:20.210 --> 00:08:26.450
<v Andrew>Most of our computation happens on embedded NVIDIA module, a Jetson module,

00:08:26.810 --> 00:08:31.630
<v Andrew>which is a ARM CPU with a GPU.

00:08:31.930 --> 00:08:36.390
<v Andrew>They share the same memory space, which is a very convenient architectural feature

00:08:36.390 --> 00:08:40.590
<v Andrew>for handing data over between the GPU and the CPU.

00:08:41.820 --> 00:08:50.340
<v Andrew>The rest of the embedded system are in-house designed PCBs, so different PCBs

00:08:50.340 --> 00:08:56.280
<v Andrew>to control the motors, to control the various sensors and other peripherals.

00:08:56.500 --> 00:09:04.840
<v Andrew>And each one has a microcontroller of some sort to govern a small selection of the hardware.

00:09:04.840 --> 00:09:07.840
<v Andrew>The the battery is

00:09:07.840 --> 00:09:12.400
<v Andrew>probably one of our definitely our heaviest component and and one of our one

00:09:12.400 --> 00:09:18.120
<v Andrew>of our most expensive and carefully designed components because the choosing

00:09:18.120 --> 00:09:21.700
<v Andrew>the battery defines the the runtime that you get in the field and that's extremely

00:09:21.700 --> 00:09:25.500
<v Andrew>important to professional landscapers they want to be able to use this machine

00:09:25.500 --> 00:09:27.800
<v Andrew>for many many hours during the day,

00:09:28.520 --> 00:09:31.540
<v Andrew>the the motors the the chassis the the

00:09:31.540 --> 00:09:34.320
<v Andrew>motors are are are sourced components that uh

00:09:34.320 --> 00:09:37.980
<v Andrew>that that we we choose from carefully selected vendors the

00:09:37.980 --> 00:09:42.540
<v Andrew>chassis and all of the the the physical instantiation of the machine that is

00:09:42.540 --> 00:09:49.920
<v Andrew>all scythe designed and small run manufactured steel components that are that

00:09:49.920 --> 00:09:54.820
<v Andrew>are produced on the on the production runs that we do wow.

00:09:54.820 --> 00:10:00.800
<v Matthias>That's a lot of moving parts Yeah. About the Jetson component,

00:10:01.240 --> 00:10:07.560
<v Matthias>is that a thing that even has Rust support, or would that be driven by,

00:10:07.840 --> 00:10:12.260
<v Matthias>say, a C or C++ component, or is there some other way to drive it?

00:10:12.260 --> 00:10:19.860
<v Andrew>Definitely the ecosystem's center of gravity is definitely C++.

00:10:20.200 --> 00:10:26.800
<v Andrew>By default, you expect that an embedded component was, but the vendor provides...

00:10:27.780 --> 00:10:31.160
<v Andrew>All of the vendor-supported files, all of the board support packages,

00:10:31.460 --> 00:10:34.540
<v Andrew>all of the drivers are in C++ by default.

00:10:34.780 --> 00:10:40.220
<v Andrew>And these are the boundaries where we have to do C++ to Rust interop.

00:10:40.400 --> 00:10:46.660
<v Andrew>We basically expect that there's going to be a C++ driver kind of making the

00:10:46.660 --> 00:10:55.600
<v Andrew>last connection to our peripherals or the video system or any other component on the board.

00:10:55.600 --> 00:11:03.640
<v Andrew>And that the data will cross the border over from C++ into Rust where we do our business logic.

00:11:04.460 --> 00:11:10.720
<v Matthias>Yeah, but to take a step back, just for context, did you start with a hybrid

00:11:10.720 --> 00:11:17.480
<v Matthias>C++ and Rust codebase or did you start with, say, an existing C++ codebase and gradually oxidized it?

00:11:17.800 --> 00:11:21.760
<v Andrew>Yes, it was a sudden and sharp decision.

00:11:21.840 --> 00:11:27.560
<v Andrew>So it's a fun story. I think it actually is a story that really illustrates

00:11:27.560 --> 00:11:34.060
<v Andrew>how your architecture choices are driven by what's most important to you at the time.

00:11:34.360 --> 00:11:39.060
<v Andrew>So in 2018, when the company came together as a small number of engineers in

00:11:39.060 --> 00:11:43.660
<v Andrew>a garage, the priority was to get

00:11:43.660 --> 00:11:47.700
<v Andrew>something working to show to potential investors as quickly as possible.

00:11:48.200 --> 00:11:52.440
<v Andrew>And the robotics C++ ecosystem is very deep.

00:11:52.440 --> 00:12:00.580
<v Andrew>And so the right choice in early 2018 was to put together a demo-worthy prototype

00:12:00.580 --> 00:12:05.460
<v Andrew>in all C++, reusing as much open source code as possible,

00:12:06.140 --> 00:12:09.420
<v Andrew>going quick, dirty, and scrappy, and making a machine that moved.

00:12:10.780 --> 00:12:16.180
<v Andrew>The company got its first seed funding in late 2018, and that was the moment

00:12:16.180 --> 00:12:23.940
<v Andrew>when their design priorities changed, and with it, their software ecosystem changed all at once.

00:12:24.120 --> 00:12:26.900
<v Andrew>They essentially threw everything out, everything that they had built,

00:12:27.160 --> 00:12:30.600
<v Andrew>just in the garbage, blank page, starting from scratch.

00:12:31.040 --> 00:12:35.780
<v Andrew>And their most important decision was to build something that would last,

00:12:35.960 --> 00:12:38.500
<v Andrew>that would serve the company throughout its entire lifetime.

00:12:39.320 --> 00:12:44.360
<v Andrew>And that was the point where they said that Rust was the best choice to base

00:12:44.360 --> 00:12:46.600
<v Andrew>as much of the robot logic as possible.

00:12:47.400 --> 00:12:52.360
<v Andrew>That Rust provided the kind of code quality that they were looking for,

00:12:52.780 --> 00:12:57.540
<v Andrew>and along with the kind of performance and efficiency that they needed.

00:12:57.940 --> 00:13:02.780
<v Andrew>And even at that point, so late 2018, early 2019, I'm saying they,

00:13:02.880 --> 00:13:06.200
<v Andrew>of course, because I wasn't with the company at the time. These are the founders

00:13:06.200 --> 00:13:09.780
<v Andrew>and the first engineers who were building something from scratch.

00:13:10.780 --> 00:13:20.700
<v Andrew>They saw that the state of Rust to C++ interoperability was sufficiently mature and reliable,

00:13:20.740 --> 00:13:24.660
<v Andrew>that they were confident that they could use whatever C++ component they needed

00:13:24.660 --> 00:13:26.600
<v Andrew>on the periphery of the system,

00:13:26.880 --> 00:13:31.420
<v Andrew>literally for peripherals, or to engage with the rest of the robot operating

00:13:31.420 --> 00:13:33.040
<v Andrew>system, the Rust ecosystem.

00:13:33.680 --> 00:13:37.280
<v Andrew>And that they were confident that they could make any Rust code they needed

00:13:37.280 --> 00:13:39.560
<v Andrew>work inside that ecosystem.

00:13:40.640 --> 00:13:47.680
<v Matthias>I find that so cool and I find it so inspiring because as soon as the developers got funding,

00:13:47.980 --> 00:13:53.780
<v Matthias>they moved over or they looked for greener pastures on the Rust side,

00:13:54.020 --> 00:13:56.320
<v Matthias>maybe, to build the thing right.

00:13:56.720 --> 00:14:01.440
<v Matthias>But immediately someone might say, well, couldn't you do the same thing with C++?

00:14:01.760 --> 00:14:06.740
<v Matthias>Because there are also long-term projects written in C++ and we use them every

00:14:06.740 --> 00:14:13.160
<v Matthias>day. couldn't you just keep on building on top of c++ and not throw the code

00:14:13.160 --> 00:14:15.960
<v Matthias>away that would have saved you time at least initially.

00:14:15.960 --> 00:14:18.500
<v Andrew>Absolutely there are there

00:14:18.500 --> 00:14:21.820
<v Andrew>are many successful robotics companies out there that are

00:14:21.820 --> 00:14:29.560
<v Andrew>almost exclusively c++ i think that many of the the the those first engineers

00:14:29.560 --> 00:14:34.720
<v Andrew>many of those first engineers had spent a lot of time writing c++ and had spent

00:14:34.720 --> 00:14:38.740
<v Andrew>a lot of time getting burned by the same problems over and over.

00:14:39.020 --> 00:14:48.200
<v Andrew>The same relatively simple mistakes that turn into an incredibly difficult to

00:14:48.200 --> 00:14:50.520
<v Andrew>diagnose bug that takes a long,

00:14:50.660 --> 00:14:55.140
<v Andrew>long time to root cause and find the original cause.

00:14:56.120 --> 00:15:01.980
<v Andrew>And everyone who was in those decisions, All of the early engineers,

00:15:02.220 --> 00:15:07.200
<v Andrew>all of the founders talk about a desire for code quality,

00:15:07.340 --> 00:15:13.300
<v Andrew>a desire to be able to write confidently, knowing that what they were writing

00:15:13.300 --> 00:15:19.200
<v Andrew>would not burn them in one of these almost stereotypical ways,

00:15:19.400 --> 00:15:23.420
<v Andrew>one of these classic mistakes which leads to trouble down the road.

00:15:24.660 --> 00:15:30.540
<v Matthias>Okay that means they were veterans c++ developers who had a background in the

00:15:30.540 --> 00:15:35.440
<v Matthias>language they knew what they were doing they were able to cobble together a

00:15:35.440 --> 00:15:40.680
<v Matthias>prototype to convince venture capitalists to invest so that's a really positive

00:15:40.680 --> 00:15:44.540
<v Matthias>sign and yet those people even with their c++ experience,

00:15:46.160 --> 00:15:49.080
<v Matthias>preferred to write newer components in rust.

00:15:49.080 --> 00:15:55.040
<v Andrew>Absolutely and they would each of them would would would defend that decision

00:15:55.040 --> 00:15:59.660
<v Andrew>passionately that and by staying with the company and by it by continuing to

00:15:59.660 --> 00:16:08.280
<v Andrew>develop in this uh in in in this mixed style of of rust inside a a world of c plus they basically uh.

00:16:09.160 --> 00:16:14.000
<v Andrew>Voted with their feet for the next year, for all the years they stayed with

00:16:14.000 --> 00:16:15.720
<v Andrew>the company and continued to develop in that way.

00:16:16.320 --> 00:16:19.880
<v Andrew>From my perspective, I joined the company two and a half years ago.

00:16:20.020 --> 00:16:22.100
<v Andrew>And I joined not knowing Rust.

00:16:22.280 --> 00:16:25.260
<v Andrew>I joined thinking that one day I would like to learn Rust.

00:16:25.540 --> 00:16:30.460
<v Andrew>And so I was open to the idea. And when I was hired by Scythe,

00:16:30.680 --> 00:16:32.100
<v Andrew>they essentially said, welcome to Scythe.

00:16:32.200 --> 00:16:35.100
<v Andrew>We understand you don't know Rust. Very few people who join our company do.

00:16:35.800 --> 00:16:40.940
<v Andrew>Here's your desk. Here's a handful of web links for resources where you can learn.

00:16:41.140 --> 00:16:45.740
<v Andrew>We look forward to your first merge request. And that's the pattern that most

00:16:45.740 --> 00:16:47.960
<v Andrew>software engineers who join Scythe follow.

00:16:48.460 --> 00:16:51.520
<v Andrew>Almost none of our software engineers know about what they join.

00:16:51.740 --> 00:16:57.300
<v Andrew>They almost all are robotics domain experts with experience in the robotics

00:16:57.300 --> 00:17:00.640
<v Andrew>industry, typically in C++, although sometimes in other languages.

00:17:01.000 --> 00:17:07.860
<v Andrew>And they join us with a willingness to learn. And there's an almost stereotypical

00:17:07.860 --> 00:17:13.100
<v Andrew>pattern of joining the company, banging your head against the borrow checker,

00:17:13.660 --> 00:17:14.940
<v Andrew>learning how to get past that,

00:17:15.640 --> 00:17:21.580
<v Andrew>writing your first MR, your first merge request, and then going through the

00:17:21.580 --> 00:17:26.300
<v Andrew>same sort of rust idiom conversations that everyone needs to go through when

00:17:26.300 --> 00:17:27.000
<v Andrew>they're getting started.

00:17:27.000 --> 00:17:33.840
<v Andrew>It's almost a predictable pattern of what your first MR will look like and the

00:17:33.840 --> 00:17:35.820
<v Andrew>first style conversations we'll have.

00:17:36.760 --> 00:17:44.140
<v Andrew>And then after a few iterations of feedback, people have made the transition.

00:17:44.380 --> 00:17:48.240
<v Andrew>They're Rust developers now and they don't look back.

00:17:50.350 --> 00:17:55.910
<v Matthias>I can relate to that. What were your main programming languages before you joined Scythe?

00:17:56.210 --> 00:18:00.970
<v Andrew>I had done C and C++, particularly in my distant past in grad school.

00:18:01.170 --> 00:18:06.030
<v Andrew>But a slightly idiosyncratic part of my journey is that my most recent job had

00:18:06.030 --> 00:18:09.730
<v Andrew>been 10 years at a company that used Java for robotics.

00:18:10.190 --> 00:18:15.050
<v Andrew>And so I was already coming from a slightly non-standard language.

00:18:15.410 --> 00:18:21.030
<v Andrew>And that maybe contributed to my willingness to pull up stakes and head it over to Rust instead.

00:18:22.330 --> 00:18:28.230
<v Matthias>And what were some of those stylistic, eureka moments that you had, given your background?

00:18:28.470 --> 00:18:33.030
<v Andrew>One of the design patterns that happens in Java a lot, and it happens in other

00:18:33.030 --> 00:18:35.070
<v Andrew>languages too, but Java particularly,

00:18:35.350 --> 00:18:40.010
<v Andrew>is using an immutable data structure

00:18:40.010 --> 00:18:44.450
<v Andrew>in order to signal that there is some need to keep data coherent.

00:18:44.750 --> 00:18:50.190
<v Andrew>So a structure has a collection of fields, and it's important for those fields

00:18:50.190 --> 00:18:51.530
<v Andrew>to stay consistent with each other.

00:18:51.750 --> 00:18:57.410
<v Andrew>Messing with just one of them is likely to cause some sort of inconsistency or bug.

00:18:57.830 --> 00:19:02.790
<v Andrew>And so in Java, you declare everything final, you don't give setters,

00:19:02.950 --> 00:19:07.810
<v Andrew>and that's a clear signal that this data should be treated as a package.

00:19:08.270 --> 00:19:11.670
<v Andrew>Unfortunately, when you do need to make changes, you often are making a lot

00:19:11.670 --> 00:19:16.630
<v Andrew>of copies of this same data just so that you're allowed to make the legitimate

00:19:16.630 --> 00:19:20.270
<v Andrew>changes you need to make through construction of a new copy.

00:19:21.550 --> 00:19:27.650
<v Andrew>But I came to Scythe sort of with this pattern well ingrained in me saying to

00:19:27.650 --> 00:19:30.810
<v Andrew>myself, when in doubt, a data structure should be immutable.

00:19:30.950 --> 00:19:33.230
<v Andrew>You should have a good reason to be able to mess with it.

00:19:33.830 --> 00:19:39.370
<v Andrew>And that was one of the early features of Rust that drew me in,

00:19:39.490 --> 00:19:44.850
<v Andrew>because clearly these ideas of when you're allowed to change data versus when

00:19:44.850 --> 00:19:49.890
<v Andrew>you have a shared reference and you basically can't mutate it, it's,

00:19:50.550 --> 00:19:54.350
<v Andrew>That's the first thing that people notice when they start writing Rust.

00:19:54.970 --> 00:19:59.650
<v Andrew>And then I noticed, oh, well, this language, this expressivity of saying,

00:19:59.810 --> 00:20:04.010
<v Andrew>oh, I have a shared reference or an exclusive reference to this structure.

00:20:04.150 --> 00:20:06.290
<v Andrew>I'm allowed to mutate it. Now I'm not.

00:20:06.710 --> 00:20:12.350
<v Andrew>I'm allowed to take a shared reference and mutate this data without making a copy of it.

00:20:12.970 --> 00:20:18.370
<v Andrew>And when I lose scope, when my exclusive reference goes out of scope,

00:20:18.550 --> 00:20:21.930
<v Andrew>I don't have mutable access to this structure anymore.

00:20:22.850 --> 00:20:28.210
<v Andrew>Suddenly, it was like the next level of this mutability-immutability concept

00:20:28.210 --> 00:20:29.610
<v Andrew>that I've been working with.

00:20:30.610 --> 00:20:35.750
<v Andrew>You could efficiently make changes when you need to in a way that very clearly

00:20:35.750 --> 00:20:38.450
<v Andrew>signaled that you were the only one allowed to make these changes.

00:20:38.450 --> 00:20:42.890
<v Andrew>And then give that access back and be confident that the data wouldn't change

00:20:42.890 --> 00:20:44.030
<v Andrew>when you weren't looking at it.

00:20:45.090 --> 00:20:51.270
<v Matthias>Okay. What I hear from you is that you value immutability now and explicitness.

00:20:52.070 --> 00:20:58.130
<v Matthias>The notion that if you return a thing that is immutable, it will stay immutable.

00:20:58.370 --> 00:21:02.290
<v Matthias>And also you do that explicitly. So you pass it back and then someone else can

00:21:02.290 --> 00:21:04.150
<v Matthias>work with the data, but not really mutate it.

00:21:04.490 --> 00:21:08.790
<v Andrew>I guess- This might be unique to robotics or not unique to robotics,

00:21:08.910 --> 00:21:14.990
<v Andrew>but might be particular to robotics, that quite often you are working with some

00:21:14.990 --> 00:21:17.530
<v Andrew>fact about the world, which is multidimensional.

00:21:17.810 --> 00:21:20.730
<v Andrew>All of these things are true right now at this instant.

00:21:20.910 --> 00:21:25.510
<v Andrew>And it's not really valid to talk about keeping 80% of these facts,

00:21:25.730 --> 00:21:26.930
<v Andrew>but not 100% of the facts.

00:21:27.070 --> 00:21:29.190
<v Andrew>I've made a package describing the world.

00:21:29.350 --> 00:21:33.350
<v Andrew>You need to make your decision based on this package of information, this struct.

00:21:33.690 --> 00:21:39.450
<v Andrew>Please do not take this struct apart and change any of the pieces because it's

00:21:39.450 --> 00:21:45.610
<v Andrew>only true when it's all together that that kind of multi-dimensionality truth

00:21:45.610 --> 00:21:49.070
<v Andrew>is i think a robotic specific feature.

00:21:50.020 --> 00:21:56.100
<v Matthias>It reminds me of a talk that I saw the other day by Jon Gjengset about a type-safe

00:21:56.100 --> 00:22:00.620
<v Matthias>spatial math library in Rust called Sguaba. We will link to it in the show notes.

00:22:00.820 --> 00:22:05.780
<v Matthias>It is for locations of objects in space.

00:22:06.400 --> 00:22:12.040
<v Matthias>And it feels like a lot of people use Rust for that specific purpose because

00:22:12.040 --> 00:22:16.220
<v Matthias>of its safety guarantees, because of its expressive type system.

00:22:16.760 --> 00:22:22.240
<v Matthias>It feels like you're kind of agreeing with this and you're also working towards that.

00:22:22.880 --> 00:22:26.700
<v Andrew>Absolutely. And I think when you say the expressive type system,

00:22:27.000 --> 00:22:36.740
<v Andrew>that is the door that opened up to the Rust way of seeing the world that I didn't

00:22:36.740 --> 00:22:37.980
<v Andrew>know about when I joined Scythe.

00:22:38.100 --> 00:22:45.120
<v Andrew>As a complete Rust novice, I did not see the value of an expressive type system.

00:22:45.480 --> 00:22:51.040
<v Matthias>Now, I'm not a Java developer, but to me it feels like Java also has a very

00:22:51.040 --> 00:22:52.120
<v Matthias>expressive type system.

00:22:52.320 --> 00:22:55.100
<v Matthias>Couldn't you encode the same invariance with Java?

00:22:55.880 --> 00:23:02.420
<v Andrew>It's absolutely true that Java has an expressive type system that can be used

00:23:02.420 --> 00:23:03.840
<v Andrew>in a lot of different ways.

00:23:04.560 --> 00:23:13.700
<v Andrew>I think Rust's decision to essentially not do inheritance or not make inheritance easy.

00:23:14.830 --> 00:23:24.370
<v Andrew>Leads to the Rust-type system being used in different ways to much greater effect.

00:23:24.750 --> 00:23:36.290
<v Andrew>The Java capability of classes inheriting from each other leads to a lot of

00:23:36.290 --> 00:23:39.390
<v Andrew>elaboration and customization of a class.

00:23:39.470 --> 00:23:42.610
<v Andrew>Oh, I want this, but I want it to act a little bit differently,

00:23:42.610 --> 00:23:45.030
<v Andrew>So I'm going to inherit from it and make a few changes.

00:23:45.410 --> 00:23:50.530
<v Andrew>For me, the first thing that I think about when I think about the Rust expressive

00:23:50.530 --> 00:24:00.250
<v Andrew>type system is the expressive enums and data carrying variants of enums.

00:24:00.250 --> 00:24:07.010
<v Andrew>And so Rust encourages you not to build deep,

00:24:07.210 --> 00:24:11.610
<v Andrew>deep hierarchies of classes inheriting from each other and making everything

00:24:11.610 --> 00:24:15.570
<v Andrew>more complicated as you go, until sometimes you don't quite understand what's

00:24:15.570 --> 00:24:17.850
<v Andrew>happening at the bottom of this long chain of inheritance.

00:24:17.850 --> 00:24:24.170
<v Andrew>Instead, Rust encourages you to make a single layer of hierarchy,

00:24:24.350 --> 00:24:30.190
<v Andrew>a single enum with all of the possibilities enumerated alongside each other in parallel.

00:24:30.650 --> 00:24:36.230
<v Andrew>And so you have a lot of expressivity and you can use it for a lot of things.

00:24:37.510 --> 00:24:41.030
<v Andrew>But it doesn't get so deep so as to be obscure.

00:24:41.390 --> 00:24:45.410
<v Andrew>You can usually trust that you only need to look one place in your Rust code

00:24:45.410 --> 00:24:48.470
<v Andrew>base to understand the range of options which is available to you.

00:24:49.610 --> 00:24:55.550
<v Matthias>Yeah. It almost feels like the Java ecosystem encourages inheritance.

00:24:56.190 --> 00:24:57.090
<v Andrew>Oh, absolutely.

00:24:58.370 --> 00:25:01.090
<v Andrew>And I think it's fair to

00:25:01.090 --> 00:25:09.390
<v Andrew>say that Java developed to take maximum advantage of inheritance before there

00:25:09.390 --> 00:25:18.490
<v Andrew>was a language design pushback to say maybe inheritance is making things more

00:25:18.490 --> 00:25:19.710
<v Andrew>complicated than it's worth.

00:25:19.710 --> 00:25:28.090
<v Andrew>And I think you can see that those design ideas coming out a little bit after

00:25:28.090 --> 00:25:31.230
<v Andrew>Java's maximum flourishing and growth.

00:25:31.370 --> 00:25:37.770
<v Andrew>When Java settled down and became a stable sort of industry background choice,

00:25:38.150 --> 00:25:45.270
<v Andrew>after that there kind of was a counterreaction to inheritance being used as

00:25:45.270 --> 00:25:47.590
<v Andrew>the design feature to solve all design problems.

00:25:49.230 --> 00:25:51.970
<v Matthias>You came to scythe with all of

00:25:51.970 --> 00:25:58.530
<v Matthias>that background and knowing that there might be some work on on the rust side

00:25:58.530 --> 00:26:05.390
<v Matthias>maybe with hardware that maybe is not familiar to you sensors and so on it sounds

00:26:05.390 --> 00:26:10.910
<v Matthias>like a very daunting challenge and you still signed with them,

00:26:11.760 --> 00:26:15.940
<v Matthias>Knowing all of that, what was your thought process back then?

00:26:16.100 --> 00:26:19.620
<v Matthias>Were you curious about what it was all about to work on that level?

00:26:19.860 --> 00:26:23.160
<v Matthias>Were you curious about the project? What was the main driver for you?

00:26:23.480 --> 00:26:29.520
<v Andrew>I was excited to learn. It was absolutely a daunting challenge for all the reasons you're describing.

00:26:29.740 --> 00:26:34.300
<v Andrew>I knew that I was signing up to learn some new skills.

00:26:34.780 --> 00:26:38.300
<v Andrew>I had been working with Java for 10 years. That's a point in your career where

00:26:38.300 --> 00:26:42.140
<v Andrew>you say, okay, maybe this is where I've settled. Maybe this is who I am and

00:26:42.140 --> 00:26:43.340
<v Andrew>this is my core competency.

00:26:44.460 --> 00:26:48.400
<v Andrew>It, it felt adventurous. It felt like a bit like, a bit like jumping off a cliff,

00:26:48.440 --> 00:26:53.220
<v Andrew>but I'm glad to say that I was jumping off the cliff into, into a wonderful, warm swimming pool.

00:26:53.360 --> 00:26:56.360
<v Andrew>And it was, and the water was fine. And I greatly enjoyed the transition.

00:26:57.040 --> 00:26:59.260
<v Andrew>Um, the, the.

00:27:00.350 --> 00:27:09.350
<v Andrew>It was a chance to learn new things and to pick up old problems with new tools.

00:27:09.790 --> 00:27:18.750
<v Andrew>The robotic algorithmic challenges that Scythe is facing is the same as the

00:27:18.750 --> 00:27:24.310
<v Andrew>algorithmic challenges faced by many mobile robotics applications. You need to plan paths.

00:27:24.450 --> 00:27:27.890
<v Andrew>You need to verify that your trajectories have no collisions.

00:27:27.890 --> 00:27:34.070
<v Andrew>You need to sequence a collection of work in a schedule that makes sense.

00:27:34.330 --> 00:27:40.510
<v Andrew>These are all problems that many robotics companies need to solve.

00:27:40.650 --> 00:27:46.990
<v Andrew>And they always have to solve them using custom approaches. It's rare to get

00:27:46.990 --> 00:27:53.910
<v Andrew>a clean solution that solves the entire class of path planning, for example.

00:27:54.970 --> 00:27:59.890
<v Andrew>Domain specificity is almost always a feature of the problems faced in robotics.

00:28:00.110 --> 00:28:04.230
<v Andrew>You really need to grapple with the very specific features of your application.

00:28:04.370 --> 00:28:08.390
<v Andrew>Oh, I have a lawnmower. That means I'm trying to cover all the grass.

00:28:08.570 --> 00:28:11.550
<v Andrew>I'm not interested in finding the shortest path from point A to point B.

00:28:11.730 --> 00:28:15.330
<v Andrew>I'm interested in finding the path from point A to point B that covers the lawn,

00:28:15.510 --> 00:28:17.430
<v Andrew>that gets all of the grass mowed.

00:28:19.470 --> 00:28:26.390
<v Andrew>These kind of domain-specific features mean that a lot of implementations are

00:28:26.390 --> 00:28:31.470
<v Andrew>always going to be in-house and whether you've chosen the right tool for the

00:28:31.470 --> 00:28:34.810
<v Andrew>job or not changes your quality of life as a developer.

00:28:35.350 --> 00:28:42.490
<v Andrew>I'll bring it back and I'll say that Rust has allowed us to solve many of these

00:28:42.490 --> 00:28:51.370
<v Andrew>classic problems in our own way using code that that we trust that we got right the first time mm-hmm.

00:28:52.190 --> 00:28:59.730
<v Matthias>That means you write it, you build it, and it runs more or less indefinitely without any problems?

00:29:00.210 --> 00:29:03.490
<v Andrew>The joke is, if it compiles, it works. And I don't believe that.

00:29:03.670 --> 00:29:10.870
<v Andrew>You can always make mistakes. But your mistakes will be like logic errors, not safety errors.

00:29:11.450 --> 00:29:13.570
<v Andrew>Testing is a huge investment for us.

00:29:14.730 --> 00:29:19.710
<v Andrew>Every feature we write, every piece of code we write, needs to be tested thoroughly

00:29:19.710 --> 00:29:22.370
<v Andrew>in order to be trusted to work in the autonomous space.

00:29:22.570 --> 00:29:29.150
<v Andrew>To move a 1,400-pound machine with spinning blades through space is a daunting challenge.

00:29:29.270 --> 00:29:35.450
<v Andrew>We take it very seriously to verify that the code we write does the job.

00:29:36.090 --> 00:29:40.890
<v Andrew>Every test is an investment. Every test has a cost.

00:29:41.330 --> 00:29:47.690
<v Andrew>It is incredibly powerful to say that an entire class of bugs has been excluded

00:29:47.690 --> 00:29:51.230
<v Andrew>through what the compiler does for you.

00:29:51.390 --> 00:29:56.510
<v Andrew>You don't have to worry about running it for hours and hours and hours just

00:29:56.510 --> 00:29:59.370
<v Andrew>to make sure you don't leak memory. The compiler did that.

00:29:59.990 --> 00:30:03.130
<v Andrew>We need to worry about whether the robot turns right instead of turning left.

00:30:03.370 --> 00:30:06.270
<v Andrew>That's the kind of mistake that the compiler won't catch for us.

00:30:06.270 --> 00:30:15.230
<v Andrew>But fundamentals of the stability of the the embedded compute those are largely

00:30:15.230 --> 00:30:21.690
<v Andrew>handled and we don't need to invest we don't need to focus our testing attention there.

00:30:22.890 --> 00:30:27.790
<v Matthias>That's incredible to see tests as an investment this is what it should be because

00:30:27.790 --> 00:30:31.370
<v Matthias>an investment has a potential payoff in the future it's.

00:30:31.370 --> 00:30:33.570
<v Andrew>Absolutely and there's a there's

00:30:33.570 --> 00:30:40.790
<v Andrew>a maturity process as your technology evolves, that in the early days,

00:30:41.720 --> 00:30:45.980
<v Andrew>Testing is easy and a little bit discouraging because your robot runs successfully

00:30:45.980 --> 00:30:48.740
<v Andrew>for five minutes and then encounters a fatal error.

00:30:49.080 --> 00:30:51.420
<v Andrew>And so your cycles can be very, very fast.

00:30:51.780 --> 00:30:55.840
<v Andrew>And relatively speaking, your testing investment is relatively light.

00:30:56.200 --> 00:30:59.840
<v Andrew>Five minutes of work gets you a new bug and off you go and you've got something to work on that day.

00:31:00.300 --> 00:31:08.060
<v Andrew>As your technology matures, as you dial your system in, suddenly you have to

00:31:08.060 --> 00:31:11.620
<v Andrew>test for long, long periods of time before you find something actionable.

00:31:11.720 --> 00:31:17.100
<v Andrew>And so you're putting in hours and hours and hours in the field to find one

00:31:17.100 --> 00:31:20.700
<v Andrew>piece of information which you can take back. And maybe it's no longer a fatal error.

00:31:20.860 --> 00:31:23.320
<v Andrew>Maybe we're not even talking about the robot stopping.

00:31:23.540 --> 00:31:27.240
<v Andrew>Maybe we're just talking about the robot doing something that we would prefer it not do.

00:31:27.240 --> 00:31:33.780
<v Andrew>And so the amount of time you need to put in to find, oh, statistically,

00:31:34.440 --> 00:31:39.900
<v Andrew>we're not quite hitting all of these cases exactly the way we would like.

00:31:39.900 --> 00:31:45.520
<v Andrew>We would rather lift this percentage from 40% up to 70%, please.

00:31:45.660 --> 00:31:48.980
<v Andrew>But it took us 200 hours of testing to gather that information.

00:31:49.720 --> 00:31:53.960
<v Andrew>You know you're doing your job right when your testing budget starts getting

00:31:53.960 --> 00:31:58.480
<v Andrew>very, very large. because you need so much time to gain statistical power on

00:31:58.480 --> 00:32:00.060
<v Andrew>the features you're trying to investigate.

00:32:00.820 --> 00:32:07.240
<v Matthias>Yeah. There's always this point in every project where you make a change and

00:32:07.240 --> 00:32:12.040
<v Matthias>it breaks and then you take a step back and you realize, no, in fact,

00:32:12.280 --> 00:32:19.120
<v Matthias>the system prevented a bug here and the system is more robust than I thought it was already.

00:32:19.600 --> 00:32:22.440
<v Matthias>It's always very enlightening.

00:32:22.440 --> 00:32:26.080
<v Andrew>And that is somewhere where Rust shines.

00:32:26.440 --> 00:32:35.580
<v Andrew>The general Rust pattern of non-exclusive coverage being a compile time error

00:32:35.580 --> 00:32:39.500
<v Andrew>saves so much time and effort.

00:32:40.620 --> 00:32:46.140
<v Andrew>I think this is another one of those patterns, which are particular to robotics,

00:32:46.780 --> 00:32:50.120
<v Andrew>is highly coupled state across components.

00:32:50.480 --> 00:32:56.320
<v Andrew>We try to take our complete problem, make this robot drive autonomously.

00:32:56.520 --> 00:33:00.840
<v Andrew>When we try to break it down, we try to decompose it into components in a stack.

00:33:01.520 --> 00:33:05.940
<v Andrew>Each component is responsible for an aspect of the decision making.

00:33:07.920 --> 00:33:10.860
<v Andrew>And ideally we would hope that those those

00:33:10.860 --> 00:33:14.140
<v Andrew>components were very cleanly separated and the information

00:33:14.140 --> 00:33:18.780
<v Andrew>they they share between them is extremely limited the reality is that you're

00:33:18.780 --> 00:33:23.560
<v Andrew>always fighting against the tendency to to couple your data across your components

00:33:23.560 --> 00:33:29.220
<v Andrew>severely that data is useful it's very important information to know what kind

00:33:29.220 --> 00:33:33.100
<v Andrew>of mission you're doing so a task planning level concern.

00:33:33.100 --> 00:33:36.760
<v Andrew>It's very useful to have that information down when you're deciding how the

00:33:36.760 --> 00:33:39.040
<v Andrew>robot should move through space when you're making a trajectory decision.

00:33:39.920 --> 00:33:47.900
<v Andrew>And so a large robotics code base tends to have long range coupling across components,

00:33:48.220 --> 00:33:51.100
<v Andrew>even though architecturally we're fighting against that as hard as we can.

00:33:51.280 --> 00:33:54.380
<v Andrew>But those couplings still exist.

00:33:54.680 --> 00:34:00.020
<v Andrew>It's incredibly valuable that when you make a change in a data structure in one part of the system,

00:34:00.240 --> 00:34:05.380
<v Andrew>the compiler catches the 10 errors you didn't think of because you had those

00:34:05.380 --> 00:34:09.240
<v Andrew>long range couplings and now your trajectory planner needs to be rewritten to

00:34:09.240 --> 00:34:12.400
<v Andrew>handle the change that you made to the task planner's data structure.

00:34:12.540 --> 00:34:15.720
<v Andrew>If your data structure has changed and you haven't covered all the cases,

00:34:15.960 --> 00:34:20.640
<v Andrew>it's an error, catches so many of these long range dependencies that otherwise

00:34:20.640 --> 00:34:24.220
<v Andrew>would be difficult, that would be runtime errors instead of compile time.

00:34:25.290 --> 00:34:29.410
<v Matthias>Now, wouldn't that be a property of a static type system, though?

00:34:29.670 --> 00:34:39.570
<v Andrew>Honestly, I think it's more about idiom and design philosophy.

00:34:39.810 --> 00:34:48.450
<v Andrew>So, for example, if you define a struct in Rust and you add a field,

00:34:49.190 --> 00:34:57.270
<v Andrew>If somebody tries to construct that struct and they haven't provided that last

00:34:57.270 --> 00:35:00.490
<v Andrew>new field because they didn't know about it, because this is one of those long

00:35:00.490 --> 00:35:01.790
<v Andrew>range dependencies we were talking about.

00:35:02.860 --> 00:35:10.460
<v Andrew>That is a compile time error unless you used the default annotation and unless

00:35:10.460 --> 00:35:14.260
<v Andrew>you said that it's possible for fields to be filled in by default.

00:35:14.480 --> 00:35:22.160
<v Andrew>So in Rust, it's possible to kind of remove this safety feature that if you

00:35:22.160 --> 00:35:26.460
<v Andrew>haven't specified every field of your struct, you can't build it.

00:35:27.600 --> 00:35:30.360
<v Andrew>But as the idiom if you say to yourself i would

00:35:30.360 --> 00:35:33.320
<v Andrew>rather not use default when i when i don't have to because

00:35:33.320 --> 00:35:36.080
<v Andrew>i kind of want to keep this feature of of like if

00:35:36.080 --> 00:35:38.840
<v Andrew>i if i've forgotten one of my fields i want to know about it

00:35:38.840 --> 00:35:42.000
<v Andrew>then uh then then you have that property it's

00:35:42.000 --> 00:35:45.240
<v Andrew>this this example of of

00:35:45.240 --> 00:35:52.060
<v Andrew>all fields being necessary is is just one of the of these kind of non-exhaustive

00:35:52.060 --> 00:35:57.440
<v Andrew>non-exhaustive coverage means error patterns another one is is match statements

00:35:57.440 --> 00:36:01.040
<v Andrew>or or pattern matching in general if your pattern matching isn't exhaustive

00:36:01.040 --> 00:36:03.880
<v Andrew>rust will tell you about it that isn't true in other languages.

00:36:03.880 --> 00:36:09.360
<v Matthias>Yeah yeah you could still use an underscore for a match

00:36:09.360 --> 00:36:10.520
<v Matthias>case. But

00:36:10.520 --> 00:36:16.460
<v Matthias>If i understand you correctly it's sort of an anti-pattern in a larger application

00:36:16.460 --> 00:36:18.040
<v Matthias>that favors correctness.

00:36:18.040 --> 00:36:20.680
<v Andrew>Absolutely and so it is

00:36:20.680 --> 00:36:23.620
<v Andrew>fair to say that that that Rust doesn't doesn't

00:36:23.620 --> 00:36:26.380
<v Andrew>do all of the work here for you that that like like you said there are there

00:36:26.380 --> 00:36:30.140
<v Andrew>are there are ways to to

00:36:30.140 --> 00:36:35.980
<v Andrew>have defaults or to to have the underscore match and they are it almost feels

00:36:35.980 --> 00:36:41.160
<v Andrew>like like it's it's context whether it's appropriate or inappropriate there's

00:36:41.160 --> 00:36:44.480
<v Andrew>plenty of times when it's fine to use underscore or to catch all the remaining

00:36:44.480 --> 00:36:46.380
<v Andrew>cases in the match. That's fine.

00:36:47.970 --> 00:36:55.510
<v Andrew>That becomes kind of company style or company culture almost where you are encouraged

00:36:55.510 --> 00:36:58.430
<v Andrew>or discouraged from using these kind of patterns.

00:36:59.450 --> 00:37:04.470
<v Matthias>Yeah. Do you have a coding guideline at Scythe?

00:37:04.630 --> 00:37:08.170
<v Matthias>And how does the review process look like? Do you look at such patterns,

00:37:08.350 --> 00:37:10.990
<v Matthias>tell people about it and tell them why it's a bad thing?

00:37:11.950 --> 00:37:16.610
<v Andrew>That would be an aspect of our growth that I'd love to see. We tend to hold

00:37:16.610 --> 00:37:24.470
<v Andrew>these kinds of styles as more of a culture than an explicit style guide.

00:37:25.430 --> 00:37:29.090
<v Andrew>Clippy gets us halfway there, by the way. Clippy has so many requirements,

00:37:29.290 --> 00:37:35.310
<v Andrew>so many good requirements, so many solid requirements that are enforced in our tool chain.

00:37:35.410 --> 00:37:38.910
<v Andrew>So it's not true that it's completely a free-for-all.

00:37:39.730 --> 00:37:46.010
<v Andrew>It is more about our code review practices that we say to ourselves,

00:37:46.150 --> 00:37:53.090
<v Andrew>okay, when we review code, we all know that we prefer to see things written this way.

00:37:53.090 --> 00:38:01.370
<v Andrew>We never use any of the functions which can plausibly panic.

00:38:01.630 --> 00:38:05.450
<v Andrew>Don't unwrap. Unwrap or else. Those sort of choices.

00:38:06.450 --> 00:38:11.410
<v Andrew>There are code bases, there are circumstances where panicking under unforeseen

00:38:11.410 --> 00:38:13.190
<v Andrew>conditions is entirely the appropriate thing to do.

00:38:13.690 --> 00:38:19.290
<v Andrew>We prefer not to do it because we would rather not panic our robot process as

00:38:19.290 --> 00:38:21.110
<v Andrew>it is trying to decide whether to go left or right.

00:38:22.020 --> 00:38:28.860
<v Matthias>Earlier, you said that the times to find a bug tend to become longer and longer,

00:38:28.940 --> 00:38:30.960
<v Matthias>the more robust the system becomes.

00:38:31.840 --> 00:38:38.260
<v Matthias>What are some of the problems that you find, if you allow me to put in the field with that robot?

00:38:38.880 --> 00:38:44.980
<v Matthias>It's probably, is it more of a business logic problem or a systems problem or

00:38:44.980 --> 00:38:47.780
<v Matthias>a domain problem? What is it that you find?

00:38:48.960 --> 00:38:52.080
<v Andrew>We are always striving to to improve

00:38:52.080 --> 00:38:54.900
<v Andrew>the reliability of the of the

00:38:54.900 --> 00:38:57.920
<v Andrew>machine expressed as the the

00:38:57.920 --> 00:39:03.260
<v Andrew>number of interventions that that you need to make when the the the robot is

00:39:03.260 --> 00:39:08.720
<v Andrew>in the field mowing and that's a function of the the difficulty of the the the

00:39:08.720 --> 00:39:12.280
<v Andrew>job that you're you're doing i mentioned before about the progression from up

00:39:12.280 --> 00:39:16.120
<v Andrew>the ski slope of of difficulty as we get better,

00:39:16.360 --> 00:39:20.860
<v Andrew>our customers trust us and put our robot in more and more difficult situations.

00:39:21.260 --> 00:39:27.680
<v Andrew>So that's the heart of our defect discovery through testing.

00:39:27.860 --> 00:39:32.340
<v Andrew>We say to ourselves, we know that our customers this year are putting our robot

00:39:32.340 --> 00:39:34.320
<v Andrew>through more difficult scenarios.

00:39:34.560 --> 00:39:39.920
<v Andrew>Let's say, for example, with respect to slopes. Sloped fields are more difficult

00:39:39.920 --> 00:39:42.640
<v Andrew>to do robot control in than nice flat green fields.

00:39:42.760 --> 00:39:46.820
<v Andrew>And so we'll say to ourselves, okay, we are going to ensure that our selection

00:39:46.820 --> 00:39:52.660
<v Andrew>of testing fields, the grass we mow in order to test, we're going to make sure

00:39:52.660 --> 00:39:54.520
<v Andrew>it includes a lot of slopes.

00:39:54.740 --> 00:39:57.980
<v Andrew>And so we're going to make our testing problem more difficult for ourselves.

00:39:58.340 --> 00:40:02.880
<v Andrew>Okay, now we measure the number of times when we.

00:40:03.830 --> 00:40:06.630
<v Andrew>When our robot trajectory goes too far away from

00:40:06.630 --> 00:40:09.350
<v Andrew>nominal as you're trying to to turn on a

00:40:09.350 --> 00:40:12.390
<v Andrew>slope and we say to ourselves well we want to bring that we we

00:40:12.390 --> 00:40:15.610
<v Andrew>want to bring these number of defects down they may not even be defects that

00:40:15.610 --> 00:40:18.510
<v Andrew>require any intervention and they certainly aren't aren't defects that lead

00:40:18.510 --> 00:40:23.450
<v Andrew>to any kind of of safety incident it's just we want the robot to to track more

00:40:23.450 --> 00:40:29.070
<v Andrew>solidly on on hills than it is already and we call it we call it a defect when

00:40:29.070 --> 00:40:30.210
<v Andrew>when it exceeds these bounds.

00:40:30.510 --> 00:40:38.730
<v Andrew>And okay, so we're now having one of these kind of trajectory defects every

00:40:38.730 --> 00:40:40.450
<v Andrew>five hours of operation.

00:40:40.730 --> 00:40:43.250
<v Andrew>Let's get that to one every 10 hours of operation.

00:40:43.970 --> 00:40:48.630
<v Andrew>That's the kind of defect that we're chasing when we're on a mature autonomous robotic system.

00:40:48.870 --> 00:40:55.110
<v Andrew>And it doesn't quite even fit into the rubric of code correctness anymore.

00:40:55.250 --> 00:41:00.170
<v Andrew>Now this is more like capabilities and tuning. So we say, okay, we are going to.

00:41:01.230 --> 00:41:05.890
<v Andrew>We are going to increase this parameter in order to emphasize tracking to the

00:41:05.890 --> 00:41:07.370
<v Andrew>desired trajectory more solidly.

00:41:07.590 --> 00:41:12.210
<v Andrew>Well, that has consequences. That leads to a probabilistic defect in other parts

00:41:12.210 --> 00:41:16.870
<v Andrew>of the system because the robot is now tracking more or is more solidly tracking

00:41:16.870 --> 00:41:18.430
<v Andrew>its desired trajectory.

00:41:18.630 --> 00:41:23.090
<v Andrew>That means in a different scenario than the robots on a slope,

00:41:23.250 --> 00:41:29.550
<v Andrew>when the robot is navigating around an unexpected obstacle, something different

00:41:29.550 --> 00:41:32.210
<v Andrew>happens with its performance. And now we're in a trade-off space.

00:41:32.370 --> 00:41:36.590
<v Andrew>Do we want to change our defects on slopes or do we want to change our defects

00:41:36.590 --> 00:41:38.270
<v Andrew>when navigating around obstacles?

00:41:38.730 --> 00:41:42.650
<v Andrew>And now it's a whole conversation about what's more important to us and what

00:41:42.650 --> 00:41:46.370
<v Andrew>the customer will value more in terms of a reliable machine.

00:41:46.370 --> 00:41:49.710
<v Matthias>I watched a talk from the Oxidize conference

00:41:49.710 --> 00:41:53.470
<v Matthias>from 2024 recently and in

00:41:53.470 --> 00:41:56.770
<v Matthias>there there was a company which described a navigation

00:41:56.770 --> 00:42:00.050
<v Matthias>or a planning system for autonomous robots

00:42:00.050 --> 00:42:02.850
<v Matthias>in a warehouse scenario where they

00:42:02.850 --> 00:42:07.730
<v Matthias>had multiple small robots and they would find a common trajectory for all of

00:42:07.730 --> 00:42:14.830
<v Matthias>them they used a system for deterministic testing they had an event log on each

00:42:14.830 --> 00:42:20.370
<v Matthias>machine and And then they could replay the exact scenario that happened,

00:42:20.370 --> 00:42:22.410
<v Matthias>which caused a deadlock.

00:42:22.630 --> 00:42:26.530
<v Matthias>Is that a thing that you can apply to your domain as well?

00:42:26.870 --> 00:42:32.630
<v Andrew>I love determinism so much. It is such a precious jewel to gain it when you have it.

00:42:32.770 --> 00:42:35.550
<v Andrew>And it is so hard to achieve.

00:42:37.950 --> 00:42:44.430
<v Andrew>That is an incredible investment which yields incredible rewards in robotics.

00:42:45.460 --> 00:42:50.140
<v Andrew>I'm sorry to say that most of our systems do not have that fundamental determinism.

00:42:50.240 --> 00:42:53.320
<v Andrew>First of all, the real world doesn't bring that kind of determinism.

00:42:53.820 --> 00:42:58.760
<v Andrew>The variations in timing of events in the real world,

00:42:58.880 --> 00:43:04.220
<v Andrew>the variations of how a wheeled robot on a slope behaves means that every real

00:43:04.220 --> 00:43:10.320
<v Andrew>world scenario is a unique and unreproducible event.

00:43:11.790 --> 00:43:18.230
<v Andrew>Even in purely simulation-based testing, determinism and reproducibility is

00:43:18.230 --> 00:43:19.490
<v Andrew>very, very hard to achieve.

00:43:19.710 --> 00:43:23.370
<v Andrew>We haven't achieved that in general on all of our simulators.

00:43:24.590 --> 00:43:29.810
<v Andrew>There are many smaller components, unit testing and integration testing of isolated

00:43:29.810 --> 00:43:33.350
<v Andrew>components, where we require and where we achieve that kind of determinism.

00:43:33.390 --> 00:43:40.010
<v Andrew>Because it is an enormous asset in root-causing your problems.

00:43:40.010 --> 00:43:45.910
<v Andrew>When you have a fully reproducible example that you are confident you can get back anytime you need.

00:43:46.190 --> 00:43:50.610
<v Andrew>Eventually, you can take that scenario and make it one of your integration tests

00:43:50.610 --> 00:43:56.130
<v Andrew>and come back to it to confirm that you've fixed the bug and it's stayed fixed

00:43:56.130 --> 00:44:01.650
<v Andrew>for as long as your system exists. So I respect it.

00:44:01.970 --> 00:44:10.450
<v Andrew>It's the kind of system feature which is very valuable. It takes a huge investment to get there.

00:44:10.450 --> 00:44:18.630
<v Matthias>Yeah and and even then you might not be 100% sure if it's worth it to pay to

00:44:18.630 --> 00:44:24.010
<v Matthias>pay that price because you might as well work on features at the same time or

00:44:24.010 --> 00:44:29.350
<v Matthias>maybe absolutely find another way how to test it in in the real world yeah.

00:44:29.350 --> 00:44:39.170
<v Andrew>The the reality of the of a startup with a short funding timeframe and a lean

00:44:39.170 --> 00:44:45.690
<v Andrew>team of engineers is that you really have to make careful trade-off choices

00:44:45.690 --> 00:44:48.670
<v Andrew>about which features you're going to invest in.

00:44:50.210 --> 00:44:56.830
<v Andrew>I've sung the praises of deterministic simulation, and I really believe that we may get there one day.

00:44:57.470 --> 00:45:02.170
<v Andrew>It's not the best thing for us to build right now.

00:45:03.270 --> 00:45:09.350
<v Matthias>Yeah. And even before you do that, you probably want to invest in a good failover

00:45:09.350 --> 00:45:12.110
<v Matthias>system, which you already have in place.

00:45:12.110 --> 00:45:19.430
<v Matthias>You briefly mentioned the disengagement scenario where for example you might see that there's some,

00:45:20.930 --> 00:45:25.870
<v Matthias>fundamental condition which is incorrect in the system so like an invariant

00:45:25.870 --> 00:45:30.470
<v Matthias>and then you you want someone to take over so there's probably a way for you

00:45:30.470 --> 00:45:35.430
<v Matthias>to say okay we can't handle the situation right now stop the engine and wait

00:45:35.430 --> 00:45:38.050
<v Matthias>for manual intervention this.

00:45:38.050 --> 00:45:45.270
<v Andrew>Is one of the the application specific advantages of the lawn mowing application in particular.

00:45:45.590 --> 00:45:50.130
<v Andrew>You don't have that freedom if you are building an autonomous car that's moving

00:45:50.130 --> 00:45:51.990
<v Andrew>down the freeway at 100 kilometers an hour.

00:45:52.170 --> 00:45:55.970
<v Andrew>You don't have the freedom to say, oh, this situation is off nominal.

00:45:55.970 --> 00:45:57.810
<v Andrew>I will simply disengage.

00:45:58.050 --> 00:46:00.370
<v Andrew>Your path to safety is complicated.

00:46:00.770 --> 00:46:07.650
<v Andrew>When you are mowing a lawn, your path to safety is short and assured. You just have to stop.

00:46:07.930 --> 00:46:11.670
<v Andrew>If your system is, if your conditions are sufficiently off nominal,

00:46:11.890 --> 00:46:16.170
<v Andrew>bring the drive motors to a stop, bring the blades to a stop and ask for help.

00:46:16.390 --> 00:46:17.110
<v Andrew>Everything will be okay.

00:46:17.550 --> 00:46:22.970
<v Andrew>Nobody is depending on you to get to the side of the road or to bring other

00:46:22.970 --> 00:46:26.090
<v Andrew>hazardous components to a safe state.

00:46:26.310 --> 00:46:33.330
<v Andrew>It's an application where safety is still critical, but there is a simple story

00:46:33.330 --> 00:46:34.730
<v Andrew>to how to make the system safe.

00:46:35.390 --> 00:46:42.130
<v Andrew>So, yeah, just to summarize, a deterministic system in simulation is incredibly

00:46:42.130 --> 00:46:46.630
<v Andrew>valuable, but it's not the most valuable thing for us to build right away.

00:46:47.790 --> 00:46:55.150
<v Andrew>The startup world means making hard implementation trade-offs as to what will

00:46:55.150 --> 00:46:57.690
<v Andrew>be the most valuable thing for your customers to build next.

00:46:58.720 --> 00:47:01.760
<v Andrew>And so our investments have gone to other places.

00:47:02.080 --> 00:47:07.380
<v Matthias>Which brings us to today. What is the current state of the code base?

00:47:07.520 --> 00:47:10.380
<v Matthias>How much of it is in Rust? How much of it is in C++?

00:47:10.860 --> 00:47:14.000
<v Matthias>Do you still use ROS and to what extent?

00:47:14.660 --> 00:47:23.320
<v Andrew>Yes. So the ROS is the middleware that is the backbone of the system.

00:47:23.680 --> 00:47:28.920
<v Andrew>ROS stands for robot operating system, But it's best understood as inter-process

00:47:28.920 --> 00:47:33.200
<v Andrew>communication, along with an ecosystem of tools for simulation,

00:47:33.500 --> 00:47:37.400
<v Andrew>for observability, for injection, and other capabilities.

00:47:38.200 --> 00:47:45.580
<v Andrew>So ROS moves the data around our system. Most of our perception stack is in C++.

00:47:46.200 --> 00:47:52.780
<v Andrew>The ability to work with GPUs and CUDA in Rust is maturing.

00:47:53.000 --> 00:47:57.180
<v Andrew>And there are exciting projects right now. But over the history of Scythe's

00:47:57.180 --> 00:48:01.220
<v Andrew>development, that has been similar where C++ has stayed very strong.

00:48:01.680 --> 00:48:05.020
<v Andrew>So most of our perception stack is in C++.

00:48:05.420 --> 00:48:10.200
<v Andrew>That information gets moved from the perception processes over to the autonomy

00:48:10.200 --> 00:48:13.300
<v Andrew>processes using ROS as the middleware.

00:48:13.660 --> 00:48:17.560
<v Andrew>Almost all of our autonomy code is in Rust. so that

00:48:17.560 --> 00:48:20.740
<v Andrew>is every decision we make once we have

00:48:20.740 --> 00:48:24.460
<v Andrew>assembled our perception of the world our our

00:48:24.460 --> 00:48:27.760
<v Andrew>task planning we decide what we're deciding we're doing next at

00:48:27.760 --> 00:48:30.920
<v Andrew>the high level our navigation are deciding

00:48:30.920 --> 00:48:34.140
<v Andrew>where we're going to move and how we're going to get there and our

00:48:34.140 --> 00:48:37.100
<v Andrew>trajectory and motor control so all the way down to deciding what

00:48:37.100 --> 00:48:40.480
<v Andrew>torques should be applied to to the motors is is

00:48:40.480 --> 00:48:46.560
<v Andrew>a decision being made in rust we favor an actor-based framework inside our Rust

00:48:46.560 --> 00:48:51.860
<v Andrew>system to decompose the problem down into components that exchange messages

00:48:51.860 --> 00:48:57.320
<v Andrew>as a way of prompting each other to make decisions or sharing information with each other.

00:48:58.140 --> 00:49:06.640
<v Andrew>And so I've mentioned before that most of our software engineers join our company not knowing Rust.

00:49:06.820 --> 00:49:13.640
<v Andrew>And they develop into application-level developers who write Rust to solve robot

00:49:13.640 --> 00:49:14.740
<v Andrew>decision-making problems.

00:49:14.920 --> 00:49:20.280
<v Andrew>There are also some engineers at our company who are deep Rust experts who showed

00:49:20.280 --> 00:49:23.080
<v Andrew>up with very deep knowledge.

00:49:23.500 --> 00:49:26.420
<v Andrew>And one of the parts of the system that they build,

00:49:27.420 --> 00:49:34.720
<v Andrew>is the framework that supports these robot logic components.

00:49:34.860 --> 00:49:37.880
<v Andrew>So the actor-based framework that I described.

00:49:38.160 --> 00:49:44.180
<v Andrew>And so the actor-based system,

00:49:44.400 --> 00:49:50.900
<v Andrew>its overall framework is written by our Rust systems experts and the actors themselves,

00:49:50.900 --> 00:49:56.300
<v Andrew>the components that make the decisions are built by our robotics domain experts

00:49:56.300 --> 00:50:00.160
<v Andrew>who are solid application-level Rust developers.

00:50:01.820 --> 00:50:06.260
<v Matthias>Then that actor framework is not open source. That's probably in-house.

00:50:06.760 --> 00:50:12.900
<v Andrew>It's an in-house actor framework. There are several open source actor frameworks

00:50:12.900 --> 00:50:14.520
<v Andrew>in the Rust ecosystem right now.

00:50:14.660 --> 00:50:19.680
<v Andrew>I think the choices that were available to us in 2019 when we were starting

00:50:19.680 --> 00:50:24.500
<v Andrew>down our Rust journey were such that an in-house actor framework was the right choice for us.

00:50:24.500 --> 00:50:31.020
<v Andrew>If we if scythe were being founded in a garage today in 2025 it's quite possible

00:50:31.020 --> 00:50:35.700
<v Andrew>that many of these exclusively in-house components would instead be the open

00:50:35.700 --> 00:50:40.280
<v Andrew>source rust crates because the ecosystem has has expanded and matured during

00:50:40.280 --> 00:50:41.640
<v Andrew>the during the last six years.

00:50:41.640 --> 00:50:44.500
<v Matthias>Yeah and if someone's listening

00:50:44.500 --> 00:50:47.500
<v Matthias>and wondering what a modern active

00:50:47.500 --> 00:50:50.340
<v Matthias>framework might look like in rust the one that i

00:50:50.340 --> 00:50:57.380
<v Matthias>like a lot is Ractor we will link to it in the show notes it's i guess it leans

00:50:57.380 --> 00:51:04.220
<v Matthias>into the Erlang model a bit and it has a lot of components in there that are

00:51:04.220 --> 00:51:08.360
<v Matthias>really helpful for a production actor system for example uh,

00:51:09.550 --> 00:51:12.610
<v Matthias>factory so being able to have multiple actors

00:51:12.610 --> 00:51:16.930
<v Matthias>in a queuing system and supervision

00:51:16.930 --> 00:51:22.850
<v Matthias>and things that you need once you run that thing at a larger scale but your

00:51:22.850 --> 00:51:28.710
<v Matthias>actor framework specifically is that synchronous does it mean you you mostly

00:51:28.710 --> 00:51:33.430
<v Matthias>write synchronous code where possible or do you also use tokio in combination with it.

00:51:33.430 --> 00:51:38.650
<v Andrew>It's an asynchronous actor system but most of the time can we write synchronous code?

00:51:39.190 --> 00:51:44.570
<v Andrew>So this is maybe one of those distinguishing characteristics between the deep

00:51:44.570 --> 00:51:48.550
<v Andrew>rust expert and the robotics expert who's writing in rust today,

00:51:48.870 --> 00:51:54.230
<v Andrew>is the comfort with asynchronous rust code.

00:51:55.380 --> 00:52:04.800
<v Andrew>At the top level, our actor framework uses tokio to marshal all the actors together

00:52:04.800 --> 00:52:06.300
<v Andrew>as asynchronous actors.

00:52:06.560 --> 00:52:11.320
<v Andrew>But any asynchronous code can call synchronous code inside it.

00:52:12.300 --> 00:52:21.280
<v Andrew>So the framework exposed to our robotics developers is handle message function

00:52:21.280 --> 00:52:25.100
<v Andrew>call, which looks like a synchronous function. It is a synchronous function.

00:52:25.300 --> 00:52:28.420
<v Andrew>It is being called from asynchronous code, but you don't need to worry about that.

00:52:29.480 --> 00:52:35.160
<v Andrew>This is most often the right division of responsibilities.

00:52:36.080 --> 00:52:43.480
<v Andrew>Asynchronous Rust code has some pitfalls. You need to be aware of cancel safety

00:52:43.480 --> 00:52:49.240
<v Andrew>and many related issues in order to get the job done right.

00:52:49.240 --> 00:52:57.900
<v Andrew>Many of the decision-making components in our collection of actors don't need

00:52:57.900 --> 00:53:02.100
<v Andrew>to leverage the features that asynchronous Rust provides.

00:53:02.300 --> 00:53:08.900
<v Andrew>Most of them can be thought of as a message handling system that gives quick

00:53:08.900 --> 00:53:11.320
<v Andrew>answers to each incoming message.

00:53:11.440 --> 00:53:14.740
<v Andrew>And you might as well write that as a piece of synchronous code and not concern

00:53:14.740 --> 00:53:18.100
<v Andrew>yourself with the possible pitfalls of asynchronous Rust.

00:53:18.100 --> 00:53:26.980
<v Andrew>I'm very glad that the folks on our team who built the actor framework are well-versed

00:53:26.980 --> 00:53:28.920
<v Andrew>in all the pitfalls of asynchronous code.

00:53:29.240 --> 00:53:36.040
<v Andrew>But it's a convenient decoupling of responsibilities to say that the asynchronous

00:53:36.040 --> 00:53:38.240
<v Andrew>code exists only at the actor framework.

00:53:38.920 --> 00:53:42.060
<v Andrew>And most individual actors are just synchronous.

00:53:42.380 --> 00:53:42.960
<v Matthias>Mm-hmm.

00:53:43.720 --> 00:53:48.400
<v Matthias>Gotta say, that was great foresight from the people that worked on the framework,

00:53:48.400 --> 00:53:55.600
<v Matthias>because you don't have to deal with the complexities that you mentioned in the async Rust ecosystem.

00:53:56.260 --> 00:54:01.420
<v Matthias>You mentioned cancellation specifically. Do you have an example for when that

00:54:01.420 --> 00:54:03.080
<v Matthias>becomes relevant in your domain?

00:54:04.180 --> 00:54:06.960
<v Andrew>For this i think i really have to just defer to

00:54:06.960 --> 00:54:10.180
<v Andrew>an excellent talk at RustConf in August

00:54:10.180 --> 00:54:13.140
<v Andrew>on cancel safety given by Rain where they

00:54:13.140 --> 00:54:16.060
<v Andrew>ran through so many examples of

00:54:16.060 --> 00:54:18.660
<v Andrew>how cancel safety is important and how it can

00:54:18.660 --> 00:54:21.780
<v Andrew>go wrong i guess the the easiest pitfall

00:54:21.780 --> 00:54:24.400
<v Andrew>that i can just cite off the top is in an

00:54:24.400 --> 00:54:27.820
<v Andrew>actor-based system where control and

00:54:27.820 --> 00:54:30.780
<v Andrew>and essential information is arriving in messages

00:54:30.780 --> 00:54:33.980
<v Andrew>probably the easiest way to mess up a cancel

00:54:33.980 --> 00:54:37.300
<v Andrew>safety issue is to cancel

00:54:37.300 --> 00:54:40.360
<v Andrew>and have the message disappear forever or

00:54:40.360 --> 00:54:45.040
<v Andrew>the message that you were handling disappear forever if that that message was

00:54:45.040 --> 00:54:48.920
<v Andrew>a critical piece of information which will only arrive once well then you probably

00:54:48.920 --> 00:54:57.520
<v Andrew>have caused something a serious problem by by never looking at that message again so So...

00:54:58.160 --> 00:55:03.240
<v Andrew>If your actors are receiving unique, irreplaceable, must-be-handled messages,

00:55:03.660 --> 00:55:09.060
<v Andrew>then you better get your cancel safety right when you dequeue those messages and

00:55:09.060 --> 00:55:12.500
<v Andrew>hand them off to your message handler. That's the easiest example I've got.

00:55:12.960 --> 00:55:16.120
<v Matthias>Yeah. And that helps with determinism, too.

00:55:17.260 --> 00:55:22.180
<v Andrew>Absolutely. Yes. For sure. So yes, to expand on that a little bit,

00:55:22.640 --> 00:55:30.440
<v Andrew>one of our most common testing strategies is to take an actor and feed it a

00:55:30.440 --> 00:55:36.880
<v Andrew>test benched set of messages in a particular order at particular times,

00:55:36.880 --> 00:55:42.500
<v Andrew>and then make the test dependent on whether the actor gives the right answers back.

00:55:42.500 --> 00:55:44.840
<v Andrew>So an actor can be fully deterministic.

00:55:45.100 --> 00:55:50.420
<v Andrew>Given the identical sequence of incoming messages, the actor will always give

00:55:50.420 --> 00:55:53.760
<v Andrew>you the correct output, or you strive for that.

00:55:54.080 --> 00:55:59.100
<v Andrew>It's only in the glorious complex composition of all of your actors against

00:55:59.100 --> 00:56:04.440
<v Andrew>a real-world system that is triggering events at uncertain times that you gain

00:56:04.440 --> 00:56:09.820
<v Andrew>the kind of indeterminism that makes it a big complicated problem.

00:56:10.520 --> 00:56:17.740
<v Matthias>We're getting close to the end and the final question in this podcast is always

00:56:17.740 --> 00:56:20.740
<v Matthias>your message to the rust community.

00:56:20.740 --> 00:56:24.120
<v Andrew>Absolutely stage is yours when i

00:56:24.120 --> 00:56:27.080
<v Andrew>when i think when i think about rust and when i

00:56:27.080 --> 00:56:30.220
<v Andrew>think about the open source community that that built

00:56:30.220 --> 00:56:33.880
<v Andrew>it and maintains it and and moves it forward today

00:56:33.880 --> 00:56:42.140
<v Andrew>it's my feeling is one of of of gratitude this is an incredible thing that a

00:56:42.140 --> 00:56:50.060
<v Andrew>large diverse community of people have built and rust as a language sits at

00:56:50.060 --> 00:56:53.820
<v Andrew>a very valuable point in the language design space,

00:56:55.120 --> 00:57:01.260
<v Andrew>really is something special in terms of the guarantees it gives,

00:57:01.560 --> 00:57:08.120
<v Andrew>the confidence you can have when building complicated systems with it,

00:57:08.540 --> 00:57:15.560
<v Andrew>knowing that the language has struck such a valuable trade-off between competing

00:57:15.560 --> 00:57:20.460
<v Andrew>concerns of safety and efficiency and expressiveness.

00:57:21.620 --> 00:57:27.340
<v Andrew>It's a technology i'm glad to use every day that i use it and i hope that its

00:57:27.340 --> 00:57:31.180
<v Andrew>development toward these goals continues as long as it can.

00:57:31.180 --> 00:57:36.740
<v Matthias>Couldn't have said it better. Andrew thank you so much for taking the time today

00:57:36.740 --> 00:57:38.500
<v Matthias>to do the interview thank.

00:57:38.500 --> 00:57:39.820
<v Andrew>You very much Matthias. It's been a pleasure.

00:57:39.820 --> 00:57:45.080
<v Matthias>Rust in Production is a podcast by corrode. It is hosted by me Matthias Endler

00:57:45.080 --> 00:57:47.120
<v Matthias>and produced by Simon Brüggen.

00:57:47.260 --> 00:57:51.600
<v Matthias>For show notes, transcripts, and to learn more about how we can help your company

00:57:51.600 --> 00:57:54.480
<v Matthias>make the most of Rust, visit corrode.dev.

00:57:54.680 --> 00:57:57.060
<v Matthias>Thanks for listening to Rust in Production.