News for hackers. Stuff that matters.
Re:The Law of Leaky Abstractions (2002) by lmm on Wednesday March 06, 2024 @07:38PM (#39623686)
The best paradigm for understanding abstractions is not the theory-and-model style (which requires hiding details irreversibly), but the equivalence style.

A good abstraction is e.g. summing a list whose elements are a monoid - summing the list is equivalent to adding up all the elements in a loop. Crucially, this doesn't require you to "forget" the specific type of element that your list has - a bad version of this library would say that your list elements have to be subtypes of some "number" type and the sum of your list came back as a "number", permanently destroying the details of the specific type that it actually is. But with the monoid model your "sum" is still whatever complex type you wanted it to be - you've just summed it up in the way appropriate to that type.

Re:The Law of Leaky Abstractions (2002) by cloogshicer on Thursday March 07, 2024 @04:32AM (#39626982)
Interesting! Can you point me to some further reading or resources on these different paradigms?