Comment

Comment by qznc

There is only two ways to compile generics C++ (instantiation) and Java (type erasure) style. [0]

Alternatives to these are just manual or semi-manual variants. For example, Go people seem to like the "empty interface" approach. Well, that is Java-style type-erasure done manually. The code generation approach is just C++-style instantiation done outside of the compiler.

[0] http://beza1e1.tuxen.de/articles/generics.html

parent qznc 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton