6/26/2026 at 1:27:47 PM
Anonymous records feel like one of those features that are obviously useful once you work with JSON-heavy systems, but surprisingly uncommon in statically typed languagesby PashaGo
6/27/2026 at 6:57:26 AM
If a statically typed language has no support for record type (or the support it does have is insufficient for your purposes) then you are forced to find other ways to express your logic, so over time those other ways start feeling more natural due to familiarity, and then you end up feeling that you don't need record types (or more extensive support for them), which in turn leads language designers/implementors to leave it out, and so the cycle repeats.I'm not sure I agree that anonymous records are “obviously useful” when working with JSON. JSON is not typed, so if you want your deserialized JSON to be statically typed, you need to declare typed records outside of the JSON, so I'd say it's far more useful to use type declarations that are not anonymous.
That said, anonymous types are incredibly useful in general. I work with C# a lot and its support for them is rather shallow. In particular, there is no “with” expression equivalent.
by Timwi