3 ms·
> all of which are functional, in part also because OO/subtyping is hard to reason about formally OO subtyping is hard to reason about formally in formal syste
by seanmcdirmid 13y ago
> all of which are functional, in part also because OO/subtyping is hard to reason about formally
OO subtyping is hard to reason about formally in formal systems designed for FP...news at 11! I jest.
The reason FP does so well academically is that no one knows how to rigorously evaluate something that isn't theoretical (since FP is close to math anyways) or performance-based (most other PL work).
The Haskell crowd is also very creative so they do a lot of cool stuff. However, many of their ideas are transferrable to other languages without the FP ideology.
The OO people have something to offer also, but we've been kind of muted lately.
- octo_t 13y ago>> OO subtyping is hard to reason about formally in formal systems designed for FP...news at 11! Well. Even systems like L2 (which are not functional) find subtyping difficult. It becomes difficult in the presence of overloading and overriding.
- gngeal 13y agoI believe there's a nice book called Foundations of Object Oriented Languages which dissects the problem in depth.
- gtani 13y agoPierce's TAPL, also, and Harper's Practical Foundations. There's also some things i've seen about how scala does it, but I'll have to dig for them http://www.cs.cmu.edu/~rwh/plbook/book.pdf http://www.cs.cmu.edu/~rwh/plbook/book.pdf
- octo_t 13y agoSee also the DOT calculus[1] (Dependent Object Types) being the basis for a new foundation for scala's type system [1] - https://github.com/namin/dot https://github.com/namin/dot
- dubbledidu 13y agoOO subtyping is hard to reason about formally in formal systems _in general_.
- seanmcdirmid 13y agoAnd yet, is-a and has-a relationships predominate natural language. Well, it makes sense: natural language is hard to reason about formally also.
- deleted 13y ago[deleted]
- Tyr42 13y agoThe problem isn't that `is-a` is hard, it's the divergence of `is-subtype-of` and `is-subclass-of`. Take a look here, I think it explains it rather well. http://okmij.org/ftp/Computation/Subtyping/ http://okmij.org/ftp/Computation/Subtyping/
- seanmcdirmid 13y agoI would argue that nominative subtyping is natural (basically sub-classing), since it matches our ability to assign arbitrary meaning and relationships to words, which is incredibly useful when having a conversation. Ya, maybe a set isn't exactly a bag, but close enough. Birds mostly fly, but penguins don't, we can deal with that. But the main problem with subtyping, nominative or structural, is how it messes up Hindley-Damas-Milner style type inference. But that shouldn't be surprising that an FP theory for type inference wouldn't work well for OOP.