ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1.1K
active users

Richard Schneeman

I wrote a blog that explores some neat patterns that @rain mentioned on an Oxide and Friends episode. Learn how the Daft crate implements the ability to emit code and errors simultaneously and how they accumulate as many errors as possible for an improved Derive proc-macro experience.

schneems.com/2025/03/26/a-daft

schneems.comA Daft proc-macro trick: How to Emit Partial-Code + ErrorsA recent Oxide and Friends podcast episode, “A crate is born,” detailed the creation of a proc macro for deriving “diffable” data structures with a trick I w...

@Schneems Thank you, this is wonderful!

Would you like to submit patches for the cases you identified where we could be generating errors? Both seem like good improvements.

I did look at syn's combine but identified the same issue you did — it's easy to do the wrong thing with the ? operator. As I've gotten older I've started trusting my future self less and less 😭

@rain

> Would you like to submit patches for the cases you identified where we could be generating errors?

Sure! I'll timebox it and see where I end up. Also I won't be offended or bothered if you (or someone else) beat me to it.

@Schneems Thank you! I won't be offended at all if you put up half done code too, I'm used to people doing that and me finishing it up lol

@rain here's a quick stab at duplicate struct attributes, duplicate field attributes are harder
github.com/oxidecomputer/daft/

@Schneems Great article, thanks for writing this!