zjffun blog

编程语言的类型系统

更新于 写于

  • 类型表达式:显式 / 隐式
  • 类型兼容性和相等:结构 / 名称(根据是否具有相同的结构判断是否相等 / 根据声明的类型名称是否相等确定是否相等)

强类型 / 弱类型

A number of different language design decisions have been referred to as evidence of "strong" or "weak" typing. Many of these are more accurately understood as the presence or absence of type safety, memory safety, static type-checking, or dynamic type-checking.

  • 类型安全:A language is type-safe if the only operations that can be performed on data in the language are those sanctioned by the type of the data.
  • 类型检查:静态 / 动态

See: