Row Polymorphic Programming
10 comments
·July 14, 2025skybrian
aatd86
When you want to abstract on structs "having" a given field (by name) of a given type, I think. Although that may come in Go at some point.
tines
I think Go interfaces are row-polymorphic aren't they? I'm also wondering what the difference between row-polymorphism and ad-hoc polymorphism (a la C++ templates) is.
ryandv
Nothing, all of this academic obscurantism and esoterica will soon become completely useless ivory tower knowledge.
The AI will produce functionally equivalent code at a tenth of the cost, without needing to hire somebody who studied high-falutin computer science concepts like "polymorphism."
aatd86
highfalutin... I didn't know that word :D
I actually believe otherwise, AI risks fossilizing our programming languages expressiveness and developper experience, shunting any possibility of improvements that is not envoded in its data set.
I think that for tools made for human consumption, AI is always going to be limited (even AGI). A case of "for us by us" is necessary.
Unless humans completely delegate the machine coding to machines and we only remain with a few legacy systems, never inspecting new machine instruction corpus. Inthe future that is.
moron4hire
Also called Nominal Typing. I generally consider it a mistake. Interfaces aren't just a bag of fields and methods. They encode semantics, too. Otherwise, you could dismiss employees with a gun or by loading them into a kiln.
taeric
I am not entirely sure I disagree. I think context is often a big factor in semantics, though? The problem with interfaces is often that people think they do all of the work by themselves. But, that is only true within the context of how you use some data. And people tend to accidentally constrain themselves too heavily.
You can make the same argument for numbers, for an easy exploration. Just look at all of the tools that you can have at your disposal by thinking of things as numbers.
tines
Nominal typing is the opposite, I think you're thinking of structural typing, no?
What could you do with row polymorphism that you couldn’t do with generic functions that take slices in Go?