Here's a API design challenge I'm working on: adding async support to (CLI argument parser) without breaking the existing sync API.

The tricky part is combinators—when you compose parsers with object() or or(), the combined parser should automatically become async if any child parser is async, but stay sync if all children are sync. This “mode propagation” needs to work at both type level and runtime.

I've prototyped two approaches and documented findings. If you've tackled similar dual-mode API designs, I'd love to hear how you approached it.

https://github.com/dahlia/optique/issues/52

2

If you have a fediverse account, you can quote this note from your own instance. Search https://hollo.social/@hongminhee/019b4b0f-7f2f-7d41-b160-0a57c034f7b4 on your instance and quote it. (Note that quoting is not supported in Mastodon.)