r/linuxquestions • u/WarGiver • 20h ago
Support 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.
5
u/vanderaj 19h ago
First things first, you're doing this the way I would learn a new language, so you're already on the right track. I suggest picking up a good Python reference book, like Dead Simple Python by Jason C. McDonald, and watching a few YouTube videos on selected topics if and when you need them.
You can do this. You can do it either by yourself, which will be far more interesting albeit slower, or you can use AI to help. I suggest instead of asking AI to code everything, ask it to help you learn things, and then you implement what you had in mind, rather than let AI do it. This will be far more satisfying to me than just vibe coding something. YMMV.
Looking at the instructions for creating a planet in Space Engineers, it requires a bit of image processing and a fair amount of numerical processing. For the latter, consider using numpy, which has highly optimized routines on most platforms for Python to work with large numbers, vectors, and floating-point numbers, images, and more besides.
I think the majority of your processing time is creating the textures, bump maps, biome maps, height maps, and other assets, which Python would be a good fit alongside finding good image libraries and numpy. You'll also need to find something to export things to XML, which I believe Python has in spades.
Honestly, I'd get something working first before worrying about the compile step. Most Python packagers like py2app or pyc are not really compiling your code, they're packaging it up. You won't see much of a performance boost, it'll just be easier for folks without a Python runtime to use your code. Most Linux distros have Python preinstalled, so a pip -r requirements.txt and so on will be more than sufficient.
If your Python code ends up being too slow, consider parallelization before a rewrite. If you are just starting out and really want a fully compiled language, my favorite language is Go. It's extremely simple to learn, but it doesn't have a rich package library (pip) or numpy, so coding it in Go or Rust might be more difficult than in Python.