myTectra Tutorials | Python | Part 3
by Venkatesan, on Sep 16, 2019 3:40:37 PM
In this python tutorial part 3, we discuss like what happens before running the program. In fact, how do we write these programs, what makes so attractive to write programs that can run on machine, how compiler works, how interpreter works, in which form computer’s memory can understand, how static type language differ from dynamic type language, weather the programming language is a compiled language or interpreted language.
Consider for example, when he/she writes the codes using any programming languages(python, java, C, C++) in any tools can be visual studio code, sublime text, any other text editor tools. Any text either containing script or code of program, after the completion of program or code, want to start running your program, usually ends up with a specific programming language with their respective extensions such as, in the case of python would be “.py” that is "filename.py" for other languages can be .java, .c, .cpp
The program (source code) must be translated into machine language so that the computer can understand and execute the program. The computer’s memory can read and understand in a binary format and then load it into memory (RAM) and run it.
The translation of computer code which is written in one programming language into another language, we called it as Compiler. The name Compiler is primarily used for programs that translate source code from a high-level programming language to a lower level language to create an executable program. Linker, combines this object file with other previously compiled object files (in particular run-time modules) to create an executable file. In other words, a linker is a computer program that takes one or more object files generated by a compiler and combines them into one executable program/file.
In the case of python, it is totally different from other languages, because it does not use compilers, linkers, loaders. Which converts the source code into machine language at the same time the program runs, we called it as Interpreter. It takes one line of a code at a time and then moves into next instruction/ next line of the code and then finally executes the code.
Major difference between the compiler and interpreter is, compilations happens very fast and time it takes to finish its executions with much faster in the case of compiler program than in the case of interpreter program, because in interpreter language, its going line by line, means reads one line at a time and then executes the final program.
In dynamic type programming, languages are typed in a dynamically manner, when the majority of its type checking is performed at run-time as opposed to at compile time. In dynamic typing, types are associated with values not variables. Whereas, in static type programming, language is said to use static typing when type checking is performed during compile-time as opposed to run-time. In static typing, types are associated with variables not values.
Go through the entire video and shoot your queries in the comments section and please do not forget to subscribe the channel for more tutorials and technology updates.