Chapter 3: Type Disciplines
Last updated
Last updated
Whenever we talk about programming languages, there are various ways to categorize them, but the more general way for categorizing the language in depends on its behaviors. As shown in below diagram :
Dynamic and Static are two general categories for programming languages, there is endless debates are available throughout the internet where programmers are fighting about which one is good or bad. Here we are not going to conclude this discussion, everyone has its own opinion and both categories have there pros and cons. Today’s we are briefly walkthrough on these categories and their further categories.
So, Dynamic and Static languages are divided into further sub-categories which are Strong and Weak. These categories are represented in the form of a mathematical graph as below:
Both Dynamic and Static languages are based on the Strong and Weak type system. These concepts are beautifully explained by Heather Miller in her blog which we conclude here.
The language where types are resolved during runtime. Dynamic languages are interpreted languages where there is no compiler requires and code is directly executed by the interpreter or VM’s.
The language which checks the correctness of the program at runtime and preventing one from calling a method from String (as an example) on that to an Int. Python is one of the examples of strong dynamic type language.
The language provides no way for the programmer to write an arbitrary memory location. It allows the user to directly manipulate the memory like JavaScript, Assembly and more.
The language where the program is executed in two phases which are compilation than execution. In this type of languages, compiler plays the role of developer guard, which help us to resolve 50% of runtime issues during compile time.
At compile time the language ensures that a certain value with a specified type like Int is correctly used throughout the program so that at runtime nothing else other than specified type can be held that memory location. Examples like Scala, Java and more…
At compile time the language ensures that a certain value with specified type is correctly used throughout the program but at runtime, you can change the value at the specified type memory allocation. Examples like C and more...
For more details about type discipline, you can search through our the google there are lots of articles and blogs are there for dynamic and static languages with their weak and strong points.