Re:A Rust API Inspired by Python, Powered by Serde
by LtWorf on Thursday May 15, 2025 @05:33PM
(#43999534)
There's unions, there's stuff that uses reserved words in the language as field names... You are obviously not familiar with this task.
[ Parent
| on HN ]
Re:A Rust API Inspired by Python, Powered by Serde
by dundarious on Thursday May 15, 2025 @08:57PM
(#44000832)
The "generic macro over struct definitions" approach is the one that has at least some trouble dealing with these situations, not the "getter function with string argument" approach. I've had to do plenty of json and protocol buffers wrangling (meaningfully different, I know), and versioned packed struct memcpy/reinterpret_cast "parsing" as well.
My point is I don't want to do "this task" at all if "this task" means layering funky auto-generated machinery on top of what is already a perfectly reasonable API.