Our code quality tools, linters, test frameworks, and others, play an important role in keeping our code error-free and conforming to the rules our teams have chosen.
But when these tools become sluggish and slow down development, we often avoid running them or even turn them off.
On this episode, we have Charlie Marsh here to introduce Ruff, a fast Python linter written in Rust.
To give you a sense of what he means by fast, common Python linters can take 30 to 60 seconds to lint the CPython codebase.
Ruff takes 300 milliseconds.
I ran it on the 20,000 lines of Python code for our courses web app at Talk Python Training, and it was instantaneous.
With that kind of speed, it's the kind of tool that can change how you work.
I hope you're excited to learn about Ruff.
This is Talk Python to Me, episode 400, recorded January 18, 2023.
Welcome to Talk Python to Me, a weekly podcast on Python.
This is your host, Michael Kennedy.
Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython, both on fosstodon.org.
Be careful with impersonating accounts on other instances.
There are many.
Keep up with the show and listen to over seven years of past episodes at talkpython.fm.
We've started streaming most of our episodes live on YouTube.
Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
This episode is brought to you by Cox Automotive.
Join their team and use your technical skills to transform the way the world buys, sells, and owns cars.
Find an exciting position that's right for you at talkpython.fm/cox.
And it's also brought to you by User Interviews.
Earn extra income for sharing your software development opinion at User Interviews.
Head over to talkpython.fm/userinterviews to participate today.
Before we get to the conversation for this episode, I have a very brief sponsored message from the PyCharm team.
As you know, I'm a huge fan of PyCharm, the tool and the team, and I'm happy to bring it to you.
Do you like storytelling?
Want a job where you can work with the Python community and help people with their professional development?
PyCharm is doing big things this year, and they have an exciting job opening you should consider.
Developer Advocate.
It's a good job doing good work with a great company.
Learn more and apply at talkpython.fm/PyCharm dash Advocate dash Job.
The link is in the episode show notes.
Charlie, welcome to Talk Python to me.
Thanks so much.
It's my pleasure to be here.
Yeah, it's a pleasure to have you.
I'm going to talk about making Python code fast.
Built some pretty interesting tools here with Ruff.
We'll see about integrating Rust into Ruff, and there's a lot of cool tools around this
sort of code quality side of things, right?
Like Black took off in ways, I think, even though Lukash didn't maybe imagine it would take off,
and this is kind of in that same realm, and of course, it plays well with Black along the
way as well.
So we'll get to talk all about those things.
It's going to be tons of fun to dig into them, but before we get to it, let's start with
your story.
How did you get into programming in Python and Rust?
Yeah, yeah.
So I got into programming, I guess, the summer before I went to college, when I guess I was
supposed to be doing something fun.
I taught myself Java, and it was the sort of thing that a lot of people had told me I would
like, but I never really had a chance to dig into.
I ended up, I went to school, majored in computer science, so I did a bunch of internships while
I was in college.
And then when I, my sort of junior year internship and my first year out of school, I worked at
a company called Khan Academy, which is like an education technology company.
And at the time, this is less true now, but at the time they were a really big Python
child.
I mean, they had one of the biggest like App Engine deployments.
It was like Khan Academy and like Snapchat and like a couple other, maybe Spotify or someone.
Wow, I had no idea.
I mean, I'm just, yeah, I'm obviously I'm familiar with Khan Academy, K-H-A-N, I'm sure a lot of
people are.
Yeah.
But I didn't realize that one, they were such a GCP customer and that was Python.
Yes.
Was that Flask or Django on GCP or what was it?
It was like Flask on App Engine.
Yeah.
We did not use Django.
Yeah.
But they actually, I mean, it's a whole nother story, but they did a big Go rewrite after
I left, which is also super interesting.
I mean, it's not Python, but it is still very interesting.
Just like migrating a system from any language to any other language is always pretty interesting.
But at Khan Academy, yeah, you know, I did some Python.
I would say that like I mostly did web and we can talk a little bit more about this because
like really through my career, I've kind of jumped between a lot of different ecosystems.
And so like at Khan Academy, I did, I think a year of Android.
And did a little bit of iOS, did a lot of web, did a little bit of Python.
And then most recently, I worked at a company called Spring Discovery, which is like a computational
biotech company.
And everything we were doing was based on computer vision.
So we'd like take really high resolution pictures of cells and then try to model like the way
that they change when you add drugs.
Wow.
Okay.
Which is, yeah, it's pretty wild.
I mean, I came into that with no bio background.
I joined as like second engineer and build out a lot of our like data and machine learning
platform.
That was kind of a crash course in building like a massive system in Python, right?
We were doing scientific computing.
So it made a lot of use Python.
So we ended up using Python for like almost everything.
Yeah.
Python is a really good choice for the web, but it's like the de facto choice for data
science, right?
Like it's.
Yes.
Yeah, exactly.
There's not a whole lot of other choices.
Whereas on the web, there's, you know, five or six other platforms and languages that are
also contenders for that space.
Right, right.
So, you know, we built out what I consider to be like a fairly large Python code base.
It was like a big monorepo.
And, you know, I spent four or five years, you know, building that out and like really writing
a lot of Python every day.
That's where like a lot of my Python experience comes from.
And like that experience specifically also informed a lot of, a lot of growth.
And, you know, I can talk more about sort of how those experiences intertwined, but that's
kind of my Python background.
It must have been really fun to explore some of this visualizing cells and interacting with,
you know, microscopes and.
That was amazing.
Yeah.
All those kinds of things.
Yeah.
The coolest part of the job was just that if you bucket it like really crudely, like a
third of our team were sort of like software engineers or like data scientists, machine
learning researchers, and then, you know, a third were, you know, wet lab biologists,
PhDs.
And so every day I was like working directly with scientists and like building software for
scientists, which was just like a super cool thing to be able to do as part of a small team.
Yeah.
But yeah, wrote a lot of Python.
That's awesome.
I worked at a place that was a bunch of PhD researchers doing eye tracking, like not Apple,
but your actual eyes.
Like, what are you looking at?
wrote the software to actually control the device and get all the information off of
it and then like analyze that and put, you know, generate like reports for the scientists
and stuff.
And it's, there's a, there's a special kind of cool for software that touches like reality,
right?
Yeah.
I mean, it adds a lot of complication.
Of course it does.
It's very cool.
You don't get exact numbers.
You want to test it like, you got to approximate all the things, but still, yeah, that sounds
like a super fun job.
How did it inform rough?
Like what are some of the experiences that?
Yeah, totally.
Just so people know rough is like a super fast linter.
Just give us the quick elevator pitch.
So they, they, they know what the heck rough is.
We'll dive more into it later.
Sure.
Yeah.
So rough is what I call an extremely fast Python linter.
If you've used linters and Python in the past, you've probably used something like play gate
or pilot, or maybe like PI code style, you know, maybe use other tools to help manage your code
style, like black or like auto peppy, all this stuff that deals with effectively code style.
So rough is a linter.
It looks at your source code and it tries to report back and tell you a sort of flag and
tell you about issues with it.
And those could be stylistic issues.
Like this variable name is not great, or they could be, you know, like logical issues.
Like you reference a variable here and that isn't defined.
Right.
I think there's a lot that distinguishes rough, but like the thing that I think caught
a lot of people's attention was just how fast it is.
So I sort of hate benchmarks, like, cause no matter how much time you like put into a benchmark,
like it's always wrong from like a certain perspective and like people always complain about
them, but I think rough is comfortably like somewhere in 10 to a hundred times faster.
Some people even say like a thousand times faster on their setup.
So it can be like really, really dramatically faster.
And it can also do a lot of auto fixing, which is kind of a distinctive feature that I don't
know that many other tools.
And there are certainly tools that do code transformation in Python, but like Pylon and
Flake 8 and such don't do this.
So for lots of the errors that Ruff will flag, it can actually fix the code for you and fix
the issue for you, which is a big time saver.
I don't know if this is one of them, but just to give people an idea, like one of the errors
or warnings rather that it'll give you is you have an F string, but you're not leveraging
its F string capabilities, right?
I'll just say F quote, and then it has just static text, a little.
Literal string.
So it doesn't need the F, right?
Theoretically, you could say auto fix and just it drops the F for you.
It's like, yeah, you don't need that, right?
Yeah.
And, you know, we can also like go the other direction.
So like if you're doing a bunch of like percent string formatting or using like the dot format
style helpers, we're actually, we can fix at least one of those right now.
And strings are really complicated, but like we can actually rewrite, I think the dot format
calls into strings, which is cool.
Fantastic.
You know, another thing we can do is we can kind of keep your code like modern in a way.
We've taken a lot of inspiration from other tools like Pi Upgrade 2 has like so much cool
stuff and functionality in it if you haven't seen it.
And we take some of the rules from Pi Upgrade and basically re-implement them in Rust and package
them into a single interface and a single tool.
So you just install one thing and you get, you know, 370 something rules.
I can assert that it is indeed fast.
We'll dive into it a little bit later, but I ran it on Talk Python training, the courses
website that I have.
And I think that's got 20,000 lines of Python and it's instant.
It's like you press enter and then out, you know, the stuff is just printing out.
These are the things that found, which is pretty awesome.
So back to your data science work.
Yeah, yeah.
How are you, what you're doing influence your creation of RUF?
Like why not just use Flake 8 or something like that?
You know, like I said, I'd like worked in a lot of other ecosystems where, with sort of
like stricter languages, right?
Like Java and whatever else.
And it's not to say those ecosystems are better, but I often come at the stuff from a perspective
of wanting a lot of like static analysis tooling.
So we had like a really heavily typed code base.
We used, like we used mypy, you know, we used Black, we used Flake 8, we used Eyesore, we
used, I don't know, like doc formatter.
There's like a lot of different stuff that we used.
Yeah.
You know, really my job was like, I was the maintainer of this big system.
And like most of, like a lot of people in the team were effectively like clients of that
code base.
So they were kind of like using the stuff that, you know, I and some others were building
as like a library.
And so I had to maintain like this really big system.
And like the more static tools you have, you know, in my opinion, it just like greatly
increases the leverage that you can have as a maintainer.
So we use a lot of tooling.
And I think like a couple of things happened.
One, you know, I was spending a lot of my time in Python, but I was also doing a lot of
web.
And so, you know, like one week I'd be doing Python, the next I'd be going and doing like
React and TypeScript and whatever else.
And so people complain a lot about web tooling and like, you know, there are certainly lots
of valid complaints about it.
But there's been a lot of interesting innovation, I think, in that space.
And I was certainly influenced by some of it, just seeing some of the tools that came out
and how fast they were.
Sure.
And the fact that a lot of those tools were not being written in JavaScript sort of intentionally
to make them super performant was pretty interesting to me.
So like, I don't know, I don't want to like name drop a bunch of tools, but you know, in
the web ecosystem, more tooling is being written in like Go, Rust, even some other sort of more
out there languages like Zig.
And to me, that was kind of an interesting thing.
It was like, well, does the Python tooling have to be written in Python?
Like what does, like, why does that have to be the case?
And like, what does it buy you and what do you lose?
So that was one thing.
The other was we actually started to do a lot of Rust Python hybrid stuff in our own code base.
You know, our code base was fully Python.
And over time, we took some of the like really performance critical pieces and started to
rewrite them in Rust and expose them to the Python side using some of these like really great
Rust Python hybrid tools that, you know, maybe we'll get into later.
So like one example is we were dealing with image data.
So like a common thing we had to do is just like download a lot of image files, like really,
really fast.
Right.
And so, you know, we wrote that in Python.
We wrote like a bunch of versions that use all sorts of like multiprocessing, threading,
and like we tried everything.
And then eventually we like rewrote it in Rust.
And so we had a really simple, you know, Rust module that would just download files really
fast.
And then we exposed that as a Python API.
So like from the Python code, it just looked like Python, but the actual code that was running
and the way it was, you know, built and executed all went through Rust.
Right.
So you have these big data, big, let's say big computation problems where you're like, you
know, this could be better.
The same time you're looking at this happening on the web side, you know, web pack or whatever
it is.
And it's like, this is way better.
We can do this in Python, but we aren't.
So let's start, right?
Probably you got a little experience there and you're like, what else can I build with Rust
now that I know how?
Yeah.
I was seeing, you know, the way that this innovation was happening in the web.
I was seeing specifically the Rust Python like opportunity from what we were doing.
And then I was, you know, frankly, like feeling a fair amount of frustration just with the
performance of a lot of the existing tools.
Like, I don't know.
I'm always really careful with how I talk about this stuff because I hate being, I'm
really like not a hater.
And like, I've actually gotten like so much value out of like all of those tools.
But I was being like, well, should it really take like one to two minutes to let my code,
like couldn't it be much faster?
Right.
Like it's like a big code base.
And like, as you add more plugins and everything else, it really like changes, like how you
feel about the tool.
Right.
Like it's no longer like something I just run and get feedback.
It's like, oh, I have to run the linter now.
Oh, I have to run the blah blah blah.
And I was sort of craving that.
Yeah.
And if you're doing it on a team, my experience at least has been some people in the team continue
to run it because they find more value than stress.
And others are like, eh, I'm not running that stupid thing.
But then their problems get pushed onto the people who still care.
And so then it creates this kind of like a tension, like Joe's code is always kind of crappy
because he won't lent it.
But then like when I check out his code, my stuff starts reporting.
You know, like those are the weird dynamics that happen from tools that are like super slow
unit tests or super slow linting or those types of things where certain people stop working
with them and others don't.
And then you get these weird tensions.
So having it fast, there's like real value to that.
This portion of Talk Python Nemy is brought to you by Cox Automotive.
With brands like Kelly Blue Book, Autotrader, Dealer.com and more, Cox Automotive flips the
script on how we buy, sell, own and use our cars.
And now the team at Cox Automotive is looking for software engineers, data scientists, scrum
masters and other tech experts to help create meaningful change in the industry.
Do you want to be part of a collaborative workplace that values your time and work life balance?
Consider joining Cox Automotive.
Visit talkpython.fm/cox today.
Thank you to Cox Automotive for sponsoring the show.
I left spring and like mid to late August.
I started working on Ruff along with like a couple other projects and I never built a linter
before.
It was sick.
So like I didn't, yeah, I didn't really know what I was doing, but it felt maybe this is
like a little bit of hubris or not, I guess, because like it seems to be working.
But like I was kind of like, I'll start with a linter because it feels like a tractable
like scope of problem.
I was like, type checker.
I know that's hard and like I don't really know much about it.
A linter.
I feel like I can learn like some of the concepts.
I have a good understanding of like of like how it might work.
To me, when I look at it, I think linting people's code, like abstract syntax trees and
stuff.
I'm like, that doesn't sound like a problem to me.
But it's good that you saw it that way because you did get through it.
Yeah.
Well, the first version I released was like very limited.
It was sort of, I sort of needed to get it out because I wasn't sure that people would
actually really care that much about like what I was doing.
Yeah.
Because like I've described to you a lot of like pain points.
They're also sort of like opinion, right?
But like, you know, I wasn't like a fast forward linter.
Like who cares?
Was sort of, I wasn't sure.
Yeah.
So, you know, when I released it, I was like, I want to prove it's possible.
I want to like have reasonable confidence that the performance won't get worse or much
worse as I expand it.
But I only supported like, I don't know, maybe like 20 rules, which was fine with me because
I was really trying to prove a point more than, you know, get people to adopt it even.
Right.
Well, and a lot of times go into that experience, even if very few people used it, you learn fantastic
things, right?
Yeah.
I learned so much.
And I read a ton of code.
Like I read all, I've read like a lot of, I've read like a lot of source code now.
So I've read like all of like, you know, PyFlakes, like high doc style, high code style, like, you
know, because I've spent time like trying to re-implement a lot of those, a lot of those rules
and like understand how they do things.
And you just learn a lot from like reading and trying stuff.
Yeah.
Rust is sort of like a whole nother thing where, you know, I did some Rust at Spring,
but I would say that building Rust was really like my Rust learning experience.
I think I had to kind of try to build something from scratch to like really understand the language.
Sure.
Everything I did in Spring.
You can do all the tutorials.
Yeah.
And I was like, I was trying to get in and out as quickly as possible.
No, no.
I just like, you know, I didn't do the initial Rust migration at Spring.
I worked with another like super talented engineer who did that.
And so every time I went into, you know, and I made a bunch of changes to it, but every
time I was going in and out, I was like, I just need to like ship this and like move on.
Like, I'm not going to spend a bunch of time like really understanding everything that's
going on here.
I just want to get it to work.
And so I needed to like sit down and like really like focus and be presented with like
a blank plate, I think to learn and just like fail a lot and like build stuff that didn't
compile.
Right.
And figure out how to resolve those problems.
It's honestly, it's a tough, it is a tough learning curve.
I'm sure that it is.
I started out in C++ and so I, I know there are harder languages and they're easier languages.
So I've never written C++.
I'm never.
You're not missing that much.
I would say.
Eddie out there says rough is so awesome.
I actually changed all the switch statements in my Python 310 code back to if else blocks
so I could switch to rough, which is pretty awesome.
That's super nice and slightly embarrassing because we don't support Matt.
We don't support Matt.
We don't support the match.
That's the one big language feature that we don't support yet.
You could just kind of comment it out.
Like it just, we're going to just ignore whatever's in the switch.
It must be fine.
On to the next part.
Yeah, exactly.
Right.
Yeah.
I mean, not for your code, but for linting.
Let's start our dive in with this comment from Tyler.
He says, what are the differences between linters like rough and flake gate?
Those versus code stylers or formatters like black.
And maybe rough lives in the middle of that spectrum.
I'm not sure.
Yeah.
There's certainly like, like, like you said, it's like a spectrum, right?
So I guess there's a couple of different ways to think about it.
And it, with those tools specifically, like some of the responsibilities have like in my
mind, at least shifted a bit over time.
So for example, like flake gate, it does a lot of, it doesn't change your code at all.
And it'll just tell you about issues.
And those issues could be style issues.
Like you have extra white space here or.
Yeah.
I don't know.
What's another big example.
This line is too long.
Yeah.
But it could also be like a logical issue, which is something that black wouldn't touch.
So it might be like this import is unused.
So on the one end you have like, you know, different collections of rules and maybe not really
changing the code, just kind of telling you about it.
Black is different in that black just reformats your code.
So it does, it's not actually aware of like the logic in the code.
Like it doesn't know that an imports unused.
It doesn't know that function is never called.
Yeah.
It just takes, you know, that abstract.
Well, not, not exactly the abstract syntax tree, but it basically preserves your code as
is and just tries to restyle it.
And so, you know, it's interesting because like if you use black, you probably don't need
a lot of style linting.
Like if you're using black to format your code, a lot of the rules.
Like a part that relevant anymore.
They'll say something like you should have followed the rules of this, but black automatically
follows those rules for you.
Right.
So they're kind of, you don't need to correct the line length because black will wrap it
because that's what black does.
Right.
Yeah.
Or even like, you know, if you have like X equals one with like no spaces between the
X and the equals and the equals and the one, like the linter will yell at you for that.
But black fixes that for you.
So a lot of people will turn off those rules.
You know, this is why I say the responsibilities have shifted a bit over time.
Yeah.
I think you're right.
That rough, like it kind of sits in the middle.
We do less stylistic linting for this exact reason.
Like I use black a lot.
Black is like immensely popular.
So I actually like strong, like heavily deprioritized, like all of the stylistic rules that are made
redundant by black.
Okay.
The difference is we do do a lot of that automatic fixing.
So like we'll, we can remove unused imports for you.
We can even do like a lot of more complicated rewrites.
Like if you're using, if you're using like a dictionary constructor, like the actual, you
know, D I C T parentheses arguments, we can actually rewrite as a literal.
If you have the rules enabled and you want to do that, you know, there's like a bunch of
rules around like comprehensions and literals, and we can do those rewrites too.
So, you know, it does, it can do like style and reformatting, but it's somewhere in the
middle.
Yeah.
The fact that it makes some changes, but it doesn't go completely all in like black is
kind of why I think it lives a little bit in the middle there.
Yeah.
One of the things that I think might give people a lot of, brought a lot of faith or a willingness
to give it a try is there's a lot of projects out here that are large projects that people
would know that have adopted, actively adopted and started using rough.
I saw a quote from Sebastian Ramirez from FastAPI right now in the audience.
We have Olfek says the next release of hatch, which I hope to do this weekend will have
all the new projects generated with config for a Linting environment that uses rough, which
I think is pretty excellent.
Can we speak to speak to some of that, like about these, these projects adopting it and
how that's helped you?
Yeah, totally.
Yeah.
I never expected that like this, maybe that like goes without saying, I think you'd have
to be like super arrogant to release something and expect a bunch of these people to use it.
Yeah.
It's been kind of wild.
You know, initially there were a couple big projects that I would call like really early
adopters and they helped shape the project a lot.
like Pydantic was a very early adopter.
Zulip was a very early adopter.
FastAPI was actually like a pretty early adopter too.
Okay.
And then like Pandas and Airflow and stuff, those kind of are more recent.
Okay.
It's been a very interesting, like to reflect on how that's happened because on the one hand,
it's like sort of ridiculous that all these products would migrate over because I'm on,
I don't even really have like a proper versioning system right now.
Like I'm on V00225 or something.
I basically release like every day and I consider like, I don't really make, we've made like
very few breaking changes, but like in theory we could make breaking change.
I don't want to, but like if you have Scribe December, like we could make changes like that.
You know, there's not really like docs, like the docs are just like this huge read me.
It's kind of wild, right?
We don't support like all the Python 3.10 features, right?
We don't support match statements.
So on the one hand, it's kind of wild that all these projects would move over.
I think there are a couple of things that help a lot.
So one is that the entire time I've been like very, very focused on compatibility with existing
tools.
And that comes at a lot of cost.
Like if there are things that I like don't agree with, right?
Or whatever else, like I sometimes still support them or implement them.
And, you know, but the upside is like, it's very easy for people to migrate.
Right.
It might change nothing potentially.
Right.
It just, it just goes faster.
Hopefully.
And over time, like, you know, we don't have like a third party plugin system.
We've just like implemented everything like in Rust, like as part of Rust.
I viewed that as like, I'm just going to look at the most popular plugins and the most important
rules.
And I'm just going to figure out like, what's a blocker for whom?
And like, what do I need to implement in order to like unblock people and like make sure
they can use it?
Is there a way for people to let you know which of those are really important to them?
Like, for example, if there's some big project out there, it's like, we would love to move
to rough, but there's this one, one plugin we're waiting on.
Yeah.
I mostly hear about it in issues.
And there are a couple issues where it's like kind of a big GitHub issue.
It'll be like implement this plugin.
And a lot of people will come and like give it a thumbs up or whatever.
We have pretty good coverage now, actually.
Like, I mean, there is a long tail.
Like there's a big ecosystem of like flaky plugins.
You know, sometimes someone will come along and ask for a plugin that I haven't really like
seen before.
And then it's just a calculus of like, what do I want to prioritize?
How much work is it?
Yeah, exactly.
Is this a super easy thing to do?
Like, oh, the line is too long.
That's easy.
Or is it, you know, rewrite this?
Yeah.
This generator in this other interesting way.
Yeah.
That happened with, well, a lot of people want like, I don't know how to pronounce this library,
but like Dargland, like D-Argland, Dargland.
I don't know.
Anyway.
I would go with that as well.
Yeah.
Dargland.
Let's go with that.
It's very popular, but I've looked at the source.
It's pretty complicated.
So like, I need to, you know, that's not something I can just like turn around in a day.
But like, you know, I hear like what people want.
And I mean, some of those migrations though, I didn't even know about them until they'd happened.
Yeah.
Of course.
People come, they submit issues.
I look at their profiles.
I see what they're working on.
I get a sense for what the projects are.
Right.
So sometimes I know, and then I'm kind of fixing things knowing that hopefully it's unblocking
them in different ways.
But I think, like I said, I think the compatibility piece is like really huge.
And I actually think that like black and eyesword and like the popularity of those things has
made compatibility for me like a little bit easier because I can just like adhere to what
they do.
And then hopefully there's like no code changes.
Yeah.
They centralize around what like black is the truth.
And then we'll, then we'll stop.
We'll debate beyond that.
But like, we're just going to accept black because it's no fun to go commas on the end
of the line.
No commas on the trailing thing in the list.
You know, like that, those kinds of debates just go on and on.
Yeah.
I know.
I think black kind of solves that by just making a decision for you and not everyone's
totally happy with every choice, but it stops the debate.
And that actually probably wins the day for most of them.
One thing that's interesting here that I'm noticing about these projects in the large open
source projects that have adopted rough, not all of them, surely, but many of them like
Pydantic and Polars and so on themselves are adopting Rust.
Do you see a synergy of those?
Like, well, we're rewriting Pydantic core and Rust like Samuel Colvin is, or the folks behind
Polars are like, that's the core of it is about Rust.
And that's the RS on the end, I think.
So there might be a little extra draw there, right?
I think it's just more like, like spiritual alignment.
Yes, exactly.
Because it doesn't matter.
No, it doesn't.
But spiritually.
But there's, yeah, there's a little bit of a bug.
Sorry, bug in the sense of like, like once people start writing some stuff in Rust and
improving their Python, they're kind of like more open to like, you know, trying out other
things that are written in Rust and so on.
So it's, I mean, that community has like been very interesting to sort of watch and be a
part of the like Rust Python community.
It still feels like pretty nascent, but there are, the tooling is actually like really great.
And, you know, we could talk about that more, but like, you know, there was definitely like
a bunch of initial setup for actually like distributing Rust, PyPI and making pip installable.
But now that that's over, it all like just works.
And I mean, I wouldn't say it's like requires no effort, but it's actually pretty amazing.
Like how, like the degree of integration and how much you can do now with these tools like
Py03 and, and MatcherIn and some others.
That was one of the things that was really nice surprise for me as well as how easy it is to
install, right?
Like, unless you told me, unless it wasn't part of, you know, the elevator pitch, you know,
the little one sentence subtitle on the project, like you would know from a interacting perspective,
which is kind of exactly what you want.
I also think that it's really, there's some value to having these popular projects adopt
RUF because Martin and the audience, for example, says, I found out about Ruff by looking to see
what FastAPI does, because presumably it's a ton of respect for FastAPI and Sebastian, his choices.
So yeah, it's got to sort of create the snowball effect as well.
So this portion of Talk Python to me is brought to you by user interviews.
As a developer, how often do you find yourself talking back to products and services that you use?
Sometimes it may be frustration over how it's working poorly.
And if they just did such and such, it would work better.
And it's easy to do.
Other times it might be delight.
Wow, they auto-filled that section for me.
How did they even do that?
Wonderful.
Thanks.
While this verbalization might be great to get the thoughts out of your head,
did you know that you can earn money for your feedback on real products?
User interviews connects researchers with professionals that want to participate in research studies.
There is a high demand for developers to share their opinions on products being created for developers.
Aside from the extra cash, you'll talk to people building products in your space.
You will not only learn about new tools being created,
but you'll also shape the future of the products that we all use.
It's completely free to sign up and you can apply to your first study in under five minutes.
The average study pays over $60.
However, many studies specifically interested in developers pay several hundreds of dollars for a one-on-one interview.
Are you ready to earn extra income from sharing your expert opinion?
Head over to talkpython.fm/user interviews to participate today.
The link is in your podcast player show notes.
Thank you to user interviews for supporting the show.
One thing that's a little bit overlooked about why that adoption is useful is that it actually feeds back into the project in so many great ways.
So, you know, for example, DAG sir adopted ROUGH and they have a really big Python monorepo with 50 or 100 separate Python modules or packages in there.
And they filed like a bunch of issues about around how can we make ROUGH better for monorepos.
And so now they can run ROUGH once and it runs over all their separate projects that can all have their own configuration.
And that's like a really, really powerful thing.
And something that like if I was just sort of sitting around like building ROUGH, like I don't know that I would have known to prioritize that or what it should look like.
And so like actually like working with people who want to adopt ROUGHs and like figuring out what stops using it provides a ton of value to the project and just prioritization.
Like a lot of the iSort stuff, I pushed on it a lot when I started because ROUGH does import sorting.
So you can use it if you want in lieu of iSort.
And we implement a lot of the same configuration options, not all the same.
iSort just is like really configurable.
So we went, we sort of implement them as they get requested.
But anyway, I prioritize that stuff because a lot of people wanted it and they were coming to the issues and being like, hey, this would really help me adopt it, blah, blah, blah.
So just like getting the feedback and like hearing what's blocking people, like that itself is like so valuable for the project.
Right.
And you have a lot of people involved in these larger projects.
So they, and they have specific polished needs, right?
Like there's a lot of people who work on pandas or FastAPI and those are mature code bases.
It's not just a pet project, right?
Yeah.
Those are very mature.
Yeah.
Yeah, exactly.
That's good.
But also it's a challenge.
One other thing I would like to point out, you know, you started off by introducing rough saying, maybe people will be interested.
I don't really know if they will.
Maybe they will.
That'd be cool.
You know, 6.5, 6.4 thousand stars.
That's a, it's a non-trivial amount of interest.
That's a lot of love.
Yeah.
And like, I don't know.
One thing that I, I guess I might feel weird, like highlighting all the big projects.
Cause one thing that I really appreciate is just like anyone who's willing to try a tool
like this.
Sure.
Like moving tools and trying new tools is like a big decision.
I just like really appreciate everyone who says nice things about it or everyone who's
like willing to give a try, give it a try, like no matter what they're working on.
Yeah.
It's not a platform to say that out loud.
So hopefully people hear it.
Yeah, absolutely.
So the other thing I want to highlight about the repo here, not just the stars, but when
I look at a project and I want to sort of assess, I really want to adopt this thing.
Do I want to make this part of my dependencies or things or layers that I got to live with
here?
And if it goes sideways, I got to change something is, you know, how old is the project?
How active is the project?
And so on.
So look, we started this podcast 40 minutes ago.
The last commit was 52 minutes ago.
Oh yeah.
Sorry.
Yeah.
It's kind of.
That's awesome.
I mean, you're like, but you're looking here and it's then it's, it's yesterday.
It's, it's last week.
I want to point out there's just a lot of activity, 78 contributors.
It's a very lively project and not just something that's cool, but you know, there's a lot of interest
and energy in it, which I think is a very strong signal that it's something people should
be comfortable adopting.
Thanks.
I appreciate you calling that out.
I think I guess companies one, that's actually something that when I talked before about
why would these big projects adopt this thing that like seems really experimental, that's
actually something that comes up a lot is, and I'm not in the conversation, but obviously
I'm sleuthing a little bit on the PRs.
Right.
And they're saying, well, it doesn't support X, but it's like really actively developed.
And I'm like very confident that they will support that, you know, at some point.
Yeah.
And so like, just like having something that is clearly very actively worked on, I think
is quite like appealing and comforting to people.
Yeah.
I actually like do feel bad saying this, but like one of my favorite, not favorite, but
it kind of an interaction that happens on the repo is someone will file an issue and they'll
say, this is actually also a bug that exists in the, let's call it the upstream implementation.
So the existing Python version of that tool also has that bug.
Right.
Like Pyland or FlickAids or something like that.
Yeah.
It does this, but we think it's wrong.
We disagree with it or something, right?
Or there's an issue where, you know, the maintainer is like, oh yeah, this is broken.
Yeah.
Okay.
It's really not like the reason I tell that thing is like, I, you know, every project is
different and like every maintainer, like most people, like everyone's doing this like
for free, right?
Like I'm not, I'm not here to like call out other maintainers, but I think it's a very satisfying
interaction for people when, you know, they link to an issue it's been open for, for maybe
for like years.
And then I can actually just like fix it in like, like pretty quickly and ship a release
in the same day.
And like that, I think that's like a really like powerful thing that resonates with people
a lot.
It's just the feeling of like stuff getting shipped and like things getting fixed.
And yeah, I'm like, you know, I'm working on this full time.
So like, I'm fortunate to be able to do that.
And like, I totally get it that like other projects are in different states and stuff.
But I get a lot of, you know, and people are always super appreciative.
And so it all just like funnels into, you know, giving me energy.
Eddie has called you a commit machine.
Literally every time I update my project dependencies, I'm guaranteed to see new stuff on Ruff, a new
version of Ruff.
I appreciate that.
You know, it's, I do appreciate that.
Like, yeah, I do try to write a lot of code, but you know, it's obviously not just, not just
me and like the contributors, the contributors have been awesome.
And I think, I mean, one thing I'm particularly impressed by is just the number of, number of
people who, like, I don't even know if I always believe them when they say this, but like
just the number of people who are like, this is my first time writing Rust or like, I'm
really not good at Rust or like, blah, blah, blah.
And hear something amazing.
Yeah.
And they just like make like great contribution.
They're like, Hey, I'm trying to learn Rust.
And I obviously love that stuff.
Like for interested in learning Rust, I actually think Ruff is like a great, a great project
and like a great place for that.
But I mean, there are people who are working on stuff, especially the stuff that I just
like, it's like big things I can't like focus all my time on and just like having great
contributors who are like really, you know, like thoughtful and like prolific.
Every project is lucky to have people like that.
How old is the project?
When did you start it?
In August.
Yeah.
So it's not that old.
My brain is like melting, but it's somewhere.
Yeah.
I think it's like, like somewhere between four and six months.
Okay.
Did you say you're working on this full time as like your full time job?
Yeah.
Okay.
And so how's that work?
Is that GitHub sponsors or are you employed by someone to completely work out?
What's the story?
That sounds awesome.
Still figuring out, you know, I'll probably share more on that soon.
Okay.
I don't know if sponsors enabled right now.
Still figuring out exactly what, like how I want that all to evolve.
Right.
I am working on it full time.
I don't anticipate that changing in any way.
Like I, I'm really happy in getting so much out of this and yeah, I think there are a lot
of ways to make it work.
And if not rough, I want to be working on like other Python tooling.
So, you know, I think there's like more stuff to come.
Well, it certainly is neat tooling.
Let's go, let's go through the GitHub page here a little bit.
So we've talked about the speed a couple of times.
We talked about ways in which that happens.
You know, Rust is an important part, but it sounds like it's not the only reason that it's
fast.
You have a chart with the obvious like a little asterisk caveat benchmarks.
It's reproducible, you know, like all the stuff's in the readme, but yeah.
That's fast in this situation, but my situation is different in which case, you know, such
and such.
Right.
But for some large code base, we've got rough in 0.3 seconds, autoflake at six, pylint at
over 60 seconds, just barely.
This is on the CPython code base from scratch, which is pretty ridiculous.
And I already told you the numbers.
I don't have a millisecond number, but it appears to be instant on 20,000 lines of Python code
that I wrote.
And it found some issues, which I thought would already be discovered.
So that's pretty excellent.
Nice.
It's nearly Python 3.11 100% compatible, right?
You said the one major language feature is the match statement, but other than that, it's
compatible, right?
Correct.
Yeah.
Okay.
It supports some of the other language features like that are maybe less high profile, like
the parenthesized width statements and stuff like that.
But it doesn't support the pattern of structural pattern matching yet.
Got it.
So it's got the autofix support near parity with the Flake 8 rule set, which is cool.
You talked about the way that you keep the performance fast, but still have parity with Flake 8 is
you have native re-implementations of the Flake 8 plugins.
That's right.
Yeah.
So we re-implement everything in Rust.
And a lot of the time, that's like me or whoever's working on it, like looking actually at the plugin and
like the logic it uses and trying to mimic that in a high fidelity way.
And often we'll like try to use the same test suite and really try to make sure that we're compatible, except in cases where we think there is like an actual sort of factual error.
Yeah.
Why rough is fast?
The plugin stuff, there's a lot of interesting stuff to say about like plugins, because I think Rust is a big part of why rough is fast.
But there are a couple of other big pieces.
So we take a lot of care in the code base to like only do necessary work, if that makes sense.
So, you know, we support 300 something rules, but depending on which exact rules you have enabled, we'll skip a lot of unnecessary work.
Okay.
That can help a lot.
So, you know, it's basically tailored to how much you're using it.
So like if you're not using it as an import sorter, you know, there's a bunch of stuff that we get.
It's just how I would think about it.
But the other like really big one is because everything is sort of implemented in like one system.
There's a lot of work that would normally be duplicated between a lot of different tools that can actually just be done once.
So the way to think of that is like if you look at like flake 8 with flake 8 doc strings, there's maybe one example which uses PyDoc style.
Sorry, I know it's like a huge like a tree of tools.
You know, if you add that plug in.
So PyFlakes is going to parse your source code and turn that into an AST.
And then PyDoc style actually has basically its own parser that will go back over the source code and look at all the tokens and extract the doc string.
And if you have a bunch of different tools, like some of them will share that abstract syntax tree.
But a lot of them end up doing work that other tools are also doing.
Right, because they can't count on necessarily that being done or the plug in system doesn't provide work that's already been done to them.
So they got to start over anyway. Right.
Yeah. Or they might want to do things in like a slightly different maybe you have like three different plugins.
Like I guess one example is a lot of plugins like need some way to tell if a function is like public or private.
And it's not like super complicated, but you know, it's not like totally trivial.
Like you need to account for functions that are in inside of classes.
Like is it a public method or private method to account for functions that are inside of other functions.
Right. So there's like a lot of rules actually for like determining what's like public and private.
And, you know, you might have one lint rule that's like all public methods need to have doc string.
And you might have another rule that's like all public methods need to have type in two things.
And if you have two separate plugins that are doing that, they both need a way to actually like extract that information.
And, you know, it's not necessarily the case that like it'll be way faster to do it with one pass and one.
I think it will. It may not be like or as magnitude.
But the other thing is you have a lot of like consistency. So like, you know, it's defined in one way.
You're not going to be at the whims of like small decisions that the tools have to make.
For us as like maintainers and like building rough, you know, there's a lot of stuff you like don't have to implement multiple times.
Right.
I can leverage that and like go and implement other lint rules.
And I don't have to like figure out from scratch, how do I determine like what public and private in it?
How do I like extract all the doc strings from a file? Like we already have all that infrastructure.
So there's kind of like economies of scale, I guess, to like implementing new stuff.
Like it sort of snowballs a little bit, like the tool gets more powerful, it gets kind of easier to do things.
I mean, I think you'd be surprised like how much of building a tool.
I don't know about you personally, but like I was surprised by like how much of building a tool like this is just done.
It's like settings and like configuration and like how do people express their settings?
What is the command line interface look like?
How do you find all the Python files in a directory?
Like it sounds trivial, but like, you also want to respect like getting more is do you want users to be able to ignore files?
Like there's a lot of rules.
And so again, it's like if I look at a new Python tool, you know, that wants to go off and implement something,
they might have to implement all that stuff themselves.
But for us, it's like we have all that infrastructure in place.
And so if we want to build a new fun piece of functionality, it's just sort of defining the rule and we get all this other stuff for free.
Yeah, you can definitely build on the layers that are in place because it's all together.
That's cool.
Yeah.
All right, let's look through here a little bit.
Like I said, there's the testimonials from the different projects like Brian from Bokeh or Sebastian from FastAPI and whatnot there.
But let's start with installing it.
Like I said, you would know that this wasn't just a Python tool you could use.
Pip install rough. That's the way to go.
But when I installed it, I didn't pip install.
I pip x installed it.
Are you a fan of pip x?
Yeah, I use pip x.
Yeah, to me, it seems like rough is something I want to run on different projects.
And I just kind of want rough in my tool set.
And so I pip x installed rough.
What do you think?
Good idea.
Is it better to put it, say, like in a per version of per project?
Like everything.
I think it probably depends.
Yeah.
I mean, I definitely saw a lot of stuff at pip x.
I think the one thing that I, the one issue with rough, and I guess I recognize wines can be annoying for some people, for sure.
Like we released a lot.
And so if projects don't pin their dependencies, then they can start to see like new errors as we add new rules, which I guess in some sense is like a breaking change.
But I don't really consider it as such.
It's like, you know, they have the like, let's say they have the like, like a simplify rule set enabled and we add a new rule and that gets turned on for them.
So anyway, the point is like people, I guess I recommend pinning rough if you're using it for a project, which I mean, with pip x, you're just going to stay on one burger.
Right.
So you run pip x, you upgrade dash all or whatever, or upgrade that thing.
Yeah, exactly.
It's doing it to a sense.
It's kind of a pin, but it's pinned globally and it gets upgraded globally and that not, not per project.
Yeah.
For me, that's kind of okay.
But if I was on a large team, you know, lots of people who were working on it, you might want to control that more.
I can see that.
We have a homebrew distribution and a condo distribution on condo forage.
And then I did those and then there's everything else was done by other people.
So I'm like, which is cool, but most of me, I'm like less familiar with them.
Yeah, sure.
I mean, I don't know.
Publishing on homebrew and condo forage was like pretty interesting experience for me.
I've never done that and I didn't actually really know that.
much about how those worked.
I think so.
Yeah.
That was cool.
Hopefully it's useful for people.
There's definitely some complexity with like the packaging and release stuff, which I don't
know if you want to talk about that or not, but you know, because we're building Rust, there's
like a couple of things that we need to do that are a little different from a standard Python package.
Maybe just touch on it a bit because what you deliver is a wheel, right?
But it's got the compiled Rust bit for me on my ARM 64 macOS build, right?
Yeah, that's right.
So basically it just means we have to do the wheel in some sort of pre-compiled version of
the package as opposed to just giving you the source code.
And like if I just gave you the source code and not the wheel, you'd actually need to have
Rust installed because you'd have to actually build the thing and install it, which is of course
an extremely unreasonable expectation for the kind of people who are using this for the most part.
Yeah, but before the wheels really became popular, that was part of the step, right?
It would build for you.
Yeah.
Or it wouldn't build for you, which was frustrating, but that was part of the step, right?
Yeah.
We just build wheels for all the platforms that I know of.
It's not something.
Is it all CI/CD?
You just push it to some branch and magic happens and then wheels start appearing in places.
Whenever I cut a release on GitHub, like I just use like GitHub releases, basically.
I just use GitHub releases.
It kicks off our release job and then that's all through GitHub
action.
So it just has a big matrix, right?
Of all the different operating systems.
We only have to build, thankfully, we only have to build one wheel per operating system.
We don't have to build one wheel per Python version, which is something that can happen sometimes.
And then you have like a mass explosion of number of wheels.
That's all facilitated with a tool called Maturin, which I'm a big fan of, which is,
it's sort of like, I don't know, like set up tools and a bunch of other stuff bundled together,
but specifically for shipping mixed Rust Python.
So I don't actually have to like do anything for the host part to make that work.
Yeah.
My pyproject.tomol has, you know, Maturin at the top and I have a Rust project and I call
Maturin build and it creates a wheel.
It's all like, I don't know.
I think it's like super cool.
That works.
Yeah, that sounds super smooth and super neat.
Yeah.
And like I said, as a consumer of it, also very smooth, right?
It was still quickly.
I didn't have to wait on some build.
I didn't need build tools or config that I don't care about or don't use.
I'm pretty sure I do have Rust, Rust C as a CLI option I can use here, but you know,
you don't want to depend on that, right?
No.
So you run it on the command line, you say rough and you point at either a file or a directory
or some pattern of files, right?
Yep.
Star type of thing, which is cool.
And that gives you the output.
You can also do it with a --watch and just run it constantly, which is pretty cool,
right?
It's fast enough that basically as you save it, if there's problems that'll just appear
in the terminal, right?
Or wherever you run it.
That's kind of a funny example because I based, or it's a good example because I,
I'm pretty sure I took that exactly from probably from TSC, which is the TypeScript compiler.
Yeah.
They have a watch setting and I like how it works.
And so I wanted that for, so it's just a, that's a very literal example of me looking at
another tool from like another space and being like, oh, that's really nice.
And I wish you had that other tools like it too.
Yeah.
I suppose it's terrible and not terribly difficult to implement, right?
You take the pattern and you put a watch in the OS watch implementation and you say,
call me back when something changes and because it's fast, it just reruns, right?
But it's still,
Yeah, it's exactly right.
It's very handy though, that, that it's there.
The other thing that's interesting is you can do it as a pre commit hook, which is nice.
Yeah.
That works pretty well for people.
I think a lot of people seem to use it.
I'm glad that it exists.
Yeah.
A little bit of a weird setup because maybe it's actually not that interesting to talk
about, but it's in like a separate repo for sort of like, I can't even really remember.
Okay.
Interesting.
Now to configure it, it has a, let's say comprehensive CLI set of options.
I can't remember maybe 15 or so command line options.
You can pass it, but you can also put, put it into the pyproject.toml with things just
like tool.rough and then you can put your various settings in there.
Right.
So it just sort of integrates along that, or you can have a rough.toml and then put it in there.
Yeah.
So that's something that I took basically from hatch.
So within hatch, you can have a pyproject.toml or a hatch.toml and the hatch.toml kind of like
tests the configuration.
Like if you use a rough.toml, you don't need to have like tool.rough at the top and stuff like that.
Yeah.
I think one thing that I'm quite happy that we have is like the configuration is very like type safe.
So if you try to like, you know, so that, that line select equals EF, those are like error,
like rule codes that are defined in rough.
And so if you put, if you replaced F with some string that wasn't, you know, a real rule,
you'll get an error immediately saying that, you know, your pyproject.toml had invalid,
was invalid in like these ways, blah, blah, blah.
Interesting.
Okay.
And similarly, we create what are called like JSON schemas or the configuration.
If you're in PyCharm and you open up like a pyproject.toml and you type
tool.rough, it'll actually like show you all the options.
It'll actually surface the documentation we have for the options too.
Oh, nice.
Which is pretty cool.
Yeah.
I'd like more tools to do that.
Cause I think it's like super useful.
I think poetry has it, but not too many others do.
You can get it in VS Code as well, but you need to install an extension.
It's called like even better.toml, I think.
Right.
Okay.
But I'm happy with those things.
I think it makes it like, I think small things like that add up and glad we're able to do them.
Yeah.
When I looked at the configuration settings, like the exclude directories and various other
things, like that's kind of a lot to put on a command line.
It would be nice if you could just put it and say rough.toml or pyproject.toml.
And then when you just type rough the thing, it, it sees that and it uses it.
Right.
Yeah.
I've kind of like intentionally like not put a lot of these arguments on the command line.
Like for that reason, like you can imagine taking everything here and exposing it on the command
line, but the command line really just deals with like how should the thing execute and not like,
I don't know, what should the max complexity be?
Yeah.
I think that's fair.
Like put the common stuff on the command line and then say, and if you need to go crazy,
here's your --config, pass that in and put it in there.
Right.
Yeah.
One thing that I did want to talk about and you kind of touched on, there's a bunch of the
command line arguments.
One of the things I did want to talk about is the editor integration.
There's a huge bunch of rules here.
We got to scroll through on the homepage to get, get down to it, which is awesome.
That are no, no, it's good.
I mean, these are like all the things that checks that I don't have to think about anymore,
which is great.
Eventually though, geez, I forgot it was this long.
Eventually though it has plugins or maybe that's not quite what I said.
It has a, an extension of a VS Code and it has ways to basically add it as a command
to PyCharm, right?
Which is, those are both awesome editors that are kind of very friendly to thinking about code
formatting and exposing the errors that this would as well.
So that's great.
You might want to just talk about that just real quick.
Yeah, totally.
So yeah, we have a VS Code extension.
That was my first time writing a VS Code extension.
And actually the, these extensions use, or they conform to something called the language server protocol.
And effectively that's sort of like a standard, I believe I'll probably get like a bunch of
the history wrong, but I believe it's Microsoft that like publishes and maintains that.
It's that.
The nice thing about that protocol is you can actually use like the lot, like most, almost all
of the code behind the VS Code extension is actually published as a language server.
Yeah.
Rough LSP.
And what that means is you can actually get like the exact same behaviors in all sorts of different
editors.
It's not confined to VS Code.
So if you use like NeoVim or like sublime text or whatever else, those all support this standard
protocol and they all have ways to tap into that rough language server protocol.
So we have sort of like the standalone LSP, which we have instructions for like sublime and,
and you know, other tools.
And then we have the actual extension, which is published on the marketplace.
And those are things I definitely want to like keep supporting.
And I view them as like official arms, right?
Of the project, which I think is nice.
So people should know that like, you know, those are official and like, I pick bugs and
man, and all that kind of stuff.
Nice.
And then for PyCharm, you just add it as an external tool and then you have the rough command
around or for both of these, if you prefer, you just add it as a pre-commit hook.
Yeah.
That's also.
Yeah.
That's right.
Yeah.
That then like, as you interact with it, it'll run the pre-commit hook as well.
If you try to check things in.
Super cool here.
I think this is a neat project.
I ran it into my project and I thought, you know, everything is pretty much good to go.
Where, you know, when I'm using PyCharm, for example, it'll often tell me many of these things.
Like it'll say there's a local variable that's unused or it'll automatically remove unused imports.
And yet I'm looking at 331 issues.
108 are potentially fixable with the --fix option.
So it sounds like there's still a lot of value to like make that part of my tool chain.
Yeah.
I mean, you know, and feel free to have some of your own opinions about which of those rules actually matter.
Sure.
And I suspect you can disable them in your config file, right?
You can say this rule I don't care about.
Yeah.
And this is another sort of compatibility thing.
Like we, API for actually like turning rules on and off is like essentially identical to the flight gate API.
So that's also useful for people migrating over.
So the no QA, is it the like comment?
Yeah.
Like comment no QA is one option.
Yeah.
We respect.
Yep.
We respect those too.
We also respect like, I sorts action comments.
So yeah, we, we like do a lot of stuff to try and
maintain compatibility.
Nice.
Maybe another like interesting thing in that vein is that we ship a tool called
flight gate to roughs, which does sort of what it sounds like.
So you point it to a flight gate configuration file and it spits out a Tommel for rough,
you know, that's compatible.
And it also tells you if there were things in the file that we don't support, which is useful too.
Like, oh, hey, you're using these rules.
Those actually aren't implemented yet.
Yeah.
That's also maintained as like part of the project.
So, you know, I recommend checking it out.
Excellent.
Well, Charlie, I think we're getting short on time, but not short on topic.
There's a whole lot more to dive into.
I think it's, it's really cool project.
I think it's new.
Are we gonna do a big WASM section?
No, I'm kidding.
I'm kidding.
We don't have time for that.
We could do a WASM section.
We even have some great chat GDP questions in the audience.
I don't necessarily think that there's time for those, unfortunately,
but there is one final question that I want to ask.
It's kind of inspired by the audience, but I think it's good for everyone.
Jean Gabriel asks, is there a roadmap or timeline for rough development out there?
Like what's next basically?
Like, I guess the short answer is no, like there's not like a published
timeline, unfortunately, like most of this stuff exists in my head and in issues.
Like everything happens on issues.
Like we're just talking a lot on issues.
Yeah.
I'll maybe talk a bit about like the things that I'm thinking about.
So one is fixing like the structural pattern matching issue.
And so like getting full like Python compatibility, which it's sort of like one bug, but then unlocks
us doing what I hope will be like a stable release, even if that's not that much changes.
And it's just kind of, you know, the marketing of it, but hopefully we'll fix that.
And then we can do like a stable release.
The, there are two other kind of big things on my mind.
So one is this is like a really big project, but not, not rough.
The thing I'm about to talk about, but, I want to extend rough to do like full code auto
formatting so that people could use it in lieu of black.
If they wanted to think it's like a really natural fit for what rough is doing.
And a lot of people asked about it.
The way that that will, there's an issue where we talk about this, like on the repo, it's not
like some big secret reveal, but, the way that I think about that, like, like with all things is
I want it to be like, sort of incrementally adoptable.
Like right now you can use rough with ice or.
Or you can use just rough, or you can use rough to your input sorting, but like not as a linter.
Like you can kind of pick and choose like what you want to use.
And I view like the auto formatter is the same way.
Like I fully expect that people will keep using rough and black, but it's just like the kind of
functionality that makes a lot of sense, given what we're already doing and like the way that the
project's evolving.
So I need to like, and you be careful because like, it's like that blog work.
And so I'm not like saying exactly when that will be done, but I do want to start working on it.
And then the other thing, which is maybe like a little bit less exciting to other people.
And it's like, you know, I think at some point I'd like rough to get to a world where
it kind of stands alone a little bit more.
It isn't viewed quite as much as a compatibility as this compatibility layer.
Like right now, all the rules kind of map back to like, Hey, or other tools.
And when you're using rough, you're kind of thinking in the mindset of those other tools,
like what are the rules and how do I configure them at some point in the future?
I'd actually like, you know, rough to sort of have its own API, like own indexing of the rules.
And to view that as kind of a compatibility layer that will not go away.
Like this won't put a burden on users, but I'd like to get
to get to a point where like conceptually, a lot of this stuff is like first class and rough.
And it's not viewed as re-implementations of other extensions, which I think will enable us to do a lot of cool things.
But I'm hopeful that I'm doing that in a way that has no disruption to users.
So we'll continue to support the existing API and such.
Yeah.
Yeah, exactly.
Very exciting.
Well, congratulations on a project that people seem to love.
It's got a lot of traction and definitely doing some cool stuff.
So before we get out of here, though, final two questions.
If you're going to write some Python code, what editor are you using these days?
I use PyCharm for everything.
And that includes Rust.
But I do all my Rust and my Python and PyCharm.
Nice.
Is there a cool plugin that basically adds Rust support to?
Yeah, there's just an official IntelliJ Rust plugin.
Got it.
Nice.
Works really well.
I've used IntelliJ for that platform for Dart and Flutter, but I haven't tried to plug Rust into it.
But yeah, it does a lot of things.
Cool.
And then notable PyPI package, something out there.
You've named a couple that do the Rust integration nicely.
But anything you want to give a shout out to?
Yeah, I really want to give a shout out.
I've already mentioned it a few times.
I think if you're interested in doing Rust Python stuff, you should really look at Matrin.
Matrin.
All right.
M-A-T-U-R-I-N.
It just makes the publishing really easy.
And you still have to learn Rust, which is not easy.
I mean, I do.
It's worthwhile, I think, but it's not easy.
But it makes the publishing Rust code to PyPI, or PyPI, sorry, really easy.
Awesome.
Well, great recommendation.
Thanks for being here.
Final call to action.
People want to get started with Rust.
What do you tell them?
The main thing that I would like to say is if you're interested in contributing,
even if you don't know that much Rust and are interested in learning,
I'd love to see you on the repo, and I hope it's a place that people feel really welcome
to come and contribute, even if they are 100% certain if their code is right or anything like that.
So definitely really excited to have more contributors and have more people coming into the project.
And of course, you should also try using it yourself.
All right.
Excellent.
Well, thanks for being here.
It was a great conversation with you.
Yeah, thanks so much for having me.
It was a really cool opportunity.
I appreciate it.
This has been another episode of Talk Python to Me.
Thank you to our sponsors.
Be sure to check out what they're offering.
It really helps support the show.
Join Cox Automotive and use your technical skills to transform the way the world buys,
sells, and owns cars.
Find an exciting position that's right for you at talkpython.fm/cox.
Earn extra income from sharing your software development opinion at user interviews.
Head over to talkpython.fm/userinterviews to participate today.
Want to level up your Python?
We have one of the largest catalogs of Python video courses over at Talk Python.
Our content ranges from true beginners to deeply advanced topics like memory and async.
And best of all, there's not a subscription in sight.
Check it out for yourself at training.talkpython.fm.
Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct
RSS feed at /rss on talkpython.fm.
We're live streaming most of our recordings these days.
If you want to be part of the show and have your comments featured on the air,
be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.
Thank you.