Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Neagululiaveronica

(Jnit 5 _ programming languages

Unit 5 Programming Languages


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 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
execution

10

15

20

25

30

' 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 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 "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 example, COBOL is still strong in the corporate data center, often on iarge 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 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-pu1pose, concurrent, class-based, and object-oriented, and is specifically designed to have as few implementation 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. Progratnming languages have been classified into several programming language
generations.

35

40 that:

The distinguishing properties of the first generation programming languages are

Neagu Iulia Veronica

Unit 5 * Programming languages

r
45

The code can be read and written by a prograrnmer. To run on a computer

it ' '
50

must be converted into a machine readable form, a process called

assembly

The language
machines

is specific to a particular

target machine

or family of

Some assembler languages provide

macro-facility enabling the

development of complex patterns of machine instructions

55

Second generation programming languages, originally just called high level programming languages were created to simplify the burden of programming by making 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 soflwareThe third generation languages emphasized:

'
60

Expression

of an algorithm in a way that was independent of

the

65

70

The rise of strong typing (used to describe those situations where programming languages specify one or more restrictions on how operations involving values having different data tlpes can be intermixed) ' Block structures (blocks which can be nested to any depth) and automated management of storage with a stack r Broad-spectrum applicability and greatly extended functionality "Generational" classification of these languages was abandoned after the third 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 COBOL2002, and new languages like Java have emerged in that "generation" as well. But significantly different languages and systems were already being called fourth and fifth generation programming languages by language communities with special interests. The tnanner 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

characteristics of the machine on which the algorithm would run

'

leading away from the mainstream.


75

Neagu Iulia Veronica

Unit 5 - Programming languages

a) Give synonyms
(1.

for

the

following words from the text:

Specifications (1. 2); traits (1. 3); chained (r.21); embedded (1.27); query (1. 33); converred a3);spectrum (1.64);' emerged (1.68);mainstream (1.74)

b) llthat do the following abbreviations stand for? COBOL; FORTRAN; PHP, SQL; RDBMS; LISP; CLOS; PASCAL; BASIC;
DYNAMO;

II. Explain

the

following mathematical concepts in English:

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

III.

Match the following programming languages with their dejinition:


thefollowing questions:

a) Ansver

- as compared to hardware? 2. \\'hat 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?
b) Conplete
the

1. What is software

Are languages which are close to human language. 3. ............ such as Excel 4.0 or Multiplan are some of the most widely-used . 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.

New 2. .....
l.

following sentences (you may use more than one word per blank space):

.. . . are released every time there is an improvement on the hardware side.

IV. Mstch thefollowing programming languages with their deJinition:


l. ActionScript;2. C#;3. C++; 4. Delphi; 5. Erlang; 6. FoxPro2; 7 . Iava;8. LabVIEW; 9. Lisp; 10. MATLAB; 11. PHP; 12. PEARL; 13. Unix shell; 14. Visual Basic; 15. XML 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

NeagululiaYeronica
c. a

Unit 5 * Programming languages

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 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; software to web applications

it is widely used from application

programming;

computer programming language designed for multitasking and real-time it supports both fixed-point and floating-point numeric values, character and character string data as well as bit values; it also provides facilities for structures and

f. a

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 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 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 interyreter 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
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 n. a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language; this language began as enhancements to C, first adding classes, then virhral functions, operator overloading, multiple inheritance, templates, and exception handling
among other features

it allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces and interfacing with programs written in other languages, including C, C++ and Fortran.
o.
V.

Fill in the blanks of thefollowing text about Linux:

ln 1992, a talented prografilmer named Linus Torvalds took a small educational 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)
began

.... it rn.as adopted with great enthusiasm by other prograrnmers on the Internet, it 3) .... like wildfire. It soon became the fastest growing version of Unix,

mainly because it was 4) ....

Neagu lulia Veronica

Unit 5 - Programming languages

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 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 fuchard Stallman in the 1980's. Stallman was a talented prograrnmer, 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 {INIX-like operating system called GNU.

VI. Translute the following txto excerpts into English:


a) Java este un limbaj de programare de nivel inalt, dezvoltat de JavaSoft, companie in cadrul firmei Sun Microsystems. Dintre caracteristicile principale ale limbajului amintim: o simplitate - Java este uqor de invdfat, caracteristicile complicate (supraincircarea operatorilor, mogtenirea multipld, gabloane) intdlnite in alte limbaje de programare sunt eliminate. o robustete, elimina sursele frecvente de erori ce apar in programare prin eliminarea pointerilor, administrarea automatd a memoriei qi eliminarea fisurilor de memorie printr-o procedurd de colectare a 'gunoiului' care rul.eazd in fundal. Un program Java care a trecut de compilare are proprietatea ca la execulie sd nu "cadi sistemul". . complet orientat pe obiecte - elimind complet stilul de programare procedural; se bazeazd pe incapsulare, mogtenire, polimorfi srn . ufurinlS in ceea ce privegte programarea in refea . securitate, este cel mai sigur limbaj de programare disponibil in acest moment, asigurdnd mecanisme stricte de securitate a programelor concretizate prin: verificarea dinamici a codului pentru detectarea secvenlelor periculoase, impunerea unor reguli stricte pentru rularea programelor lansate pe calculatoare aflate la distanti etc o este neutru din punct de vedere arhitectural e porlabilitate, cu alte cuvinte Java este un limbaj independent de platforma de lucru, aceeagi aplicalie ruldnd, Iiri nicio modificare, pe sisteme diferite cum ar fi Windows, UNIX sau Macintosh, lucru care aduce economii substantiale firmelor care dezvoltd aplicatii pentru Internet. Sloganul debazd, este: "Write once, run anywhere" In func{ie de modul de executie al programelor, limbajele de programare se impart in doud categorii:

Ncasu Iulia Veronica

Unil 5 - Programming languages

o o

interpretate: instruc{iunile sunt citite linie cu linie de un program numit interpretor gi traduse in instructiuni maginS; avantaj: simplitate; dezavantaj: vitezl de
executie redusa;

compilate: codul sursd al programelor este transformat de compilator intr-un cod ce poate fi executat direct de procesor; avantaj: execufie rapida; dezavantaj: lipsa portabilitdlii, codul compilat intr-un format de nivel scdzut nu poate fi rulat decdt pe platforma pe care a fost compilat. Programele Java sunt atdt interpretate cdt gi compilate. Codul de octeli este diferit de codul maqinS. Codul maqind este reprezentat de o succesiune de 0 si 1; codurile de octe{i sunt seturi de instructiuni care seamdni cu codul scris in limbaj de asamblare. Codul magind este executat direct de cdtre procesor gi poate fi folosit numai pe platforma pe care a fost creat; codul de octe{i este interpretat de mediul Java qi de aceea poate fi rulat pe orice platformd care foloseqte mediul de execufie
Java.

b) ,,Nivelul"unui limbaj este apreciat prin pozitia pe care o ocupd pe scara constituiti de limbajul recunoscut de microprocesor (limbaj maqini) qi limbajul nafural al programatorului (limba romdnd, limba englezd etc.). Un limbaj de nivel scazut este foarte apropiat de magin6, el manipuleazd cu elemente de nivel hardware, fizic, cum ar fi: registru, microprocesor, loca{ie de memorie, port de intrareiiegire etc. Un limbaj de nivel inalt sau foarte inalt manipuleazd cu concepte apropiate de limbajul natural, concepte de nivel logic, cum ar fi: coleclie de date, nume de operalie (sort, writeln, open), variabile, constante (asemindtoare ca infeles cu cele din
matematicd).

Cu ajutorul unui limbaj de nivel inalt programatorul se face mult mai uqor infeles citre calculator . Uneori o singurd linie de program scrisd cu un astfel de lirnbaj poate echivala cu sute de linii de program scrise in limbaj maqind. Deci din punct de vedere al reducerii timpului de realizarc al unui program gi al siguran(ei in funcfionare (absenla erorilor de programare) este de preferat un limbaj de nivel cdt mai ridicat (inalt sau foarte inalt). In schimb, pe mdsurd ce limbajul are un nivel mai ridicat execufia programului conceput cu ajutorul siu va fi mai lenti, dec6t a unui program ce realizeazd aceleagi opera{ii dar este scris in limbaj de asamblare. O altd diferen{d esen{iald intre cele doud tipuri de limbaje o reprezintd portabilitatea, adici posibilitatea transferdrii programelor pe un alt tip de magind dec6t 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 magind trebuie rescrise integral pentru noul tip de maginS, folosind un nou set de instruc{iuni - care, de obicei, diferi foarte mult. Lucrurile stau altfel cu programele concepute cu ajutorul unui limbaj de nivel inalt, deoarece acestea sunt detagate de magind. Intre un astfel de program qi calculator se interpune compilatorul (sau interpretorul) care rezolvi corect transformarea figierului-sursi in figier-executabil. Limbaje procedurale - neprocedurale Cele doud tipuri de limbaje, procedurale gi neprocedurale, se diferenliazd prin nivelul de organizare (structurare) a unui program Lirnbajele neprocedurale sunt concepute pentru a g6ndi un program la nivel de instruc{iune, pe cdnd cele procedurale, obligd programatorul sd conceapd programe la nivel de bloc. Intr-un limbaj procedural
de

Neasu Iulia Veronica

Unit 5 - Progrttmming languages

(numit gi limbaj structurat), programele sunt scrise instruc{iune cu instrucfiune, dar ele sunt organizate logic in blocuri (grupuri de instruc{iuni) ce realizeazd o acliune bine determinatd. ln general un bloc are un punct de intrare gi un punct de ieqire * nu mai multe. Un limbaj procedural oferb posibilitatea utiliz[rii unui nivel ridicat de concepere a unui program gi duce la realizarea de programe coerente qi protejate la erori. Prin contrast, limbajele neprocedurale nu favorizeazd programatorul in a se desprinde de nivelul ,,instruc{iune" gi duc deseori la programe greu de controlat - mai ales in cazul programelor de dimensiuni mari. Limbajele neprocedurale sunt inci preferate de unii utilizatori datoritA timpului foarte scurl cdt decurge invdlarea qi utilizarea lor. Limbaje orientate Din punctul de vedere al aplicabilitdlii unui limbaj, limbajele pot fi orientate pe o anumiti problemd sau concepute pentru solufionarea oricdrui tip de problemd - limbaje de uz general sau altfel spus, neorientate pe o problemd. Limbajele orientate prezintd un grad inalt de specificitate pe cdnd un limbaj neorientat reprezintd un cadru general ce permite introducerea de cdtre utilizator a conceptelor gi prelucririlor dorite. Deci, diferenta esentialS dintre cele doud tipuri de limbaje o constituie nivelul concepfual definit. Cele specializate poseda deja integral suportul necesar gi permit programatorului sd se concentreze la ansamblul problemei, pe cdnd cele nespecializate lasl in sarcina programatorului manevrarea nivelelor inferioare ale problemei. Limbaje concurente Un limbaj concurent permite definirea de procese (prelucrari) paralele, execulia sa f,rind ramificatd la un anumit moment de timp. Prin contrast, limbajele neconcurente (majoritatea limbajelor) au o desfdgurare liniard, fiind activ un singur proces la un moment dat. Procesele concurente presupun in mod obligatoriu un sistem multi-tasking ce poate gestiona mai multe ,,sarcini" la un moment dat. Limbaje de nivel scizut Aceasth categorie de limbaje are -rin reprezentani autoritar ;i anuine: iirrr'oajui de asamblare. Diferenlierile care se pot face pentru limbajele de nivel scizut sunt urmitoarele: a) - dupd tipul de maqind ; Regulile respectate de versiunile limbajului de asamblare sunt: - o noui versiune o include complet pe cea anterioard , - versiunea noud oferd func{ii suplimentare gi le realizeazd pe cele vechi mai rapid . b) - dupi mediul de programare oferit. Aspectul unui limbaj poate fi schimbat radical de mediul de programare oferit. Pentru limbajul de asamblare existd mai multe implementiri disponibile, incepdnd cu pachete ce opereazd in mod linie qi culmindnd cu medii integrate in care toate opera{iile se pot declanga de la un acelagi pupitru de comandd. Nu sunt luate in considerare decdt aceste medii integrate( denumite generic medii Turbo), dintre care se detageazd Turbo Asamblorul firmei Borland TASM.

Neaeu lulia Veronica

Unit

Programmiug lunguages

GRAMMAR SPOTLIGHT Adverbs

Adverbs sre those parts of speech that modify or add to the meaning of verbs, adjectives, other adverbs, prepositional phrases, complete sentences or even nouns

modifying:

o . . . o o

A verb: Kerry sung that song beautifullv. An adjective: The problem wus extre@-d![fu!! An adverb: Mary understood us verv well. A prepositional phrase: Her watch wus completelv out of order. A complete sentence: Strangelv enouglt, she left without saying a word. A noun: The girl over there is my sister.

Forms of adt erbs

Compound words: l. made up of two dffirent parts of speech: abroad, anywhere 2. made ap of an adjective/noun * tlre suffm -ly: badly, hoarly a. udjectives ending in -e, retain e and then -ly is added: extreme - extremely; nice - nicely b. adjectives ending in -le drop -e and add -y in the udverb: capable - capably; gentle - gently c. adjectives ending in -l preceded by a vowel, retuin I and add ly: final - jinally; usual - usually d. adjectives ending in -ll just add -y: fall - folly; dull - dully e, adjectives ending in -y chonge y to I and then add -11,; sssyeasily; hoppy - happily Sometimes, the -ly adverbs have s different meaning from tlteir corresponding
adjectives.

. .

Individual words: here, soon, then, when

CLOSE

e.g.: He came g!ryto getting 100%. This girl resembles her mother closelv.

"quite", "near"; CLOSELY

descriptive ase

DEEP - 'To, down" or "into" (it may be used either literally or figuratively); DEEPLY - "very greatly" (ased metaphorically of degree) e.g.: He went deep into the woods.
She felt his betrayal d99pb. FREE - "ruithoat payment"l FREELY - "in a free manner" or "l[/illingly", "readily" e.g.: It cost me notling. It was tee. I feel that I can speak fuly. (without hiding anything; openly) o HARD - ux)ith great effirt/great force", "tvith great attention"l HARDLY " alnt o st no/n ot/no n e./nev e r e tc. " r "p r o b a bl1, no t "

Neasu Iulia Veronica

Unit 5 - Programming languages

e.g.: You huve worked very hsrd. IAe can hardh, walk. . HIGH - "et o great distance from ground--level, sea-Ievel etc."; HIGHLY "very muchttr "utitlx approvalt' e.g.: The plane was flying hieh in the sky. He speaks very hishlv of you. o JUST - "exactly/precisely", "very recently"; JUSTLY - uin a fair or reasonable

menner" e.g,: Our friends have iust arrived. She was quite iUgllyblamedfor the accident. . LATE - "after the expected or usual time", LATELY - "recently"
e.g.: He arrived late for the interview. Have you met them latelt?

'far into the day or night"l

RIGHT

"exactly", "immediately", "completely", "conectly"l RIGHTLI'-

e.g.:

"accurately" I waitedfor her 1lgfuhere. They riehtlv assumed that he was guilty. . SHARP - "punctually", "abruptly", "quickly"l SHARPLY mannerttr " distinctly t' e.g.: l(e left the club at 11 o'clock sharu. Opinions are sharplv divided on this mstter.
Tvpes of adverhs

- uin a sharp

o c . .

Adverbs Adverbs Adverbs Adverbs

of manner

of place of time ofdegree

Iruegular comDsrison of adverbs

well
badly

better
worse

best

worst

.fo,

fa,
The position of adverbs

farther further

furtltest farthest

lVhen
should be:

sentence contains more than one

kind of adverb, the usaal order


time

Manner

Place

Neagu Iulia Veronica

Unit 5 - Programming languages

EXERCISES

I. Replace each adjective with an adverb: e.g.: boastful - boastfully ... (graceful) ballerina moved around very .. 2.David .... (easy) won the first race. 3. I don't know . ... (exact) how much money he makes. 4.I .. . . (honest) don't know what John told his sister. .. .. (bad) during the concert. 5. The singer of the band sang very ... (loud) 6. My friend Tom always speaks very .. ... .. (good) 7. You speak English very 8. These days I am so busy at work that I . . . ...... .. . (rare) have time to go out. .. (lazy) 9. Sometimes I like to spend the day just lying in bed . .. (safe) got ..... home 10. The police officer made sure that she
1. The

II. Each sentence has an underlined word. Your task is to decide whether the word is an
adverb or an adjective:
1. Be

careful! The iron is very hot.

2. A microwave can cook food fast. 3. June sang very loudly.

4. This bacon is lovely.


5. Joe dresses very infonnallv.

6. She's a very strange woman. J.I'm free tomorrow. Shall we meet at 5? 8. Jane is very helpful if you have a problem with your computer. 9. Sam walks very shakily, because he's getting old. l0.l get up early every morning. I 1. It is a fast car. 12. He is a better swimmer than me. 13. He reached deep into his pockets. 14. He swims better than me. 15. He works hard. 16. We found the people friendly. 17. He drove some of them mad. 18. This made everyone late. 19. We shall leave the room empty. 20. He turned the comer well.

III. For each


choices below:

sentence, choose the best word or phrase to complete the gap

from

the

.. .. a wonderful time. l. Thanks for the weekend. We had .. gorgeous. 2.The weather at the beach on Saturday was .. .... marvelous. 3. Try that restaurant. The food is

10

Neasu Iulia Veronica

Unit 5 - Programming languages

4. I was ... annoyed when he said that. 5. He told me alan .... unbelievable story.

6. You probably feel quite cold today but actually, fifteen degrees England in October. 7. What they told the police was .. .. untrue. 8. Both sisters were . ... brilliant sfudents.
9. That's a wonderful ring. It must have been 10. I need to sit by the fire. I'm freezing!

is ........... hot for

... expensive.

L That cheap umbrella I bought was .. .. useless. It broke the frrst time I used it. 12. You're talking .... rubbish! Of course I don't believe you!
I

l. a) so 2. a) such 3. a) such 4. a) much 5. a) completely 6. a) simply 7. a) extremely


8. a) relatively 9. a) really 10. a) rather 1 1) a) very l2) a) rather

b) b) b) b) b)

such

extremely very absolutely extremely b) pretty b) very b) totally b) absolutely


b) wholly b) tully

c) very c) absolutely

d) absolutely
d) awtully

tenibly c) totally
c)

d) simply d) extremely
d) very d) absolutely d)rather

b) extreme

c) c) c) c) c) c) c) c)

nearly completely

totally
almost

d) wholly
d) totally d) very

simply absolutely utterly quite

d) extremely d) absolute

ll

You might also like