Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31

Thread: Is a python os possible?

  1. #11
    Join Date
    Dec 2006
    Location
    Australia
    Beans
    1,097
    Distro
    Xubuntu 15.10 Wily Werewolf

    Re: Is a python os possible?

    Quote Originally Posted by dodle View Post
    Would it be possible to build an operating system from python alone?
    No.

    At present, almost all operating systems use at least some Assembly. High-level interpreted or JIT-compiled languages have been used to write operating systems, but they inevitably require substantial portions to be implemented using Assembly or C.

    There are not many programming languages that can be used to implement operating systems on their own. Ada, C, C++, Pascal, PL/1 are used for such purpose, but even they require some Assembly, or the operating system is highly specialised and limited in use (ie. for avionics, robots, etc., not general-purpose operating systems like Linux or Windows).
    Last edited by samjh; April 4th, 2009 at 09:27 AM.

  2. #12
    Join Date
    May 2008
    Beans
    1,029

    Re: Is a python os possible?

    I guess I need to study up on Assembly, since I don't understand what that is.

  3. #13
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Is a python os possible?

    yes it is possible, if you have a python machine code compiler.
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  4. #14
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: Is a python os possible?

    Quote Originally Posted by dodle View Post
    I guess I need to study up on Assembly, since I don't understand what that is.
    That would be the worst approach.

    Of course depending what your goal is - you never bothered to mention that, so any advice is based on WAG.

    Learning basic of Assembly is fine (try wikipedia as always), but trying to understand OS written in ASM will just slow you down. Is you want to understand how OS works, *much* better off you would be (after becoming decent C programmer) to start reading code of some simple OS designed to be understandable by students (taking OS design course), like Minix (btw that's what Linus did).

    ASM is just way too low level. If you want to understand concepts of something, using efficient high-level language like Python makes you order of magnitude (or more) more productive. ASM makes you 2 orders of magnitude *less** productive than in C, trust me on that.

    And despite what people above said, OS in Python could be possible in the future. Now of course is not - Python is fast enough, in the niche where it is used speed is mostly not a problem, and work to improve it is underway. Untill recently Python (a volunteer project) did not have huge resources as Java or C# had, so precious resources were invested in more urgent areas.

    But OS written in 99% in Python (like Linux is 99% in C) certainly *is* possible. Read about http://en.wikipedia.org/wiki/PyPy - reimplementation of Python which includes compiler (Psyco) and JIT optimizer. PyPy is written in RPython, a subset of Python (which many too dynamic parts removed foe speed).

    Another approach could be to use http://en.wikipedia.org/wiki/Cython which generates C code.

    Of course such OS in Python would be excellent learning tool (simpler to comprehend than Minix).

    Another area where Python might in the future replace static languages like C is in programming desktop. Even now, and even on such weak CPU like OLPC has, a big part of it's desktop (Sugar) is written in Python:

    http://wiki.laptop.org/go/OLPC_Python_Environment
    Last edited by pmasiar; April 5th, 2009 at 04:10 AM.

  5. #15
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Is a python os possible?

    another thing you could have is some ROM with a python interpreter in the same style as some computers in the 80s had BASIC.

    While knowledge of assembly would be required, you are not at that point yet. You are at the point where you first need to understand basic os concepts (memory management, scheduling, etc.)
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  6. #16
    Join Date
    Jul 2008
    Beans
    1,706

    Re: Is a python os possible?

    Quote Originally Posted by Sorivenul View Post
    It would be something interesting to attempt after Google releases Unladen Swallow.
    African or European?

    and you are my hero if you make a python compiler/interpreter in ASM thats built into your kernel
    Last edited by jimi_hendrix; April 5th, 2009 at 02:28 PM.

  7. #17
    Join Date
    Aug 2006
    Location
    Germany
    Beans
    396

    Re: Is a python os possible?

    my favorite C++ OS : haiku
    the jvm is my home...
    http://clojure.org/
    http://www.scala-lang.org/...and it rocks a lot!

  8. #18
    Join Date
    Dec 2006
    Location
    Australia
    Beans
    1,097
    Distro
    Xubuntu 15.10 Wily Werewolf

    Re: Is a python os possible?

    Quote Originally Posted by slavik View Post
    another thing you could have is some ROM with a python interpreter in the same style as some computers in the 80s had BASIC.
    There are processors like that for embedded Java: http://www.ajile.com/ and http://www.arm.com/products/multimed...a/jazelle.html

    The same could be done for Python if there is demand. "Demand" being the key point.

  9. #19
    Join Date
    May 2008
    Beans
    Hidden!

    Re: Is a python os possible?

    Hmm... Python operating system, or Python kernel?

    If you wanted to do the former, with plain old CPython, you could probably reimplement everything past init (first transition out of kernel space, I believe) and pretty much have a Python OS. Maybe begin with LFS.

    But the kernel is another thing. You would either need a C runtime with bits of assembly, or a really flexible Python compiler to the point where you could essentially write C with a Python-like syntax. But you have to get down to metal eventually, and Python on its own doesn't accomodate for that all too well (maybe the compiler could? Additional built-in types or something).

  10. #20
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: Is a python os possible?

    Quote Originally Posted by snova View Post
    a really flexible Python compiler to the point where you could essentially write C with a Python-like syntax.
    Like Cython mentioned above? Or RPython?

    But you have to get down to metal eventually, and Python on its own doesn't accomodate for that all too well (maybe the compiler could? Additional built-in types or something).
    Which types are in C and not in Python? You can model anything using byte arrays - the problem is efficiency, and you can get it via Cython.

    So real problem is lack of effort - Linux is worth more than 1B USD of developer's time, even if redeveloping in Python/Cython will result in order of magnitude improved efficiency, it is still dozens of millions dollars worth of time. There is no need for such huge time investment in reinventing the wheel, so it is not **feasible**. But certainly it is **possible**, for a dedicated team of thousands of hackers with nothing better to do with their time

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •