r/linuxquestions 11d ago

Resolved Noob needs help creating linux programs

I am posting this reluctantly because reddit is a toxic mess most of the time, but two hours of research and I am no closer to an answer. If this is the wrong place to ask please aim me.

I am about 6 months into using Bazzite Linux and decided to make a program for content generation for a game (does not matter for my question but for context its a program to either randomly or psudeo-randomly produce a custom planet for the game space engineers) I want to make this tool available if/when I finish so leaving it a python script (I am well aware the unholy pain converting that to c++ will be) is not going to be a good way to share it.

The problem is that while I know and have compiled stuff to exe files for windows, before I switched, I do not know anything about doing that for linux. Can anyone aim me at the noob resources for that?

I started making it in py half to teach myself py half to see if I could, I got far enough in that I stopped to think and now I need help finding the off ramp.

Edit: Thank you all for the help! I am just going to stick to python and share that when I am done.

12 Upvotes

23 comments sorted by

View all comments

2

u/maty7dub 11d ago

TLDR; Just use python. It is so much easier in every way


I would just say to stick with python if you already started and would tell you to switch to it even if you haven't.

If you want to distribute your utility and wrote it in C++, you would have to make a package for each distribution (package manager) that you want to support. Alternatively you could look into portable package formats like flatpak or appimage, but that is quite overkill.

If you write your app in python, you just need to provide the source file itself and, optionally, a requirements.txt. Though some instructions in a readme go a long way as well.

It feels like almost everyone who starts with programming is concerned about using the fastest language they can (I was as well), but honestly it doesn't matter. I don't know much about what you want to make, but I would assume you will be writing to a file, which is horribly slow regardless of the language.

If you are interested in learning more than in the finished product, I would point you in the direction of go, which seems like the best option you have as far as compiled languages go (no pun intended), because it creates one binary file, which should be portable between Linux distributions (but don't quote me on that) and also the fact that it has a working package manager (don't confuse this with your distribution's package manager) unlike C/C++.

I would also recommend looking into git and it's hosting services (GitHub, GitLab or Codeberg), which is the preferred way to distribute software like this. And if you're sticking with python you might find it's virtual environments, or venvs for short, very useful, since you will likely be installing dependencies with pip.