Port Python (CPython) to a new Unix-like operating system (original) (raw)
March 8, 2026, 4:34pm 1
For example, to port Python (CPython) to Plan 9.
Plan 9 was intended as successor to Unix. Cleanly written, one kernel usually compiles within seconds. This could be of value say for space use, where many instruments are new hardware to the operating system, and security is required.
The CPython’s configure script alone however, counts x0,000 lines. So how to go about the porting? Can we compile the CPython part by part?
Is there anyone who is a Plan 9 developer at the same time as a CPython, or NumPy etc developer?
We actually have a porting guide in the devguide, although it is quite old and I would assume a tad out of date. Maybe you’ll find it helpful, if you spot any issues please do let me know, I’ve recently been trying to update these pages.
Jos_Verlinde (Jos Verlinde) March 8, 2026, 6:32pm 3
MicroPython.org might be of interest,
Plenty of ports to minimal systems, if there is a GCC or cross compiler for Plan 9, porting should be a breeze.
You’ll get the Python language, but not the full ecosystem of all libraries.
jencir.lee (Jencir Lee) March 8, 2026, 7:35pm 4
Say the plan is to first port to Plan 9 on ARM64, then to Plan 9 on RISC-V, both RISC-type processors.
On ARM64 under Ubuntu, I’ve run ./configure, which generated a close to 4,000 line Makefile. What’s the strategy to steer in it? Are there any make targets most important (and modular) to focus on first?
Do you have relevant experience Stan – how much time do you reckon it would take to port to a new Unix-like operating system on ARM64 (first)? We only need essential core modules of Python, so to be able to co-operate with NumPy, SciPy etc.
In general “it depends”, both on how unix-like the new platform is and how familiar you are with C in general and CPython in particular.
The code base generally uses configure feature checks to detect APIs that can be used on unix systems, so with some luck porting is not a lot of work.
Have you tried to build on Plan9?