Hello
My question has to do with python and linux - I was interested in
finding out what it would take to reimplement the Linux Kernel in python
basically just taking the source code from linux and rewriting it in
python Would this idea make sense to do - if so what would be the
benefits of doing this and in what way would this not be a good idea
To put it simply, it does not make sense, in its pure form. Linux is
written in C for a lot of good reasons: portability, need to access
the hardware, and performance comes to mind. Besides that, Linux is
Posix compliant and emulates Unix system calls to a large extend, and
that also makes C a natural choice. To do a similar implementation in
Python would be similar to try to use a knife to sculpt a marble piece
-- it's the wrong tool for the job.
Now, let me re-state your question in a broader sense. Is it possible
to write an OS using a language such as Python? Yes. But the resulting
OS will surely be different from Linux -- by design it would be a
completely different beast. Some parts would still be written in C and
assembler, because it needs to access the hardware, and also for
performance reasons. But an API could be devised to allow higher-level
functions to be written in Python, while calling the low-level
C+assembler stuff. But as I said, it's _so_ completely different from
anything else in use today as to make it pretty much a theorethical or
academic exercise with little practical use. I can't see a project
like that taking off, even if I would love to see it working.
--
Carlos Ribeiro
Consultoria em Projetos
blog:
http://rascunhosrotos.blogspot.com
blog:
http://pythonnotes.blogspot.com
mail: (e-mail address removed)
mail: (e-mail address removed)