Sign in

Andrew Gallant

@burntsushi.net
2.5K followers 40 following 387 posts

I love to code. burntsushi.net

PostsRepliesMedia
Andrew Gallant @burntsushi.net · 29/07/2026
Because the length of a day depends on time zone. Same reason why you can't round a timestamp to the nearest month. You need a calendar system and a time zone. Going to a Zoned is indeed the intended workflow.
010
Andrew Gallant @burntsushi.net · 29/07/2026
No
100
Andrew Gallant @burntsushi.net · 29/07/2026
Nice! Out of curiosity, what did you expect? Did Jiff do better or worse than what you expected? (I'm guessing that your `*_format` benchmarks are dominated by std's formatting machinery. Jiff's `strftime` routines go through a heavily optimized path.)
300
Andrew Gallant @burntsushi.net · 29/07/2026
Profiles of these two commands look quite similar. They're both spending lots of time in `read` syscalls. Which... makes sense. But why is macOS almost two orders of magnitude slower?
180
Andrew Gallant @burntsushi.net · 29/07/2026
Does anyone know why ripgrep is soooooo much slower on macOS than Linux these days? On the left is my AMD Ryzen 9 7940HS laptop and on the right is my M2 mac mini. Both searching the same revision of Chromium and both are hot in the OS page cache.
2173
Andrew Gallant @burntsushi.net · 15/07/2026
The speed-up came from this PR by a contributor! github.com/BurntSushi/r...
github.com
Ignore files probing optimization: fetch directory entry metadata in batches by AlanIWBFT · Pull Request #3410 · BurntSushi/ripgrep
This PR contains my fix to the issue #3293 I brought up. I was holding back making a PR (I made a fix but only linked in in the issue body) as nowadays owners are overwhelmed with AI generated PRs....
0120
Andrew Gallant @burntsushi.net · 15/07/2026
ripgrep 15.2.0 is out! It has some gitignore bug fixes and a nice speed-up for large directory trees. github.com/BurntSushi/r... Pictured is on my checkout of github.com/NightMachina...
1534
Andrew Gallant @burntsushi.net · 09/07/2026
regex 1.13 now has a `regex!` macro (NOT compile time regex) that encapsulates the common pattern of using something like `std::sync::LazyLock` to ensure it only compiles ~once. github.com/rust-lang/re...
1675
Andrew Gallant @burntsushi.net · 04/07/2026
I look forward to reading this!
020
Andrew Gallant @burntsushi.net · 03/07/2026
Parsing is very rarely within even an order of magnitude of actually building the automata. For example, on my machine, `\w+\s+\w+` takes 15µs to parse to an AST, 13µs to translate from an AST to an HIR and but 23ms to build the actual regex automata. Yes, milliseconds!
110
Andrew Gallant @burntsushi.net · 03/07/2026
Can you imagine? Lmao!
010
Andrew Gallant @burntsushi.net · 03/07/2026
Even if you parse it, that's not enough to guarantee the regex will build. After parse, compilation can still fail if it causes the underlying automata to grow beyond the imposed size limits. So with that, it kind of puts a damper on the entire prospect IMO.
100
Andrew Gallant @burntsushi.net · 03/07/2026
Hmmm. The problem doesn't seem limited to just a name being the same as a crate name. Notice that the completions suggest RA will insert an import, but it doesn't. And this happens for both `anyhow::anyhow!` *and* `anyhow::bail!`. So this just seems like an RA problem.
000
Andrew Gallant @burntsushi.net · 03/07/2026
Ugh. That sucks. But maybe something that can be fixed in RA? Or is it a fundamental limitation somehow?
100
Andrew Gallant @burntsushi.net · 03/07/2026
Note that this macro is NOT for compile time regexes. This is just a terse convenience for compiling a regex once at *runtime* and being able to reuse it without needing to write your own `static`. See github.com/rust-lang/re... and github.com/rust-lang/re... for more details on compile time regexes
github.com
`const` Regex compilation · rust-lang regex · Discussion #1012
I think compiling a &'static str into a regex is a pretty popular use case. However, no const fn make(pattern: &'static str) -> Regex exists. Is it impossible to implement? Is it possible, but the ...
150
Andrew Gallant @burntsushi.net · 03/07/2026
See discussion at github.com/rust-lang/re... for more details.
github.com
Introduce the `re!` macro for easier reusable regex by tgross35 · Pull Request #1371 · rust-lang/regex
Add a wrapper around LazyLock as a simple way to construct a Regex that is compiled once but used multiple times. An anonymous inline syntax is accepted: if re!(r"\d+").is_match("123...
230
Andrew Gallant @burntsushi.net · 03/07/2026
I'd like to add a simple macro to `regex` for building a regex once and then using it via `LazyLock` (or similar). But I'm having trouble with the name. Should it be `regex::regex!(..)` or `regex::re!(..)` or something else? See pictures for before and after.
390
Andrew Gallant @burntsushi.net · 11/06/2026
Jiff has been added to blessed.rs!
1440
Andrew Gallant @burntsushi.net · 10/06/2026
Oh nice thank you! I had deleted it accidentally. Thank goodness for easily accessible backups. :-)
020
Andrew Gallant @burntsushi.net · 08/06/2026
Plausibly low hanging fruit for improving substring search performance in Rust's standard library! github.com/rust-lang/ru...
0140
Andrew Gallant @burntsushi.net · 04/06/2026
Love those vin bin sandwiches haha
020
Andrew Gallant @burntsushi.net · 04/06/2026
Happy birthday! Enjoy. :-)
020
Andrew Gallant @burntsushi.net · 04/06/2026
Improving Miri is so critical. Thank you Tiffany!
0250
Andrew Gallant @burntsushi.net · 03/06/2026
It is brutal. I believe it was a life saving chance encounter.
000
Andrew Gallant @burntsushi.net · 03/06/2026
Thanks for all the kinds words from old fellow Lobsters users. :-)
0140
Andrew Gallant @burntsushi.net · 03/06/2026
Folks please re-post! Spreading awareness about this is important to me. :-)
1131
Andrew Gallant @burntsushi.net · 03/06/2026
As for server usage, I might use it occasionally for that. But mostly that's the realm of my workstation. I didn't think cost savings for lesser powered CPUs were worth it.
020
Andrew Gallant @burntsushi.net · 03/06/2026
As for CPU, I bought it based on a 10 year life expectancy (like my current NAS, which is now 10 years old). The CPU in my current NAS is showing its age. Even `pacman` updates are noticeably slower than all of my other machines.
110
Andrew Gallant @burntsushi.net · 03/06/2026
Oh. Yeah I won't need more than 16TB. I could have gone bigger, but I didn't think the cost was worth it. Plus I have a lot of wiggle room in the sense that I can delete things when or if I get too close to the maximum. But even without that, 16TB is a little less than twice what I need right now.
100
Andrew Gallant @burntsushi.net · 03/06/2026
I was recently diagnosed with a rare autoimmune disorder called anti-NMDA receptor encephalitis. It's a "disease of chaos" that completely upturned my life for a couple months. I wrote a blog about it that goes into more detail and discusses prognosis. :-) burntsushi.net/encephalitis/
burntsushi.net
Encephalitis - Andrew Gallant's Blog
1312443
Andrew Gallant @burntsushi.net · 03/06/2026
Say more?
100
Andrew Gallant @burntsushi.net · 03/06/2026
My new NAS build. My previous NAS was in continuous operation for about 10 years. It served me well, but it was time for an upgrade. pcpartpicker.com/user/burntsu...
1140
Andrew Gallant @burntsushi.net · 02/06/2026
Yes clap is wonderful! Amazingly engineered project.
010
Andrew Gallant @burntsushi.net · 02/06/2026
I think that's what my PR does. :-)
220
Andrew Gallant @burntsushi.net · 02/06/2026
wow
1210
Andrew Gallant @burntsushi.net · 02/06/2026
While I switched ripgrep from Clap to lexopt for command line argument parsing, I still think Clap is the right choice most of the time. github.com/BurntSushi/r...
github.com
various rollup + move off of Clap to lexopt by BurntSushi · Pull Request #2626 · BurntSushi/ripgrep
cli: replace clap with lexopt and supporting code ripgrep began it's life with docopt for argument parsing. Then it moved to Clap and stayed there for a number of years. Clap has served ripgrep...
180
Andrew Gallant @burntsushi.net · 02/06/2026
Shoutout to the `lexopt` crate as a great example of a Rust library that is effectively done. It's only had 6 releases in its 5 years of life. It's basically perfect if your needs match its level of abstraction. github.com/blyxxyz/lexopt
github.com
GitHub - blyxxyz/lexopt: Minimalist pedantic command line parser
Minimalist pedantic command line parser. Contribute to blyxxyz/lexopt development by creating an account on GitHub.
1181
Andrew Gallant @burntsushi.net · 02/06/2026
I love to see it! I'm curious if they will write the regex engine in Rust too. :-) github.com/uutils/grep
github.com
GitHub - uutils/grep: A Rust implementation of GNU Grep
A Rust implementation of GNU Grep. Contribute to uutils/grep development by creating an account on GitHub.
0140
Andrew Gallant @burntsushi.net · 31/05/2026
My son Murphy getting a successful POST on his first attempt. He doesn't know how good he has it. youtu.be/-HBOBskFMVg?...
youtu.be
murphy POSTing for the first time
YouTube video by Andrew Gallant
070
Andrew Gallant @burntsushi.net · 28/05/2026
I love to hear that!!! That's what I'm doing now. Just endurance running.
010
Andrew Gallant @burntsushi.net · 28/05/2026
The number of times in the past few weeks that I've said out loud to my wife, "I was talking to Chat about yadda yadda yadda" (Chat is short for ChatGPT) in the past few weeks is quite remarkable. I'm just waiting for the first time she says it. That will be a major milestone unlocked.
020
Andrew Gallant @burntsushi.net · 28/05/2026
I have aspirations of running a marathon some day. Pacing at 3:30 is absolutely mind blowing to me. Congrats!!!
110
Reposted by Andrew Gallant
nikomatsakis @nikomatsakis.com · 26/05/2026
This is good.
071
Andrew Gallant @burntsushi.net · 26/05/2026
I'm open to this! Can you say more about it? I'm not sure what you mean by a foreword. Like put it at the top? I feel like that would give it undue influence. Or maybe I could add it as a separate section in CONTRIBUTING.md.
100
Andrew Gallant @burntsushi.net · 26/05/2026
No legal level. Enforcement is hard. Trust is important, yeah. I guess the target audience here is people acting in good faith. People acting in bad faith are a separate category and there isn't an expectation on my part that this policy will change their behavior.
070
Andrew Gallant @burntsushi.net · 26/05/2026
I've added an AI policy to ripgrep that was shamelessly copied from uv's policy. I plan to add this to the rest of my projects, but if anyone wants to offer feedback on wording, now would be a good time! github.com/BurntSushi/r...
github.com
611416
Andrew Gallant @burntsushi.net · 26/05/2026
Why don't Jiff's strftime and strptime routines validate the format string separately from formatting or parsing a datetime? github.com/BurntSushi/j...
github.com
Why don't Jiff's `strftime` and `strptime` routines validate the format string separately from formatting or parsing a datetime? · BurntSushi jiff · Discussion #560
I've been considering moving from chrono to jiff. So far, I've been liking what I'm reading, especially when it comes to time zones. However, one thing stood out to me. That's the strftime and strp...
0203
Andrew Gallant @burntsushi.net · 19/03/2026
astral.sh/blog/openai
astral.sh
Astral to join OpenAI
Astral has entered into an agreement to join OpenAI as part of the Codex team.
0151
Reposted by Andrew Gallant
nikomatsakis @nikomatsakis.com · 23/02/2026
What it means that Ubuntu is using Rust, new blog post with some thoughts spurred by Jon Seager's excellent keynote at @rustnationuk.bsky.social (smallcultfollowing.com/babysteps/bl...)
smallcultfollowing.com
What it means that Ubuntu is using Rust · baby steps
1264
Andrew Gallant @burntsushi.net · 02/02/2026
Yeah it basically consumed my entire Saturday haha. I kept struggling with how to find vimscript equivalents. e.g., is it vim.cmd.foo? Or vim.cmd.fn? I ended up just porting my CoC keybindings over. They were already pretty close to neovim's defaults, so my muscle memory kept protesting.
vim.cmd.foo
010