Is it a good idea to create an OS that's written in a scripting language?
For example, how about creating an OS using Python?
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
It's not just a bad idea. It's pretty much impossible.
How do you implement IO with a language whose IO facilities depend entirely on the host operating system?
How could you implement primitive scheduling without any useful interrupt primitives?
How could you write a device driver in a language which cannot address a particular byte?
|show 2 more comments|
Before you decide on the how, you need to specify the what. What will this new OS do? Where will it run? Why would any one bother to use it? etc. The next thing is to determine the qualities of the OS. Speed, Security, Threading, Memory Management, Multi-Tasking, File Formats, Language support, supported processors, etc.
From answering the above questions and considering the many qualities of your OS you can determine what tool to use to achieve your goals.
Now, do you really want to do all that?
I assume that Python was used in part in writing parts of Linux - See: What Languages are Windows, Mac OS X and Linux written in?
No, it is not even possible (exclusively)
Why? Consider the following:
What is a scripting language?
Lets make the following two assumptions about the definition of a "scripting language":
What is an operating system?
Lets assume that an Operating System's primary goal can be simplified to the following:
By these very definitions, it is logically impossible for a scripting language to be an operating system. Why?
It is possible to write a minimum amount of code in a "raw" language such as C, but a raw compiled language is always going to be needed by definition. Once this is in place, other pieces of the OS can be implemented in a scripting language, but a scripting language could never be used alone.
I must maintain that it is, in principle, possible to write an operating system in python. You would have to produce a Python-to-low level language compiler, as well as add modules to the standard library that provide access to the low level pieces of your computer. But if those two pieces were in place it would be possible.