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?
|
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? Edit:-- Just to clarify a bit. You cannot write a "real" OS which interacts directly with the machine in a "scripting" language. You can however write a usable "virtual machine" if the scritping language is flexible enough. For instance implementations of Donald Knuths theoretical MIX (s) machine and a ZX80 emulator good enough to run pacman have been written in JavaScript. |
|||||||||||||||||||
|
|
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? |
||||
|
|
|
I know this is not a proper answer, but this project demonstrates a working operating system with a kernel written in JavaScript: https://github.com/charliesome/jsos/ The drivers for VGA and the keyboard were also written in JavaScript using interrupts. I developed an implementation of OpenGL 1.1 for it myself a while ago and it works pretty nicely. |
|||||||||
|
|
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. However,
|
|||||||
|