DOC-20190413-WA0000

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 18

Cocu Iulia Veronica Unit 6 – Programming languages

Unit 6
Programming Languages

1
Cocu Iulia Veronica Unit 6 – Programming languages

5 A programming language is a notation for writing programs, which are


specifications of a computation or algorithm. Many programming languages have some
form of written specification of their syntax (form) and semantics (meaning). Traits often
considered important for what constitutes a programming language include:
 Function and target: a computer programming language is a language used
10 to write computer programs, which involve a computer performing some
kind of computation or algorithm and possibly control external devices
such as printers, disk drives, robots, and so on
 Abstractions: programming languages usually contain abstractions for
defining and manipulating data structures or controlling the flow of
15 execution
 Expressive power: the theory of computation classifies languages by the
computations they are capable of expressing
Thousands of different programming languages have been created mainly in the
computing field. Programming languages differ from most other forms of human
20 expression in that they require a greater degree of precision and completeness. A
programming language provides a structured mechanism for defining pieces of data, and
the operations or transformations that may be carried out automatically on that data.
Programs for a computer might be executed in a batch process without human interaction,
or a user might type commands in an interactive session of an interpreter. In this case the
25 “commands” are simply programs, whose execution is chained together.
It is difficult to determine which programming languages are most widely used,
and what usage means varies by context. One language may occupy the greater number
of programmer hours, a different one may have more lines of code, and a third utilize the
most CPU time. Some languages are very popular for particular kinds of applications. For
30 example, COBOL is still strong in the corporate data center, often on large mainframes;
FORTRAN in engineering applications; C in embedded applications and operating
systems. PHP is a widely used, general-purpose scripting language that was originally
designed for web development to produce dynamic web pages. For this purpose, PHP
code is embedded into the HTML source document and interpreted by a web server with
35 a PHP processor module, which generates the web page document. SQL is a database
computer language designed for managing data in RDBMS, and originally based upon
relational algebra. Its scope includes data query and update, schema creation and
modification and data access control. Java is a general-purpose, concurrent, class-based,
and object-oriented, and is specifically designed to have as few implementation
40 dependencies as possible. Its language derives much of its syntax from C and C++ but
has a simpler object model and fewer low-level facilities.
Programming languages have been classified into several programming language
generations.
The distinguishing properties of the first generation programming languages are
45 that:
 The code can be read and written by a programmer. To run on a computer
it must be converted into a machine readable form, a process called
assembly
 The language is specific to a particular target machine or family of
50 machines

2
5 Cocu Iulia Veronica Unit 6 – Programming languages

 Some assembler languages provide a macro-facility enabling the


development of complex patterns of machine instructions
Second generation programming languages, originally just called high level
programming languages were created to simplify the burden of programming by making
55 its expression more like the normal mode of expression for thoughts used by the
programmers. They were introduced in the late 1950’s, with FORTRAN reflecting the
needs of scientific programmers, ALGOL reflecting an attempt to produce an European /
American standard view, and COBOL providing a “natural language” for developers of
commercial software.
60 The third generation languages emphasized:
 Expression of an algorithm in a way that was independent of the
characteristics of the machine on which the algorithm would run
 The rise of strong typing (used to describe those situations where
programming languages specify one or more restrictions on how
65 operations involving values having different data types can be intermixed)
 Block structures (blocks which can be nested to any depth) and automated
management of storage with a stack
 Broad-spectrum applicability and greatly extended functionality
“Generational” classification of these languages was abandoned after the third
70 generation languages, with the natural successors to the third generation languages being
termed object-oriented. C gave rise to C++ and later to C#, LISP to CLOS, ADA to ADA
95 and even COBOL to COBOL 2002, and new languages like Java have emerged in that
“generation” as well.
But significantly different languages and systems were already being called fourth
75 and fifth generation programming languages by language communities with special
interests. The manner in which these generations have been put forward tends to differ in
character from those of earlier generations, and they represent software points-of-view
leading away from the mainstream.

3
Cocu Iulia Veronica Unit 6 – Programming languages

80

4
Cocu Iulia Veronica Unit 6 – Programming languages

I.
a) Give synonyms for the following words from the text:

Specifications (l. 2); traits (l. 3); chained (l.21); embedded (l. 27); query (l. 33); converted
85 (l. 43); spectrum (l. 64); emerged (l. 68); mainstream (l. 74)

b) What do the following abbreviations stand for?


COBOL; FORTRAN; PHP; SQL; RDBMS; LISP; CLOS; PASCAL; BASIC;
DYNAMO;
90

II. Explain the following mathematical concepts in English:

1. Hexadecimal figure
95 2. Binary mathematics
3. Floating point arithmetic
4. Double precision arithmetic
5. Boolean truth values

100
III. Match the following programming languages with their definition:

a) Answer the following questions:


1. What is software – as compared to hardware?
105 2. What kind of software do all computer users need in order to use their machines?
3. What purposes do programming languages serve?
4. What is a low-level language?
5. What is the purpose of a compiler?

110

10 5
Cocu Iulia Veronica Unit 6 – Programming languages

b) Complete the following sentences (you may use more than one word per blank space):
1. New ………… are released every time there is an improvement on the hardware side.
2. …………. are languages which are close to human language.
3. ………… such as Excel 4.0 or Multiplan are some of the most widely-used …………
115 in the computer field.
4. The translation of a program into machine code is carried out either via a ………… or
an ………….
5. Before running a program, the user has to ensure that it is …………-free.

120
IV. Match the following programming languages with their definition:

1. ActionScript; 2. C#; 3. C++; 4. Delphi; 5. Erlang; 6. FoxPro2; 7. Java; 8. LabVIEW; 9.


Lisp; 10. MATLAB; 11. PHP; 12. PEARL; 13. Unix shell; 14. Visual Basic; 15. XML
125
a. a text-based procedurally-oriented programming language and DBMS, originally
published by Fox software
b. a general-purpose scripting language; it is embedded into the HTML source document
and interpreted by a web server, which generates the web page document
130 c. a multi-paradigm programming language encompassing imperative, functional,
generic, object-oriented and component-oriented programming disciplines
d. produced by Borland, it was formerly known as the Object Pascal Language; its most
popular use is the development of desktop and enterprise database applications, but as a
general purpose development tool it is capable of and used for most types of development
135 projects
e. a programming language that derives much of its syntax from C and C++ but has a
simpler object model and fewer low-level facilities; it is widely used from application
software to web applications
f. a computer programming language designed for multitasking and real-time
140 programming; it supports both fixed-point and floating-point numeric values, character

6
Cocu Iulia Veronica Unit 6 – Programming languages

and character string data as well as bit values; it also provides facilities for structures and
multi-dimensional arrays
g. it is derived from BASIC and enables the rapid application development of graphical
user interface applications, access to databases using Data Access Objects, Remote Data
145 Objects or ActiveX controls and objects
h. a set of rules for encoding documents in machine-readable form; its design goals
emphasize simplicity, generality and usability over the Internet
i. a scripting language developed by Adobe, used primarily for the development of
websites and software targeting the Adobe Flash Player platform
150 j. short for Laboratory Virtual Instrumentation Engineering Workbench; it is also referred
to as G and used for data acquisition, instrument control and industrial automation
k. a command-line interpreter or shell that provides a traditional user interface for the
Unix operating system and for Unix-like systems
l. designed by Ericsson to support distributed, fault-tolerant, soft-real-time, non-stop
155 applications
m. one of the earliest programming languages; it pioneered many ideas in computer
science, including tree data structures, automatic storage management, dynamic typing
and the self-hosting compiler; linked lists are one of this programming language’s major
data structures and its source code is itself made up of lists
160 n. a statically typed, free-form, multi-paradigm, compiled, general-purpose programming
language; this language began as enhancements to C, first adding classes, then virtual
functions, operator overloading, multiple inheritance, templates, and exception handling
among other features
o. it allows matrix manipulations, plotting of functions and data, implementation of
165 algorithms, creation of user interfaces and interfacing with programs written in other
languages, including C, C++ and Fortran.

170

7
15 Cocu Iulia Veronica Unit 6 – Programming languages

V. Fill in the blanks of the following text about Linux:

In 1992, a talented programmer named Linus Torvalds took a small educational


175 version of UNIX called Minix rewriting and extending it. By mid 1993, Linux had
completely dropped its Minix roots and became quite a 1) ……….. of UNIX. 2)
………… it was adopted with great enthusiasm by other programmers on the Internet, it
began 3) ………… like wildfire. It soon became the fastest growing version of Unix,
mainly because it was 4) ………….
180 Linux ran primarily on x86 based PC’s, and it actually ran pretty well even on a
slow 386 with 4 Mb of RAM and a 40 Mb hard disk. Linus and his followers proudly
described Linux as a 5) ……….. (a programmer’s system) because it relied heavily on
freely 6) ………… which had been written by other 7) …………. Its 8)………… was
the X Window System, which was freely available from MIT. For its GUI it used a
185 collection of freely available window managers and other GUI components, as well as the
Athena and OpenLook styles, which were also freely available. Because of its 9)
…………, some 10) ………… even began to sell versions of Motif for Linux. Most of
the other programs which people actually used (the shells, the compilers, the utility
commands, etc.) came from the GNU Project – a free software 11) ………… started by
190 Richard Stallman in the 1980’s. Stallman was a talented programmer, but he was also a
little 12) …………. He passionately believed that all software should be free and should
come with 13) ………… so that other programmers could extend it, and that computing
professionals should only make money through 14) …………. The ultimate goal of the
GNU Project was to create a completely free UNIX-like operating system called GNU.
195

VI. Translate the following two excerpts into English:

a) Java este un limbaj de programare de nivel înalt, dezvoltat de JavaSoft, companie în


200 cadrul firmei Sun Microsystems. Dintre caracteristicile principale ale limbajului amintim:

8
Cocu Iulia Veronica Unit 6 – Programming languages

 simplitate - Java este uşor de învăţat, caracteristicile complicate (supraîncărcarea


operatorilor, moştenirea multiplă, şabloane) întâlnite în alte limbaje de
programare sunt eliminate.
 robusteţe, elimina sursele frecvente de erori ce apar în programare prin eliminarea
205 pointerilor, administrarea automată a memoriei şi eliminarea fisurilor de memorie
printr-o procedură de colectare a 'gunoiului' care rulează în fundal. Un program
Java care a trecut de compilare are proprietatea ca la execuţie să nu "cadă
sistemul".
 complet orientat pe obiecte - elimină complet stilul de programare procedural; se
210 bazează pe încapsulare, moştenire, polimorfism
 uşurinţă în ceea ce priveşte programarea în reţea
 securitate, este cel mai sigur limbaj de programare disponibil în acest moment,
asigurând mecanisme stricte de securitate a programelor concretizate prin:
verificarea dinamică a codului pentru detectarea secvenţelor periculoase,
215 impunerea unor reguli stricte pentru rularea programelor lansate pe calculatoare
aflate la distanţă etc
 este neutru din punct de vedere arhitectural
 portabilitate, cu alte cuvinte Java este un limbaj independent de platforma de
lucru, aceeaşi aplicaţie rulând, fără nicio modificare, pe sisteme diferite cum ar fi
220 Windows, UNIX sau Macintosh, lucru care aduce economii substanţiale firmelor
care dezvoltă aplicaţii pentru Internet.
Sloganul de bază este: "Write once, run anywhere"
În funcţie de modul de execuţie al programelor, limbajele de programare se
împart în două categorii:
225  interpretate: instrucţiunile sunt citite linie cu linie de un program numit interpretor
şi traduse în instrucţiuni maşină; avantaj: simplitate; dezavantaj: viteză de
execuţie redusă;
 compilate: codul sursă al programelor este transformat de compilator într-un cod
ce poate fi executat direct de procesor; avantaj: execuţie rapidă; dezavantaj: lipsa
230 portabilităţii, codul compilat într-un format de nivel scăzut nu poate fi rulat decât
pe platforma pe care a fost compilat.

9
Cocu Iulia Veronica Unit 6 – Programming languages

Programele Java sunt atât interpretate cât şi compilate.


Codul de octeţi este diferit de codul maşină. Codul maşină este reprezentat de o
succesiune de 0 si 1; codurile de octeţi sunt seturi de instrucţiuni care seamănă cu codul
235 scris în limbaj de asamblare. Codul maşină este executat direct de către procesor şi poate
fi folosit numai pe platforma pe care a fost creat; codul de octeţi este interpretat de
mediul Java şi de aceea poate fi rulat pe orice platformă care foloseşte mediul de execuţie
Java.

240 b) „Nivelul”unui limbaj este apreciat prin poziţia pe care o ocupă pe scara constituită de
limbajul recunoscut de microprocesor (limbaj maşină) şi limbajul natural al
programatorului (limba română, limba engleză etc.).
Un limbaj de nivel scăzut este foarte apropiat de maşină, el manipulează cu
elemente de nivel hardware, fizic, cum ar fi: registru, microprocesor, locaţie de memorie,
245 port de intrare/ieşire etc.
Un limbaj de nivel înalt sau foarte înalt manipulează cu concepte apropiate de
limbajul natural, concepte de nivel logic, cum ar fi: colecţie de date, nume de operaţie
(sort, writeln, open), variabile, constante (asemănătoare ca înţeles cu cele din
matematică).
250 Cu ajutorul unui limbaj de nivel înalt programatorul se face mult mai uşor înţeles
de către calculator . Uneori o singură linie de program scrisă cu un astfel de limbaj poate
echivala cu sute de linii de program scrise în limbaj maşină. Deci din punct de vedere al
reducerii timpului de realizare al unui program şi al siguranţei în funcţionare (absenţa
erorilor de programare) este de preferat un limbaj de nivel cât mai ridicat (înalt sau foarte
255 înalt). În schimb, pe măsură ce limbajul are un nivel mai ridicat execuţia programului
conceput cu ajutorul său va fi mai lentă, decât a unui program ce realizează aceleaşi
operaţii dar este scris în limbaj de asamblare.
O altă diferenţă esenţială între cele două tipuri de limbaje o reprezintă
portabilitatea, adică posibilitatea transferării programelor pe un alt tip de maşină decât
260 cea pe care au fost construite. Din acest punct de vedere limbajul de asamblare este
neportabil deoarece el este specific microprocesorului. Programele realizate pe un tip de
maşină trebuie rescrise integral pentru noul tip de maşină, folosind un nou set de

20 10
Cocu Iulia Veronica Unit 6 – Programming languages

instrucţiuni – care, de obicei, diferă foarte mult. Lucrurile stau altfel cu programele
concepute cu ajutorul unui limbaj de nivel înalt, deoarece acestea sunt detaşate de
265 maşină. Între un astfel de program şi calculator se interpune compilatorul (sau
interpretorul) care rezolvă corect transformarea fişierului-sursă în fişier-executabil.
Limbaje procedurale – neprocedurale
Cele două tipuri de limbaje, procedurale şi neprocedurale, se diferenţiază prin
nivelul de organizare (structurare) a unui program . Limbajele neprocedurale sunt
270 concepute pentru a gândi un program la nivel de instrucţiune, pe când cele procedurale,
obligă programatorul să conceapă programe la nivel de bloc. Într-un limbaj procedural
(numit şi limbaj structurat), programele sunt scrise instrucţiune cu instrucţiune, dar ele
sunt organizate logic în blocuri (grupuri de instrucţiuni) ce realizează o acţiune bine
determinată. În general un bloc are un punct de intrare şi un punct de ieşire – nu mai
275 multe.
Un limbaj procedural oferă posibilitatea utilizării unui nivel ridicat de concepere a
unui program şi duce la realizarea de programe coerente şi protejate la erori. Prin
contrast, limbajele neprocedurale nu favorizează programatorul în a se desprinde de
nivelul „instrucţiune” şi duc deseori la programe greu de controlat – mai ales în cazul
280 programelor de dimensiuni mari.
Limbajele neprocedurale sunt încă preferate de unii utilizatori datorită timpului
foarte scurt cât decurge învăţarea şi utilizarea lor.
Limbaje orientate
Din punctul de vedere al aplicabilităţii unui limbaj, limbajele pot fi orientate pe o
285 anumită problemă sau concepute pentru soluţionarea oricărui tip de problemă – limbaje
de uz general sau altfel spus, neorientate pe o problemă.
Limbajele orientate prezintă un grad înalt de specificitate pe când un limbaj
neorientat reprezintă un cadru general ce permite introducerea de către utilizator a
conceptelor şi prelucrărilor dorite.
290 Deci, diferenţa esenţială dintre cele două tipuri de limbaje o constituie nivelul
conceptual definit. Cele specializate posedă deja integral suportul necesar şi permit
programatorului să se concentreze la ansamblul problemei, pe când cele nespecializate
lasă în sarcina programatorului manevrarea nivelelor inferioare ale problemei.

11
Cocu Iulia Veronica Unit 6 – Programming languages

Limbaje concurente
295 Un limbaj concurent permite definirea de procese (prelucrări) paralele, execuţia sa
fiind ramificată la un anumit moment de timp. Prin contrast, limbajele neconcurente
(majoritatea limbajelor) au o desfăşurare liniară, fiind activ un singur proces la un
moment dat. Procesele concurente presupun în mod obligatoriu un sistem multi-tasking
ce poate gestiona mai multe „sarcini” la un moment dat.
300 Limbaje de nivel scăzut
Această categorie de limbaje are un reprezentant autoritar şi anume: limbajul de
asamblare. Diferenţierile care se pot face pentru limbajele de nivel scăzut sunt
următoarele:
a) – după tipul de maşină ;
305 Regulile respectate de versiunile limbajului de asamblare sunt:
- o nouă versiune o include complet pe cea anterioară ,
- versiunea nouă oferă funcţii suplimentare şi le realizează pe cele vechi mai rapid .
b) – după mediul de programare oferit.
Aspectul unui limbaj poate fi schimbat radical de mediul de programare oferit.
310 Pentru limbajul de asamblare există mai multe implementări disponibile, începând cu
pachete ce operează în mod linie şi culminând cu medii integrate în care toate operaţiile
se pot declanşa de la un acelaşi pupitru de comandă.
Nu sunt luate în considerare decât aceste medii integrate( denumite generic medii
Turbo), dintre care se detaşează Turbo Asamblorul firmei Borland TASM.

12
25 Cocu Iulia Veronica Unit 6 – Programming languages

315 GRAMMAR SPOTLIGHT


The Adjective

Adjectives fall into two categories:


320  Descriptive – those which express an inherent quality (important, clever,
interesting) or a physical state such as age, colour, size (young, red,
small)
 Limiting – those which place restriction on the nouns they modify
expressing distance, quantity, possession etc. (this, much, my)
325 
The order of adjectives
When two or more adjectives modify the same noun, their order should be as
follows:
a) Adjectives describing a thing
330 number; attributive; age; size; shape; colour; origin; material; -ing + noun
e.g.: two beautiful old square brown French wooden tables
b) adjectives describing a person
number; attributive; size; age; origin + noun
e.g.: five pretty tall young Romanian girls
335
The comparison of adjectives
According to the way in which adjectives form the Comparative and the
Superlative, they are divided into regular and irregular.
Within the regular adjectives there are two subclasses of adjectives which will
340 form the comparative and the superlative as follows:
Monosyllabic adjectives (except: right, wrong, real)
Positive Comparative Superlative
-er the -est
long longer the longest

13
Cocu Iulia Veronica Unit 6 – Programming languages

Plurisyllabic adjectives
Positive Comparative Superlative
more + adjective the most + adjective
beautiful more beautiful the most beautiful
difficult more difficult the most difficult
Some adjectives are irregular. Such adjectives are the following:
Positive Comparative Superlative
good better the best
bad worse the worst
ill worse the worst
much more the most
many more the most
little less (lesser) the least
Within the irregular adjectives there are some that have double forms of
345 comparison:
 OLD - older – the oldest (for people and things)
- elder (used only attributively) – the eldest (for the members of the
same family)
e.g.: Our house is older than theirs.
350 My elder brother is a singer.

LATE - later – the latest (the most recent)


- latter (the second of two – opposite of former) – the last (the final)
e.g.: Have you read the latest edition of the last play by Shakespeare?
355
 FAR - farther – the farthest (usually for space)
- further – the furthest (for space and time)
e.g.: Leeds is ten miles farther / further.

14
Cocu Iulia Veronica Unit 6 – Programming languages

EXERCISES
360

I. Put the adjective in brackets in the correct position:


1. a little town (old, lovely)
2. a new sweater (green, nice)
3. an old mansion (beautiful)
365 4. a plastic bag (black, small)
5. an American film (old)
6. a metal box (black, small)
7. an old painting (interesting, French)
8. a red car (old, little)
370 9. a beautiful table (wooden, round)
10. a cotton shirt (white, old)
11. a brown coat (long, leather)
12. a chocolate bar (big, new)
13. an English castle (small, old)
375 14. a summer dress (cotton, short, white and blue)
15. a small cottage (stone-built, old)

II. Put the adjectives in brackets in the correct form:


1. Bucharest is (far) from Madrid than Paris is.
380 2. She was very kind and gave me some (far) information about that man.
3. Lucy and Peter are in their room: the (fore) is reading, the (late) is watching T.V.
4. My (old) sister works in one of the (old) schools in our town.
5. These books are not (expensive) as the other ones.
6. Your homework is (bad) than hers.
385 7. His car is (good) than mine.
8. I am sure that you will finally find a (good) solution.
9. This hotel manager was the (polite) we had ever met.
10. Yesterday’s weather was (bad) than today’s.

30 15
Cocu Iulia Veronica Unit 6 – Programming languages

11. The inn is the (old) building in the village.


390 12. Sir Winston Churchill was the (famous) Englishman in World War II.
13. “The more, the (merry)”, says an English proverb.
14. She is one of the (intelligent) girls I have ever met.
15. There were two roads leading to the monastery, the narrower road being the (short)
one.
395
III. Continue sentences 1-10 by using a comparative so that they make
sense:
1. The sooner …………
2. The warmer the weather …………
400 3. The bigger the children …………
4. The harder our work is …………
5. The richer he was …………
6. The more she has …………
7. The shorter the nights …………
405 8. The earlier you leave …………
9. The more …………
10. The higher the prices …………

IV. Fill in with the correct adjectives. There are six pairs of adjectives that
410 you must guess so that you fill in the blanks correctly:
1. He works very hard as a computer programmer. It’s not ………… that he’s always
tired.
2. I’ve got nothing to do. I’m ………….
3. The room hadn’t been cleaned for ages. It was really ………….
415 4. I seldom visit art galleries. I’m not particularly ………… in art.
5. The lecture was …………. I fell asleep.
6. The teacher’s explanation was …………. Most of the students didn’t understand it.
7. I’ve been working very hard all day and now I’m ………….

16
Cocu Iulia Veronica Unit 6 – Programming languages

8. I was very ………… to find out that Joan had passed the exam because she had hardly
420 studied anything.
9. She is a very difficult person to follow because she talks a lot. She is a very …………
person.
10. I was totally ………… when I heard the truth about Michael.
11. Julia is a very ………… person. She knows a lot, she has traveled a lot and she has
425 done a lot of different things.
12. I didn’t understand anything out of the lecture on XML. I am really ………… about
this topic.

V. Choose the correct form of the adjectives:


430  Historic
 Historical
a. At the meeting of our local ………… society there will be a talk on France in the 19th
century.
b. Today we have gained our independence and our liberty. It is a ………… day for our
435 country.
c. She likes ………… novels, especially romances set in the 16th and 17th centuries.
d. In 1945 there was a ………… meeting of world leaders which changed the course of
world events.
 Exhausting
440  Exhaustive
a. ………… tests were carried out to discover the cause of the plane engine failure.
b. The older members of the group found the long journey quite ………….
c. He never stops talking. He’s an ………… person to be with.
d. The police carried out an ………… investigation, but the missing woman was never
445 found.
 Economic
 Economical
a. The ……….. picture looks pretty depressing for the next few quarters.
b. It’s ………… to use solar energy.

17
35 Cocu Iulia Veronica Unit 6 – Programming languages

450  Lyric
 Lyrical
a. ………… poetry reading can help you find the music of everyday language.
b. His ………… approach to scientific writing helped to popularize the subject.

18

You might also like