Lots of replies mentioning Emacs but Emacs out of the box is gonna be essentially a text editor (insert obligatory: Emacs isn't a text editor; it's a LISP interpreter).
However, install Doom Emacs, and you have a full IDE experience for essentially any language you could ask for. I highly recommend it.
I'm not too familiar with how Flatpak works but Emacs benefits from compiling it on your machine natively. Tell me what distro you're on and I can see if I can find out how you'd do that.
Following up from my previous comment, there is a Flatpak of Emacs available on Flathub. Here are the instructions for how to install, whilst enabling native compilation, which will offer a performance increase and allow you to use features such as vterm (the best terminal emulator for Emacs).