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

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.

主站蜘蛛池模板: 西乌| 随州市| 武宣县| 昌宁县| 宝丰县| 彭泽县| 承德市| 富锦市| 炉霍县| 邵东县| 永济市| 清新县| 武夷山市| 通化县| 米易县| 临安市| 土默特左旗| 双城市| 石河子市| 木兰县| 东乡族自治县| 孟村| 平湖市| 丽江市| 安西县| 土默特左旗| 珲春市| 孟州市| 珲春市| 吴堡县| 榆社县| 收藏| 大洼县| 三门县| 浪卡子县| 南康市| 醴陵市| 衡南县| 西平县| 五大连池市| 乌兰察布市|