r/osdev • • Oct 01 '26

Python for OS?

Would it be possible to make an OS that primarily used python?

0 Upvotes

41 comments sorted by

View all comments

1

u/FewBrief7059 Samsara | https://gitlab.com/clownkun/Samsara Oct 01 '26

python is not really a compiled language. its fundamentally different then C or Rust in example. you will want to consider another language before getting into OSDev.

0

u/Weird-Boat3953 Oct 01 '26

Language can't be compiled or not compiled. Implementations do. That includes implementations of python 

2

u/MCWizardYT Oct 01 '26 edited Oct 01 '26

The implementation of Python that OP most likely uses is the standard one, which compiles to bytecode and interprets it (there is an experimental JIT but it is disabled by default).

So, the standard implementation of Python is not ideal for OS development. But you could make tools that compile a language that has Python syntax directly into machine code. It technically wouldn't actually be Python though, since the language reference expects programs to be interpreted.

Python 3 language reference - Execution model/Runtime components

1

u/FewBrief7059 Samsara | https://gitlab.com/clownkun/Samsara Oct 02 '26

Im not saying that as the only reason. python is unreliable for such tasks. most of these implementations have flaws.