How does JVM type erasure help Clojure? Can Clojure exist without it? What would happen if the JVM had reified types? That is, how would Clojure change?
Asked
Active
Viewed 298 times
2 Answers
3
Clojure wouldn't change much at all. Type erasure only applies to Java's type-parameters for generics. All other types are available at runtime.
Browsing Clojure's source, it does not use generics much at all. In the runtime, it passes around Object
s and does instanceof
checks. By treating everything as an Object
, it has no need for generics, and thus, there are no type-parameters to be erased.

Jonathan Tran
- 15,214
- 9
- 60
- 67
0
From what I can tell Clojure does not use type erasure from the JVM, so i dont think much would change with out it.

Arthur Ulfeldt
- 90,827
- 27
- 201
- 284