3 ms·
Really by "boxing" I mean "dictionary passing" (I've also seen the term "intensional type analysis" for it). That encompasses approaches like Java as well as th
by pcwalton 9y ago
Really by "boxing" I mean "dictionary passing" (I've also seen the term "intensional type analysis" for it). That encompasses approaches like Java as well as those of Swift.
Hybrid approaches in which the compiler (or JIT!) decides whether to monomorphize or use vtables are also possible.
- slavapestov 9y ago"Dictionary passing" is a good term for this implementation strategy, I haven't heard it named before. Do you know of any other languages that take a similar approach?
- dbaupp 9y agoHaskell and Ocaml, e.g. http://okmij.org/ftp/Computation/typeclass.html http://okmij.org/ftp/Computation/typeclass.html .
- slavapestov 9y agoI thought Ocaml still boxed values, so there's no equivalent of value witness tables?
- dbaupp 9y agoSure, but it still does basically the same thing of passing around witness tables. Values happen to have a uniform representation, but this seems seems like variation within a cluster of languages that do similar thing rather than something fundamentally new.