You just cannot do it, I’m afraid. Python is an interpreted language, and requires de CPython library to be translated into machine code so that it can then be run, but that requires an underlying OS that makes the calls. The closest thing would be micropython, which can be run inside the Linux kernel, but that’s about it. The only thing I can think of is using a custom compiler that would generate either C/C++ or assembly code from a Python script, and then compile it using a standard C/C++/assembly compiler.
cooligula@sh.itjust.works 3 weeks ago
You just cannot do it, I’m afraid. Python is an interpreted language, and requires de CPython library to be translated into machine code so that it can then be run, but that requires an underlying OS that makes the calls. The closest thing would be micropython, which can be run inside the Linux kernel, but that’s about it. The only thing I can think of is using a custom compiler that would generate either C/C++ or assembly code from a Python script, and then compile it using a standard C/C++/assembly compiler.
MonkderVierte@lemmy.zip 3 weeks ago
So, there?
cooligula@sh.itjust.works 3 weeks ago
That is not the same as building an OS in Python hahaha
buttnugget@lemmy.world 3 weeks ago
Well shoot! This is really interesting though. I’m not a programmer, but I think I understand the basics of this.
PlexSheep@infosec.pub 3 weeks ago
Guess they have to write a python compiler first then.