官术网_书友最值得收藏!

Static types

There are two possible times when type errors can happen: at compile time and at runtime. This is the crucial difference between static and dynamic type systems: static type systems are so called because they statically analyze programs and try to find type errors, while dynamic type systems are so called because they throw type errors dynamically, while they run the program.

A dynamic type system will definitely find all the type errors in your program, provided it actually runs all the execution paths in it. Any paths that remain unexecuted may contain hidden type errors.

A static type system will try to find as many errors as possible without running your program. Normally, this is not a guarantee that you will catch all type errors before runtime. Some errors may slip through the typechecker and still hit you at runtime. Plus, a type system may make it difficult to express a program that you know is correct because it thinks it's not. You will want to pay close attention when this happens, though, as either the typechecker is correct, or your design will benefit from expressing the program in a different, accepted, way.

主站蜘蛛池模板: 兴仁县| 嵊州市| 拉萨市| 神农架林区| 元江| 湘西| 金沙县| 卫辉市| 赣榆县| 嘉兴市| 扶余县| 仪征市| 壶关县| 英超| 六枝特区| 平果县| 长岭县| 贺州市| 安新县| 竹溪县| 建德市| 六枝特区| 南郑县| 叙永县| 东阳市| 长岛县| 思南县| 德令哈市| 进贤县| 宜州市| 开阳县| 内丘县| 常熟市| 衡南县| 临安市| 东阳市| 遵化市| 竹溪县| 东平县| 沭阳县| 喀什市|