Send all your projects and assignments to our professional mail.We will complete your task ontime.

Send all your projects and assignments to our professional mail.We will complete your task ontime.
service@projectlivehelp.com

Monday, October 3, 2011

Programming languages and type systems: types and uses



There are literally hundreds of programming languages that are in use nowadays. This is an artificial language that is used to express the computations that can be performed on a computer or other similar devices. The language can be used to make programs that are used to control machine behavior. They can also be used to express the algorithms with precision and express human communication in a digital fashion.

Let us understand the type system and how it works in the programming languages. The type system defines how the language classifies certain expressions. These aspects are called types. The system also determines how the types interact and how they can be manipulated. The type system ensures that the programs written in a certain language are correct. There are some downsides to the use of the type system but they are easily fixed by so called loopholes in the programming languages. A number of programmers use casts so that they can easily use a normally, disallowed operation between the various types.

If you look at the type languages, usually, they are used to perform type checks. In, more functional languages, type annotations can already be skipped by the programmer. There are several types’ languages that are being used and they have their own particular purpose in the utilization of programming languages.

The programming languages that are considered as typed when there is a specification of the type operations in which it is applicable unless implied that it is not for other types.

Static type is when all the expressions have their particular types that are determined by the currently running program. That means it will only pass through a function that has been created to accept a particular type. They can either be type inferred or manifested. The first one requires a compiler to infer the expressions. The latter one requires the programmer to write the types in particular positions.  You can see this in C++, Java and C#.

Dynamic type is also known as latent and they are associated with the runtime values compared to static that is about textual expressions. You can see this in JavaScript, Ruby, Python and Lisp.

Weak type can be treated as another kind of type. For example, a string can be detected as a number. In some cases, this is useful but errors could happen upon compiling or at run time. This can be seen in languages like JavaScript and Perl.

Strong type is the one that prevents the errors that could happen in weak typing. They are the ones we call as type safe. One of the more popular statically typed languages is C.

Understanding the different types in a programming language, be it JavaScript, C++, Perl or Java provides insight to the programmer about the use of such languages and their nature. There are many other elements of programming languages like semantics and standard library. With hundreds and even thousands of languages available, it would be a good practice to understand what makes them different in terms of type.

No comments:

Post a Comment