4 ms·
Most languages have poor support for structural types though. If you try and join two records together (like a SQL join), what will your favourite language infe
by grumpyprole 8mo ago
Most languages have poor support for structural types though. If you try and join two records together (like a SQL join), what will your favourite language infer then?
- sfn42 8mo agoC# has anonymous types which is pretty much the same thing. Though I prefer to declare actual types for most usecases, I'll only use anonymous types for intermediate results and such.
- grumpyprole 8mo agoI certainly don't mean to knock nominal types. But I think structural types are more fundamental. A language would only need a single "newtype" or "nominal" keyword to create nominal types from structural types.
- lock1 8mo agoWhy structural is more fundamental? C#'s anonymous type shares some flexibility of structural type system even though it still a nominal type. > A language would only need a single "newtype" or "nominal" keyword to create nominal types from structural types. I think you also can add `structural` keyword & apply structural type system in generally nominal type system as well if we're talking about adding feature.
- KellyCriterion 8mo agoClaude is "very good" in applying >var< continuously :-D