r/learnpython • • Jan 05 '24

Why are interpreters required for programming ?

i'm trying to learn python ....i'm hearing a lot of stuff about interpreters....just wanna know what are they for..why are they required...can i learn python without interpreter...without vs code or py charm

Cuz i wrote some codes in python and it worked without connecting python to interpreter ....why is an interpreter necessary

Plz enlighten me

14 Upvotes

71 comments sorted by

View all comments

4

u/[deleted] Jan 05 '24

There are two types of programming language: compiled and interpreted. A compiler takes your source code and converts it into machine code which you can then run without the compiler or the source code. An interpreted (or script) language is interpreted by an interpreter and so this and the source code are required at runtime. Compiled languages are faster and safer and are what most commercial software is written in. Interpreted languages are good for prototyping I.e. throwing things together quickly but you don’t normally distribute these because they’re inefficient, more likely to have runtime bugs, require a runtime and are easily copied / reversed / subverted. Python is usually an interpreted language but there are compilers available like cython. Hope that helps!