9
votes
Static or dynamic dispatch for ad-hoc polymorphism
As @Silvio Mayolo mentions in the comments, GHC Haskell does transform code to this “dictionary-passing style” by adding vtable arguments, but the result doesn’t necessarily require dynamic dispatch. ...
6
votes
How to dynamically dispatch extension methods?
Objective-C's solution
Objective-C is insane.
Background
You know, say, C# dynamic? How every method call needs to be dynamically dispatched because you have no ...
5
votes
Declaration-site vs use-site overloading
A major disadvantage is that it relies on naming to implement a feature that can be implemented only using type information. This looks more like something that would exist in a macro language like \...
4
votes
Static or dynamic dispatch for ad-hoc polymorphism
There is a well-understood compiler optimization called "devirtualization", which GHC is almost certainly going to rely on later in the compiler pipeline.
The core idea behind ...
4
votes
Accepted
Virtual functions from two classes
This feels more like a stackoverflow Q than a PLDI one as you seem to be talking about how to use a feature not realize it in a language.
I will assume you mean the latter.
If I've interpreted your ...
2
votes
How to dynamically dispatch extension methods?
I don't see much problem in adding extension methods to a vtable per se, it can work pretty much like usual inheritance. There's not so much difference between
...
1
vote
Static or dynamic dispatch for ad-hoc polymorphism
This can only be answered definitively by the language designers, but my guess is that it's a combination of:
Static dispatch requiring monomorphisation, which causes more code to be generated and ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
dynamic-dispatch × 4polymorphism × 2
static-dispatch × 2
object-oriented × 1
haskell × 1
overloading × 1
extension-methods × 1