How does downloading coding languages actually work? : r/vscode Skip to main content

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores
r/vscode icon
r/vscode icon
Go to vscode
r/vscode

A subreddit for working with Microsoft's Visual Studio Code


Members Online

How does downloading coding languages actually work?

Dependencies for languages, specifically python, and how it actually starts compiling and running

I was downloading Python today and was wondering the general rules for what is needed to actually make a language work. So I see:

So is "Python 3" a complier or something? What actually is "Python 3" from their website? Is it a compiler? If its just "the language," what actually is that? Obviously, VS Code is just the IDE. But then what is VS Code Python extension? Is that just preparing the IDE for using Python? What would happen if you just get the VS Code Extension and not actually Python 3?

I'm using VSCode for python, and I have to navigate to the directory with my script in it and type "py test.py" to run the program. Does the "Python 3" download add the py command to my terminal? I'm just so lost with the dependencies and how this all works. A broad explanation of how it all works and how it just is now able to compile and run with a "py" command would be awesome. Thanks.

TLDR; What are the needed tools for setting up and using a coding language? Difference between the actual download from their website(Python, Oracle, Jetbrains) and the extension in the IDE?

r/vscode - How does downloading coding languages actually work?
Share
Sort by:
Best
Open comment sort options

Well, different programming languages have different dependencies as you might expect. Some languages are compiled (C, C++, etc...) others are interpreted (Python, JS....). I would start by searching compiled vs interpreted languages and having a look at an article that explains the differences.

VsCode is just a text editor, a program to edit your files, that has some nice features (mostly with extensions) that tweak the functionality to give a better support for Python (in this case, there are extensions for everything). VsCode is built with TypeScript, which is (relatively) good for people to write their own extensions for a better developer experience.

When you download "Python" you do not download the language itself, instead, a bunch of tools that make it easier to work with python files, one of such tools is the interpreter. This is a software that interprets your files and runs them.

Now, how does this tie with your python extension? This extension provides a utility to call the python interpreter with your open file in your VsCode integrated terminal. You can run the interpreter in your own terminal if you want to, and it is usually recommended to have more control over the commands as the interpreter probably has a lot of configuration you can tweak. Your extension handles this for you, looks for the interpreter installed in your machine, and sends whichever file you have open to be run by it and then outputs the result in VsCodes terminal. This is one of the many features the extension provides, it probably provides completions via an LSP and so on....

If you try to use the python extension, without having any tools for python installed well, then you will probably run into multiple errors, the extension most likely looks for local installations of common tools (like the interpreter) and if it cannot find them it will most likely fail.

Some IDEs (I think JetBrains, never used them tho so dont quote me on this) come with tools installed eg: am interpreter. VsCode tries to be as lightweight as possible (electron kekw) and does not offer many features for any particular language out of the box (except TS I guess).

Hope this clears some things up, happy to answer any questions!

u/BootingBot avatar

Electron kekw

More replies

So is "Python 3" a complier or something? What actually is "Python 3" from their website? Is it a compiler? If its just "the language," what actually is that?

First "Python 3" is used in a lot of different ways.

The installer you download from python.org installs the Python Interpreter. It is what allows your computer to run Python code.

Obviously, VS Code is just the IDE.

Technically, no. VS Code is the editor. VS Code is not technically an IDE because it is not integrated.

But then what is VS Code Python extension?

This is the utility that lets VS Code work with Python files. It is the "difference" between VS Code, and editor, and an IDE. It is the "unintegrated" part.

What are the needed tools for setting up and using a coding language?

Depends entirely on the language. The differences are too large to comprehensively explain here. You should start by doing some research on your own into the difference between compiled and interpreted languages.

u/Virinas-code avatar

I'd reccomend checking subs like r/learnpython before, as it isn't related to VSCode itself ;)

u/FlashyEnvironment534 avatar

Got removed from there..not sure why

u/Virinas-code avatar

Well, you're kind of mixing up stuff.

Python itself is a programming language: a reference for a syntax and a standard library. You can view the official documentation at https://docs.python.org.

CPython is the default implementation of Python, it's is an interpreter (https://en.wikipedia.org/wiki/Interpreter_(computing)). It is the python (or py) program you can use to run your code.

VSCode is an IDE: an application to write code in. It has tools to execute your program automatically with CPython.

To run a Python program, you need to install CPython. Check out https://www.python.org/downloads/windows/, and follow the instructions.

Once you have CPython installed (properly), VSCode should detect it and use it to run your program when you click on the "Run" arrow!

More replies
More replies

Go to the python website and download and install the latest version for your os

Go to Microsoft's vs code website and do the same

Open vs code, and on the far left, there will be icons. Hover over them. One of them will be for extensions. Click that one and search for the python extension.

Don't worry about not knowing everything. I've been using it for years and still learn new stuff all the time.

u/JialeDu avatar

https://code.visualstudio.com/docs/python/python-tutorial

vscode itself is just an editing program. You need to install the extension in order to execute the language scripts, provided of course that the language itself is already installed on your machine.

Look bud it's quite simple: think about it as installing any other regular software.

Go to python.org download the latest version for your OS and install it (remember to check add to path box during install that will help you later)

Same for VS Code you can grab it for free on the Windows store or their Github page.

Once VS Code is installed in the top menu at the right click File > Preferences > Extensions and then on the left a search box will appear where you can look for the python extension.