Python Notes 1
Python Notes 1
What is a programming
language?--------------------------------------------------------------------------
-----------------------------------------------------------------------------------
A language is a means (and a tool) for expressing and recording thoughts.
Another language you use each day is your mother tongue, which you use to manifest
your will and to ponder reality.
Computers have their own language, too, called machine language, which is very
rudimentary.
All current machine languages are developed by humans.
A computer, even the most technically sophisticated, is devoid of even a trace of
intelligence it responds only to a predetermined set of known commands.
The commands it recognizes are very simple.
A complete set of known commands is called an instruction list, sometimes
abbreviated to IL.
What makes a
language?--------------------------------------------------------------------------
-----------------------------------------------------------------------------------
---------
We can say that each language (machine or natural), consists of the following
elements.
A alpabet - is a set of symbols used to build words of a certain language.
A lexis - is a dictionary a set of words the language offers its users.
A syntax - is a set of rules formal or informal, used to determine if a certain
string of words forms a valid sentence.
Sematicss - is a set of rules determining if a certain phrase makes sense.
Interpretation Vs
Compilation?-----------------------------------------------------------------------
-----------------------------------------------------------------------------------
----
Computer programming is the act of composing the selected programming language's
elements in the order that will cause the desired effect.
The effect could be different in every specific case and it's up to the
programmer's imagination, knowledge and experience.
The script has to make sense alphabetically, lexically, syntactically and
sematically.
Unfortunately, a programmer can also make mistakes with each of the above four
senses.
Each of them can cause the program to become completely useless.
Let's assume that you've successfully written a program.
How do we persuade the computer to execute it; You have to render your program into
machine language.
There are two different ways of transforming a program from a high-level
programming language into machine language.
Compilation – the source program is translated once (however, this act must be
repeated each time you modify the source code) by getting a file containing the
machine code.
Now you can distribute the file worldwide; the program that performs this
translation is called a compiler or translator.
Interpretation – you (or any user of the code) can translate the source program
each time it has to be run.
The program performing this kind of transformation is called an interpreter, as it
interprets the code every time it is intended to be executed.
It also means that you cannot just distribute the source code as-is, because the
end-user also needs the interpreter to execute it.
Due to some very fundamental reasons, a particular high-level programming language
is designed to fall into one of these two categories.
There are very few languages that can be both compiled and interpreted.