类型安全
类型安全 一. 什么是类型安全? *Well typed* programs *cannot go wrong* 良好类型化的程序不会出错. If a program has been written so that no possible execution can exhibit undefined behavior, we say that program is well defined. 如果执行一个编写好的程序不可能表现出未定义的行为,我们称之为良好定义的程序. If a language’s type system ensures that every program is well defined, we say that language is type safe. 如果一个语言的类型系统可以保证每个程序都是良好定义的,我们说这个语言是类型安全的. 看一个C语言数组越界的示例: int main(int argc, char **argv) { unsigned long a[1]; a[3] = 0x7ffff7b36cebUL; //数组越界 return 0; }...