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

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.

主站蜘蛛池模板: 积石山| 越西县| 金昌市| 汕尾市| 贵定县| 和龙市| 九寨沟县| 枝江市| 重庆市| 德江县| 耒阳市| 汉川市| 五常市| 乌苏市| 嘉峪关市| 东阳市| 伊宁市| 张家港市| 平泉县| 罗城| 改则县| 城口县| 铜鼓县| 土默特右旗| 交城县| 华容县| 晋州市| 阳朔县| 元朗区| 永康市| 吉林省| 祁东县| 广丰县| 通许县| 镇巴县| 家居| 孝义市| 辽阳县| 南昌市| 德化县| 大丰市|