Comment

Comment by tatterdemalion

> Go also has zero-sized types (struct{}), so I wonder if this is also possible?

No. It specifically uses Rust's generics system, and the fact that generics are monomorphized at compile time, whereas Go interfaces are not.

C++ templates can be used in similar ways.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton