Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I mean, okay, you don't need vi or awk to call it Linux. But surely you agree that CPython is needed to run Python, yes? Its interpreter is written in C. To build it, you need a shell, make, gcc, and a text editor would be most helpful.

It's all part of the user space. You can hide it within the snakeware application (why?), but don't deny it exists in the Linux user space. And C Python needs C extensions (pygame, for example), so GCC is at the very least a very-very-nice-to-have, is it not?

What is the goal here? You want to run Python without a shell? A huge number of python scripts depend on the shell. You are increasing barriers to using Python to code interesting apps in this system. Should the shell be implemented in Python, too? It could be, but why? Why not just integrate a standard shell, and present some nice-ish way of interfacing with it via Python?

I don't think that this application itself can even work in such an environment (no shell, no init system, etc). Currently this project is depending on a shell provided by Busybox. It uses these underlying tools to initialize and configure the operating system. It's all there in the user space, just hidden beneath this application.

Look, there are no laws about this sort of thing. You can do what you want and call it what you will, and I'm not some tech lingo fascist trying to impose my idea of "user space" on anyone (even though it's really a term with a specific meaning of 'anything outside of the kernel', for which making an all-python version sounds highly difficult). I'm merely pointing out that a great deal of this user space is actually already non-python, and user space carries with it a lot of linux's essential functionality, largely via the GNU core utils and other common utilities which are written in a wide variety of languages. You can choose to hide all of that functionality to make a python-only sandbox... but.... then...

...Couldn't I just use pygame to make standard applications that run on all distros outside of this isolated "window manager" program? All this achieves right now is isolating your apps in this kind of simulated window environment, and preventing the user from ever doing anything meaningful unless they have a specially coded snakeware(tm) python app. It can never run a standard installation of something like Firefox; utilize any standard Linux CLI software; utilize an existing package management system or the packages from it; etc. because it has no shell, and doesn't make use of the standard Linux graphics compositors (X11/Wayland).

So having said all of that, my goal isn't to tear down the project, but to ask the hard question for the benefit of this project: What is the goal? What I see here is mainly a simulated window manager written in pygame which can only ever run specially-created GUI apps, which is booted into directly. This design can never become a viable distro as it stands.

This is a cool project. A fun project. But first and foremost, this is about 1400 lines total of Python and shell script. It's not really all that much yet, and it's not going to get there by pretending this design is sustainable to become some robust user environment where everything is Python. Sometimes, complying with standards and specifications are what make a thing the thing it is. And this is not a Python-only user space Linux distro. It is a simulated window manager written in Python that runs on a Linux kernel in a standard shell using a compact subset of standard tools written in other languages, and conceals the rest of user space on which it itself depends.

But maybe it's just easier to pretend the whole thing isn't a single process running on a single core, non-Posix compliant, incapable of running standard Linux GUI or CLI apps; and that all of that sacrifice in functionality hasn't been specifically engineered to cater to some misguided aesthetic notion that this all makes the system more hackable because it is a written in Python. Maybe it's easier to simply pretend that you can't build a python window manager that works with native linux graphics compositing systems, and that the whole design would be better off targeting certain configuration processes using Python.



> . But surely you agree that CPython is needed to run Python, yes?

No, it just happens to be the reference implementation, there are others to chose from.

One can even go crazy and bootstrap a Python environment, basic compiler development stuff.


You are mistaken. Pygame depends on CPython, as it is a C extension. Under the hood, even this window manager is mostly C.


And? Who says that Pygame is the only way of implementing this?


Pygame is all this is. I'm not saying that it's the only way. It's probably one of the worst ways in my humble opinion, though I can't really say that without understanding their vision for the project tbh.

Should I assume they are looking at scratching every single line of code they've written for this and restarted? Why would I make that assumption?

I don't want to quibble with you. My only point here is that an all-python user space is a significant undertaking if you are willing to acknowledge the scope of what the user space actually entails. It's totally doable, but this project isn't even a step in the direction of solving those problems. It's a totally different thing.

Depending on the objective in a "python only" operating system, I may be inclined to strongly advise not trying to reimplement everything in python. The nature of C is such that you can write a C compiler in C, compile it, throw away the source code, and use the compiled binary for the new compiler to start developing a new compiler for C. But you can't like, make a python interpreter for python, in python, delete CPython, and then use the python version. It is dependent on CPython. And so, to build it, it's dependent on GCC, make, a shell, etc.

These are great tools. I think you should keep them, and define a specific surface area that python interfaces with. That's all I'm sayin'.


Sure you can, that is the whole goal of PyPy, IronPython, Jython, Python on GraalVM, Python on OpenJ9, CircuitPython and plenty of other attempts.

Anyone that understands compilers knows one can write language X in X.

In fact, "Writing Interpreters and Compilers for the Raspberry Pi Using Python" does exactly that.

We can nuke CPython and there is plenty of Python code that would still run without problems.


I'm sorry man, but you sound incoherent to me.

You can write a compiler for python in python--but it still needs the original cpython (or jython, or ironpython, or pypy, etc.) to run, because there is no compiled binary produced by your python code.

You can write a compiler for any language using python, but you need one of the interpreters you mentioned, and you can't throw it away unless it produces a binary. Maybe Cython can do this. But if it needs an interpreter to run, you'll have to keep the interpreter around as a non-python dependency.

But who cares? Unless you rewrite a Pygame from scratch, or replace it with another graphics library, in which case you need to rewrite snakeware from scratch, none of this is relevant here.

It's just insane. You are proposing rewriting entire language runtimes and/or graphics engines to preserve 1400 lines of python code (mostly a menu, a calculator, and a game of snake), with the supposed goal of creating an all python user space, and dismissing it as "Who says you can't do it?". I'm not saying it's impossible, but it makes no sense. You'd be better off starting over and taking this on with a different strategy. If your end goal is an all Python user space linux distro that actually works like linux, this project is a non-starter without being totally reimagined with virtually 0 reuse of the code that's there even at a conceptual level. You wanna rewrite pygame or python's compiler? Be my guest! It has nothing to do with your supposed objective though.

At the very least, you would need to get out of the pygame window simulation, start using a standard graphics compositor, and replacing existing utilities with python alternatives to make this work. But again, even CPython, Jython, PyPy, etc. will need to remain. Maybe Pygame can be made to work with PyPy, in which case you get close to what you want--but it's still a C extension, not python. And that's your graphics renderer. So why not just use Wayland or something then?

I think the quest for language purity at the OS level is a fun dream to pursue, but you need to decide where to cut it off in terms of scope and how to implement the scope you choose.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: