Programming Languages Presentation at Preparatory Course for English for Science and Research at Tallinn University of Technology

Yesterday I gave a presentation at a lesson of the English language. It took place in the evening at the end of the lesson. As a student of Tallinn University of Technology, I was failed in a compliance to an English test, so now it is necessary to attend the Preparatory Course for English for Science and Research. In order to pass an examination, it is needed of a few tasks and the one of those tasks is the presentation.

I am a student at the faculty of Information Technology. My specialty is Informatics with the  main specialization of network application and logic. The subject of the presentation was Programming Languages. The purpose was to give a little background to the subject according to examples and my expertise.

The main definition of programming languages is an artificial language expressing some logic that can be performed by a computer. A programming language is described by a specification of its syntax and semantics. A good example for this is the following expression:

A > B and B > C or C < D and D < B or A > D

where
A, B, C, D – variables which have some value or mark something
>, <, and, or - operators or functions

The syntax is like a grammatical sequence of natural language. Is the  sentence above correctly stated? If we put some spaces, are they necessary? For instance, in natural language the sequential symbol (,) may not have space symbols before or after, but the syntax can be still understood. In a programming language it sometimes may not have space symbols too.

The semantics is like a meaning of natural language. As long as we know now that the expression above is correctly formed, we need to know its meaning in terms of a programming language. What do the marks (>, <, and, or) mean? What mark is more important and needed to be read first? On the one side there are natural languages. They have families of related languages deriving one from another. They are influenced by its related languages and languages of foreign families. They are used by people with each other, can be ambiguous (or mean two different things with the same words) and erroneous (with errors), and people still can understand each other. In addition, they have different meanings in different communities. As opposite to natural languages on the other side there are programming languages. They have also an entire family of ancestors. Furthermore, ancestors (or relatively old languages) and other languages of different families are combined together with a new flavor of ideas to meet needs today. Almost like natural languages, but in contrast with people, computers "do exactly what they are told to do", and if there is a code with errors in some programming language, so they cannot "understand" what is meant by it. Moreover, programming languages have a precise and finite definition, therefore they can be entirely described and understood. I have looked closely at programming languages. They divide into programming paradigms or styles of computer programming. Some of them are:

  • Imperative programming
    As rules of this paradigm, the sequential ordered flow of commands matters and it has such a side effect as modifying or updating either usual global variables or function’s own arguments.
  • Declarative programming
    The opposition to the imperative programming is the case of declarative programming.  The sequential ordered flow of commands does not matter and no side effects as modifying or updating something. And if we move on a little deeper, sub-paradigms are existing there. Some of them are:

    • Logic programming
    • Functional programming

Firstly, I have turned to the imperative programming. This paradigm is the most popular due to being closely connected hardware. At the physical hardware level of a computer there are only raw bits: 1 or 0; on or off. Because of the such poor principle of the expression, we need to understand what they are meant, so the sequence of those bits matters. In order to make more performance of computation, we need to be closely to the physical hardware level, because the hardware level is the zero ground. To illustrate this point, I was using an example:

When we boot a computer, all properly connected hardware will be mirrored in the central memory with a particular address. In order to give commands to CD-ROM hardware for example, we refer to that address giving a sequence of bits. For example, the first bits in the sequence define where and which CD-ROM, the second bits in the sequence define that CD-ROM hardware is turned on or turned off, the third bits in the sequence define that it is needed to read or to write and so on. The example is probably rather imaginary but not so far from reality.

For the second paradigm there is the declarative programming. It has a clear correspondence to mathematical logic and being interested mainly in the academic field. To illustrate this, I wanted to go on to an example of personal usage. So, as long as I am studying at university in order to receive the one of academic degrees in informatics, I have some lessons dedicated to the mathematical logic and namely

  • Logic for Computer Science
  • Recursion and complexity theory

Those lessons are purely mathematical. In their studying, certain rules and constructions of formalization are used for the mathematical logic expression. For instance:

At the lesson of Logic for Computer Science I have met such a construction:
Interpretation is an arbitrary function I: PC -> {1,0}

where
PC = {p, q, . . .} symbolic signature; 1 – true, 0 – false

At the lesson of Recursion and complexity theory I have met another one:
Partial function f: A -> B is a function

where
possible input values (domain(f)) are some sub-array of the array A
output values (range(f)) are the array B

If we consolidate together both those constructions above, we can receive something like the following:
Function f: X -> Y

At the moment it is clear there are the X input, the arrow mark (‘->’) of which the meaning is probably ‘follows from to’ or ‘implicates one in other’, the Y output.

The certain general idea of the last construction above is unclear. It has the formalization of the logic expression, but the questions are:

  • What are the purpose?
  • If it is a function how can it do something in a such formalization?
  • What can its meaning be related to?

The same moment of studying at university I have other lessons too, which are certainly connected to programming. And the one of those lessons is Functional programming. At the lesson of Functional programming we are studying the Haskell programming language what is the obvious representative of functional programming. I had a need to perceive clearly its form and semantics, so I have started reading a book of those listed in a description for the lesson. Certainly I have learned new things and the one of those things was a definition and usage of functions. The definition of a function in Haskell is as following:

Func :: A -> B
Func A = B

where
Func is an arbitrary name for a function
A — input of arguments
B — output of resulting computation of a function using A

It became clear rather than it was before. It is clear to me and I hope it is relatively clear to us.

References

Tags: , ,

One Response to “Programming Languages Presentation at Preparatory Course for English for Science and Research at Tallinn University of Technology”

  1. For the first comment, I would like to mention the blog entry about programming languages as a point of departure for writing a journal.