The Haskell programming language

T

Haskell is a functional programming language. It bears the name of Curry Haskell.

Why do we call Haskell a functional language?
Because, unlike imperative languages ​​that practically manipulate DATA in the form of whole numbers or values ​​encoded by whole numbers (characters, strings, pointers), functional languages ​​manipulate FUNCTIONS encoded by lambda expressions. And if the functional language is compiled, they are coded by combinators. As the set of functions is richer than the whole number (has a higher cardinal), such languages ​​are more expressive.

At a pragmatic level, any functional language can be seen as an algorithm manipulator, most often expressed as elementary mathematics.
Haskell has managed to become a powerful programming language, quite used in various areas such as artificial intelligence, security, web application development or operating systems.
Many of the novelties that were introduced into language came later in C ++, Java.

This development is due both to the community created around language and to the facility that language can be learned using online resources.
Most of them who use it will relate to two aspects: the declarative style and the guarantee of a certain correctness of the code.
The programs written in functional languages ​​are extremely concise, with emphasis on what the code sequence should do, not how it should do.
To help program validate validation, Haskell has static patterns: each expression has a known type from compilation.
In addition, there are no default conversions between similar types: the programmer will have to explicitly make conversions where they are needed.

Some researchers have promoted the idea that a correct use of the types can guarantee an important invariant: if the program compiles then there is a good chance that it is correct. This is often not entirely true. In fact, we try to convert the most common runtime bugs and bugs into compilation errors.
For example, the Haskell language solves the null-pointer-exception problem using a special type of data called Maybe: the programmer will return encapsulated values ​​in this type from the functions that can fail, and the compiler ensures that any use of the result returned by these functions is verified.

More than that, Web application development frameworks have been created in which each character string has its own type: no more CSS portions can be confused with HTML portions, nor can classical SQL attacks Injection or the like. Another advantage of static printing is that a programmer can search for a function by knowing only its type. There are two search engines for this: Hayoo and Hoogle. Both will look for features trying to generalize as much as possible the arguments they offer, and to offer the most eloquent private suggestions. After a while, it comes to scheduling as if a huge puzzle is solved in which the pieces are given by the functions that will end up in the final program.
An important quality of language is purity. Taking into account that any program needs to interact with the outside (reading data, data transmission, etc.), Haskell also offers functions for in-out operations. But they will be marked differently from the point of view of the types. The type of any side effect action is IO. If Maybe the encapsulated values ​​could be removed, this is no longer possible in the case of IO. This makes any function that uses side effects not be called but from functions that will be marked as side effects. Basically, the code is divided into two camps: the purely functional code for data processing and the imperative code for interaction with the outside. This separation makes Haskell considered by Simon Peyton Jones – one of the creators of the language – to be the best programming language imperative.

The Haskell Code can be interpreted or compiled. It is recommended that you use the GCG (Haskell Compiler Collection) together with Haskell Platform to have all the benefits of language and high-performance and tested high-level libraries. The GHC suite comes with a ghc and an interpreter (ghci). The interpreter allows fast application development, code testing, or expression type, etc. The compiler allows generation of an executable having the same performance as a code written in the classical languages.
The Haskell Platform suite offers application profiling tools to optimize the code as much as possible.

About the author

Ilias spiros
By Ilias spiros

Recent Posts

Archives

Categories