Skip to main content
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. ...
Jon Purdy's user avatar
  • 3,648
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 ...
Bbrk24's user avatar
  • 9,672
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 \...
coredump's user avatar
  • 953
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 ...
Simon Farnsworth's user avatar
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 ...
Bruce Adams's user avatar
  • 3,002
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 ...
Alex Chichigin's user avatar
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 ...
osa1's user avatar
  • 847

Only top scored, non community-wiki answers of a minimum length are eligible