|
|
Subscribe / Log in / New account

Python structural pattern matching morphs again

Python structural pattern matching morphs again

Posted Dec 22, 2020 17:16 UTC (Tue) by mathstuf (subscriber, #69389)
In reply to: Python structural pattern matching morphs again by intgr
Parent article: Python structural pattern matching morphs again

I think it depends heavily upon the kinds of code you're writing. I worked on a system in Rust that just could not go down (it manages/directs our development workflow). Rust's emphasis on error handling and consideration of what can go wrong means that if anything does go wrong, it goes to a log instead of crashing the program. There's very little lifetime usage in types throughout the 50k+ lines of code in it. They have allowed us to make the parts that need to be fast parallelisable without having to do manual checks of shared memory or the like.

This system has been running for over 4 years now, gained support for non-`master` default branches in July, updated its GraphQL schema usage in June, added a couple of small features this past spring, a few trickling in over time (as they do), and hasn't really had an "oh shit" moment in over a year (I've stopped scrolling the history; there have been 2 that I can remember that weren't "gitlab or github changed something on us" (those are just error logs, not crashes) and they were logic errors possible in any language). It's also performant enough that we just deploy the debug build so the backtraces are useful (when needed).

If you're crafting your own data structures, yes, Rust is going to be a tough sell over more convenient languages (though I argue that it is still worth it). But if you're writing code that needs to be correct in production, performance is of at least some note, and where threading can really help out there, Rust is definitely the top of my list for what to implement it in.


to post comments

Python structural pattern matching morphs again

Posted Dec 22, 2020 17:27 UTC (Tue) by mpr22 (subscriber, #60784) [Link] (1 responses)

> It's also performant enough that we just deploy the debug build

This is really cool, and I can't think of much higher praise for a language's performance :)

Python structural pattern matching morphs again

Posted Dec 22, 2020 21:43 UTC (Tue) by mathstuf (subscriber, #69389) [Link]

To be fair, most of the app is slinging around HTTP requests to hosting providers (GraphQL/REST), parsing JSON, and forking off thousands of `git` processes :) . But the ability to just stick a `.par_iter()` in one place and get magic parallelism when running dozens of checks on dozens of commits (it's NxM) makes it amazingly easy. I could squeeze some more parallelism out of it with ticketed locks so that projects can be processed in parallel, but it hasn't been necessary to do that kind of stuff.

I've talked about the project before on here, but it all lives here for anyone curious:

https://gitlab.kitware.com/utils

All of the "rust" and "ghostflow" repositories; the "source-formatters" repo is relevant in that it's something we point our configurations at to do formatting verification and fixing. "git-import-third-party" is relevant for anyone wanting to use the "third party" check to make sure vendored code is not modified outside of dedicated patch tracking mechanisms.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds