News for hackers. Stuff that matters.
Re:More Good Programming Quotes (2016) by tome on Saturday July 22, 2017 @09:27AM (#14827086)
I don't think that can be it. Polymorphism doesn't require existential types!
Re:More Good Programming Quotes (2016) by rrobukef on Saturday July 22, 2017 @01:29PM (#14828253)
Closed polymorhpism can always be pattern-matched but it requires modifying all matchers. Open polymorphism is the default in OO interfaces: you can always implement a new type by adding code locally.

Since existential types can be monomorphised and compiled to binary code allowing type-safe plugins.

Re:More Good Programming Quotes (2016) by Ace17 on Saturday July 22, 2017 @05:21PM (#14829445)
Yeah, I was referring to polymorphism as we have in OO, where old code can call new code. I didn't even know "closed polymorphism" was a thing (is it equivalent to algebraic types?).
Re:More Good Programming Quotes (2016) by rrobukef on Monday July 24, 2017 @05:15AM (#14836942)
I'm not precise anymore with jargon concerning polymorphism (it's all the same to me), which I probably shouldn't do. I consider two factors: first closed/open (or finite/arbitrary) of 'remembering' an erased type, and second the sugar for nested 'remembering'. Almost all languages have both (open and closed) as either built-in, as a library or as a design pattern for that language. It boils down to either a tagged union or a function pointer. And both can be transformed to the other if needed.

Assembly, C have tagged unions & function pointers. Java has visitors, instanceOf, reflection. C++ has visitors, boost::variant, dynamic casts, mach7. Haskell has ADTs, pattern matching, existential quantification, Dynamic. Rust has pattern matching, traits, Any. Python, javascript, lua, lisp are dynamic, it's easy enough to create both.