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

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.

主站蜘蛛池模板: 文昌市| 平南县| 长泰县| 韩城市| 天水市| 开鲁县| 九寨沟县| 子长县| 湘潭市| 邵武市| 额济纳旗| 灵丘县| 茂名市| 大城县| 清镇市| 海城市| 德格县| 秀山| 鸡西市| 弥勒县| 阜平县| 吴旗县| 海兴县| 汤阴县| 西昌市| 水城县| 壤塘县| 房产| 科技| 综艺| 门头沟区| 大兴区| 九寨沟县| 绵竹市| 临桂县| 阳东县| 平顺县| 芷江| 保靖县| 池州市| 宕昌县|