top | item 24974237

(no title)

codygman | 5 years ago

> Is Go fundamentally type-unsafe?

Interface{} and nil pointers point to yes.

discuss

order

platinumrad|5 years ago

Neither of those is incompatible with Cardelli's definition of type safety. `interface{}` is not `void *`. Null pointer errors are not untrapped.

lmm|5 years ago

Cardelli's definitions are extremely odd; if you take them literally then Python is type safe but Java is not.

In everyday language a downcast, even a checked one, is not a type-safe operation, and so to the extent that Go's limited type system makes it impractical to write programs without downcasts I'd say that Go is fundamentally type-unsafe.