Lekcja 8. Programming languages. Part 1

26 września 2016
1 gwiadka2 gwiazdki3 gwiazdki4 gwiazdki5 gwiazdek

Obejrzyj poniższy film. Nie przejmuj się, jeśli nie wszystko w nim zrozumiesz. Najważniejsze jest to, aby obejrzeć go przed przeczytaniem tekstu.

Odpowiedz na poniższe pytania.

  1. What are assembly languages sometimes called?
  2. What is the advantage of low-level languages?
  3. How are high-level programming languages different from low-level languages?
  4. What programming languages were used in the first 30 years of programming?
  5. What type of languages is mostly used nowadays?
  6. What is the conversion of high-level code into machine code called?
  7. Are general ideas of compilation and assembly similar or very different?
  8. What is needed to invoke system calls?
  9. What is an alternative to compilation?
  10. What is bytecode?
  11. What is a virtual machnie?
  12. How are machnine instructions executed?
  13. What does the process of interpretation look like?
  14. What is JIT?

A programming language is a formal language primarily designed to instruct a computer to perform some tasks. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms. They also serve as a framework within which a programmer organizes his ideas about processes.

The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). The syntax refers to the structure or form of programs. The semantics describes the meaning given to combinations of symbols. Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference.

High-level language refers to the higher level of abstraction from machine language. Rather than dealing with registers, memory addresses and call stacks, high-level languages deal with variables, arrays, objects, complex arithmetic or Boolean expressions, subroutines and functions, loops, threads, locks, and other abstract computer science concepts, with a focus on usability over optimal program efficiency. Unlike low-level assembly languages, high-level languages have few, if any, language elements that translate directly into a machine’s native opcodes.

The terms high-level and low-level are inherently relative. Some decades ago, the C language, and similar languages, were most often considered „high-level”, as it supported concepts such as expression evaluation, parametrized recursive functions, and data types and structures, while assembly language was considered "low-level". Today, many programmers might refer to C as low-level, as it lacks a large runtime system (no garbage collection, etc.), basically supports only scalar operations, and provides direct memory addressing.

Assembly language may itself be regarded as a higher level (but often still one-to-one if used without macros) representation of machine code, as it supports concepts such as constants and (limited) expressions, sometimes even variables, procedures, and data structures. Machine code, in its turn, is inherently at a slightly higher level than the microcode or micro-operations used internally in many processors.

Vocabulary

array
tablica
assembly language
język asemblera
basically supports only scalar operations
zasadniczo wykonuje tylko działania skalarne
Boolean expression
wyrażenie logiczne, wyrażenie Boole’owskie
call stack
stos wywołań
combination of symbols
kombinacja symboli
complex arithmetic
arytmetyka liczb zespolonych
computer science concepts
pojęcia z dziedziny informatyki
constant
stała
data structure
struktura danych
data type
typ danych
designed
to służący do; zaprojektowany tak, aby
direct memory addressing
bezpośrednie adresowanie pamięci
dominant implementation
dominująca implementacja
expression evaluation
obliczanie wartości wyrażeń
few, if any
niewiele, jeśli w ogóle
formal language
język formalny
framework
system szkieletowy, szkielet, framework
function
funkcja
garbage collection
usuwanie nieużywanych obiektów, sprzątanie śmieci
high-level language
język wysokiego poziomu
idea
pomysł, myśl
in its turn
z kolei
inherently
naturalnie, z natury
internally
wewnętrznie
ISO Standard
standard ISO
level of abstraction
poziom abstrakcji
lock
blokada
loop
pętla
low-level language
język niskopoziomowy
machine code
kod maszynowy
machine language
język maszynowy
macro
makro
memory address
adres w pamięci
microcode
mikrokod
micro-operation
mikrooperacja
native opcode
macierzysty kod operacyjny
object
obiekt
one-to-one
jeden do jednego
parametrized recursive function
parametryzowana funkcja rekurencyjna
procedures
procedura
process
proces
processor
procesor
program efficiency
wydajność i efektywność programu
programming language
język programowania
rather than
raczej niż
reference implementation
implementacja wzorowa
reference
wzór
register
rejestr
representation
reprezentacja
runtime system
system wykonawczy
semantics
semantyka
slightly
nieznacznie, nieco
some decades ago
kilkadziesiąt lat temu
specification document
dokumentacja techniczna, specyfikacja
subroutine
podprocedura
syntax
składnia
the description of sth…
opis czegoś…
thread
wątek
to be regarded as…
być uważanym za…
to control the behavior of a machine
sterować działaniem komputera
to express algorithms
wyrażać algorytmy
to lack
nie mieć
to perform some tasks
wykonywać pewne zadania
to serve as
służyć jako
to support
obsługiwać
to translate directly into
przekładać bezpośrednio na
unlike
w odróżniu od
usability
użyteczność
variable
zmienna
while
podczas

Exercises

Exercise 1. Match the words in column A with their partners in column B.

formaladdress
calltype
combination ofcode
dealstandard
ISOaddressing
Booleanstack
datawith
expresssymbols
runtimescience
machineimplementation
memorysystem
memoryabstraction
high level ofexpression
computerlanguage
dominantalgorithm

Exercise 2. Answer the following questions.

  1. What is a programming language?
  2. What can programming languages be used to?
  3. What is usually used to describe a programming language?
  4. What is syntax of a programming language?
  5. What is semantics of a programming language?
  6. How are programming languages defined?
  7. What is high-level programming language?
  8. What is low-level programming language?
  9. How are the terms high-level and low-level related?
  10. Is the C programming language high-level or low-level?
  11. Is assembly language high-level or low-level?

Exercise 3. Complete the sentences following the example. Use the construction "the… of a…".

…is usually split into syntax and semantics. -> The description of a programming language is usually split into syntax and semantics.

  1. …refers to the structure or form of programs.
  2. … describes the meaning given to combinations of symbols.
  3. …defines a programming language.
  4. …is treated as a reference.
  5. Programs can be used to control…
  6. …describes the possible combinations of symbols that form a syntactically correct program.

Exercise 4. Write down first parts of the sentences created above (the ones you added) and complete them orally without looking at the text. Try as many times as is necessary to easily complete the sentences.

Exercise 5. Write sentences using the expression "rather than" and the words and expressions provided in the two boxes, following the example. Write as many sentences as is necessary to use each item from every box.

registers, memory addresses, call stacks

variables, arrays, objects, complex arithmetic, Boolean expressions, subroutines, functions, loops, threads, locks, abstract concepts

Example: Rather than dealing with memory addresses, high-level languages deal with variables.

Exercise 6. Translate sentences from the previous exercise into Polish.

Exercise 7. Write at least 10 sentences beginning with "Unlike low-level languages, high-level languages…" using the information from exercise 5, following the example.

Example:Unlike low-level assembly languages, high-level languages use variables.

Exercise 8. Translate sentences from the previous exercise into Polish.

Exercise 9. Change the sentences orally according to the example.

Example:In C, you can use expression evaluation. -> The C programming language supports expression evaluation.

  1. In C, you can use parametrized functions
  2. In C, you can use recursive functions.
  3. In C, you can use data structures.
  4. In C, you can use data types.
  5. In C, you can use scalar operations.
  6. In C, you can use direct memory addressing.
  7. In C, you can use constants.
  8. In C, you can use macros.
  9. In C, you can use variables.
  10. In C, you can use arrays.
  11. In C, you can use Boolean expressions.
  12. In C, you can use subroutines.
  13. In C, you can use functions.
  14. In C, you can use loops.
  15. In C, you can use arithmetic operations.
  16. In C, you can use the addition operator.
  17. In C, you can use the multiplication operator.
  18. In C, you can use the division operator.
  19. In C, you can use the subtraction operator.
  20. In C, you can use the modulo operator.

Exercise 10. Complete the sentences replacing the adjectives provided with adverbs.

  1. High-level languages have few elements that translate (direct) into a machine’s native opcodes.
  2. The terms high-level and low-level are (inherent) relative.
  3. Machine code is (inherent) at a slightly higher level than the microcode.
  4. Micro-operations are used (internal) in many processors.
  5. The description of a programming language is (usual) split into two components.
  6. A programming language is a formal language (primary) designed to instruct a computer to perform some tasks.

Na podstawie powyższych przykładów spróbuj sformułować kilka zasad tworzenia przysłówków z przymiotników, a potem zweryfikuj te zasady w tych książkach (albo innych).

Exercise 11. Translate the text into Polish.

Exercise 12. Summarize the text orally using questions from exercise 2 as a plan. Practice until you can say the summary without looking at the text.

Źródła:

Treść tej strony dostępna jest na zasadach licencji CC BY 3.0

Zobacz również:

Autor: Łukasz Piwko

Tłumacz angielskiej i francuskiej literatury specjalistycznej, nauczyciel, wykładowca i maniak technologii programistycznych. Interesuje go wszystko, co związane z programowaniem i tłumaczeniem tekstów na ten temat na język polski. W wolnym czasie czyta Balzaka, słucha muzyki i trenuje karate.

Dyskusja

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *