dgregor79,
@dgregor79@sfba.social avatar

Finally landed the first of many standard library updates to replace "rethrows" with generic typed throws: https://github.com/apple/swift/pull/69771. The feature has been a fantastic exercise in generalizing in place: it maintains the same behavior for existing Swift code, maintains the stable ABI of the standard library, and yet any Swift code that adopts typed throws will see typed errors propagate through the standard library in the natural way.

dgregor79,
@dgregor79@sfba.social avatar

Another, simpler example is Swift's Result type, which has always effectively had typed errors because it's generic over the "Failure" type. However, any interaction between Result and errors in the language (e.g., an actual throw or do..catch) would have to erase to "any Error". Now, we can express the relationship between the "Failure" type and error handling, allowing one to smoothly go between throw/do..catch and Result: https://github.com/apple/swift/pull/70907

dgregor79,
@dgregor79@sfba.social avatar

If you're interested in how typed throws manages to generalize 's error handling to provide more expressive APIs, check out the accepted design proposal at https://github.com/apple/swift-evolution/blob/main/proposals/0413-typed-throws.md.

brennansv,
@brennansv@sfba.social avatar

@dgregor79 These improvements are what make Swift such a compelling language. Your work is greatly appreciated.

dimsumthinking,
@dimsumthinking@mastodon.social avatar

@dgregor79 When you're done, a blog post would be instructive on many axes

dgregor79,
@dgregor79@sfba.social avatar

@dimsumthinking the thing holding me back isn’t the writing part, it’s the having-to-pick-a-blogging-platform first step. Silly, I know, but from my perspective it’s all hassle and no fun.

finestructure,
@finestructure@mastodon.social avatar

@dgregor79 @dimsumthinking Wouldn't swift.org be a good place for it? 🙂

cthielen,
@cthielen@mastodon.social avatar

@finestructure @dgregor79 @dimsumthinking I’m sure the folks at swift.org would be interested. 😉

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines