Module 1 Flashcards
Language
a means for expressing and recording thoughts
Machine language
very rudimentary computer language
binary language (0s and 1s)
it is the language that computers understand at their core
Natural language
languages that develop organically, naturally
human language
What are the 4 parts of a language?
alphabet
lexis
syntax
semantics
what is a language’s alphabet?
a set of symbols used to build words of a certain language
what is a language’s lexis?
a set of words the language offers its users
a dictionary
what is a language’s syntax?
a set of rules used to determine if a certain string of words forms a valid sentence
what is a language’s semantics?
a set of rules determining if a certain phrase makes sense
instruction list
complete list of known commands for a computer
alphabet of a machine language
the computer’s mother tongue
these are sets of symbols that we use to give commands to a computer (through a high-level language like Python)
High level programming language
java, python, javascript, c#, etc.
a programming language designed to be easier for humans to understand and write, using syntax closer to natural language, rather than the low-level machine code of a computer
source code
a program written in a high-level programming language
source file
the file containing the source code
in other words a file containing a program written in high-level programming language
compilation
the source program is translated to machine language
This action must be repeated each time you modify the source code
This means the program can be distributed as an executable file to be run on other computers
C#, C++, Java
interpretation
the source code is read into machine code each time the program is run
the downside is that whoever is running the program must have the interpreter installed to run it
Python, JavaScript
computer program is actually just a …
pure text file (no decorations, like fonts colors embedded images, or other media)
interpreted languages are also known as
scripting languages
Python creator
Guido van Rossum
Guido van Rossum
the creator of python
CPython
The default implementation of the Python language – the one that is downloaded from Python.org
The canonical version
written and maintained by the Python Software Institute (PSF) of which, Guido is president
Written in the C programing language
Cython
translates python code into C
What does the interpreter do?
It directly executes instructions written in a programming language.
It reads the high level programming language and translated it into low level machine code
Specifically, it reads the source code from left to right top to bottom as is common in western culture and uncovers errors as it goes.
the first error it encounters, it finishes its interpretation of the code
Advantages of compilation
execution of the translated code (the code that is translated to machine language) is generally faster
only the user (the programmer) needs to have the compiler. The end-user gets the translated file
The translated code is stored as machine language, and so it is very hard to understand it, so programming tricks can remain hidden
Disadvantages of Compilation
The complication is a time consuming process
you have to have as many compilers as hardware platforms you want your code to run on
Compiler catches only syntax and semantic errors while compiling. So other errors may not be found until runtime and may be hard to race at that point