An idea: Create an OS that's written in a scripting language
-
- Posts: 2
- Joined: Tue May 22, 2012 5:12 am
An idea: Create an OS that's written in a scripting language
I have an idea about creating an OS.
My idea is: Create an OS that's written in a scripting language (eg. JavaScript or Python).
This image shows the architecture:
Note:
HAL written in ASM/C/C++ and should be minimal. Some classes like CPU provides Interrupts/Privileges (Even CPU like Z80 not supported that feature).
OS (Kernel, Drivers and ...) written in a scripting language (eg. JavaScript or ECMA Script).
Applications written in a scripting language too (eg. XHTML + CSS + JavaScript).
Benefits:
* Open Source (Because OS written in a scripting language)
* Easy to port to other Hardwares.
* Easy to port to Mobile devices.
* Easy to debug.
* Easy to update.
* XHTML, CSS, JavaScript are popular.
....
Is it a good idea to create an OS that's written in a scripting language?
For example, how about creating an OS using JavaScript?
My idea is: Create an OS that's written in a scripting language (eg. JavaScript or Python).
This image shows the architecture:
Note:
HAL written in ASM/C/C++ and should be minimal. Some classes like CPU provides Interrupts/Privileges (Even CPU like Z80 not supported that feature).
OS (Kernel, Drivers and ...) written in a scripting language (eg. JavaScript or ECMA Script).
Applications written in a scripting language too (eg. XHTML + CSS + JavaScript).
Benefits:
* Open Source (Because OS written in a scripting language)
* Easy to port to other Hardwares.
* Easy to port to Mobile devices.
* Easy to debug.
* Easy to update.
* XHTML, CSS, JavaScript are popular.
....
Is it a good idea to create an OS that's written in a scripting language?
For example, how about creating an OS using JavaScript?
Re: An idea: Create an OS that's written in a scripting lang
No.Is it a good idea to create an OS that's written in a scripting language?
No.For example, how about creating an OS using JavaScript?
-
- Posts: 2
- Joined: Tue May 22, 2012 5:12 am
Re: An idea: Create an OS that's written in a scripting lang
Why?iansjack wrote:No.Is it a good idea to create an OS that's written in a scripting language?No.For example, how about creating an OS using JavaScript?
- DavidCooper
- Member
- Posts: 1150
- Joined: Wed Oct 27, 2010 4:53 pm
- Location: Scotland
Re: An idea: Create an OS that's written in a scripting lang
What sort of performance do you expect to get out of it? Would it not be like designing a new kind of high-speed train to be pulled along by oxen?
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: An idea: Create an OS that's written in a scripting lang
Written in a scripting language, so what? Do you think they are not compilable?* Open Source (Because OS written in a scripting language)
The same is true for every OS written with porting in mind.* Easy to port to other Hardwares.
How so?* Easy to debug.
True, but two of them are *really* broken. And it's by design.* XHTML, CSS, JavaScript are popular.
It's not really your idea, don't you know? Why, do you think, there is no JS or Python OS you've heard of? I assume you: not because no-one ever said "I have an idea to create OS in JS...", because you're definitely not the first one to say so.My idea is: Create an OS that's written in a scripting language (eg. JavaScript or Python).
That's an argument for keeping C++ level minimal?(Even CPU like Z80 not supported that feature)
No, because it's broken by design (by design, because they are called *scripting languages*, not *system programming languages*, think about it for a second).Is it a good idea to create an OS that's written in a scripting language?
For example, how about creating an OS using JavaScript?
http://roflcopter.pl/5682 wrote:<omarqureshi> some fuckmuppet wrote a javascript interpreter in javascript
<omarqureshi> https://github.com/jterrace/js.js
<omarqureshi> "It currently takes about 40 seconds to run print(1+1)"
Edit: ah, forgot about something. "Class" isn't some magical creature, y'know.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Re: An idea: Create an OS that's written in a scripting lang
I'll tell you what. Write an ext2fs driver in javascript and post it somewhere where I can review it; then I'll answer your question.amirsaniyan wrote:Why?iansjack wrote:No.Is it a good idea to create an OS that's written in a scripting language?No.For example, how about creating an OS using JavaScript?
Re: An idea: Create an OS that's written in a scripting lang
You have omitted a thousand layer in between the block in the architectural diagram, before we go into implementation detail like the choice of script language.amirsaniyan wrote:This image shows the architecture:
Re: An idea: Create an OS that's written in a scripting lang
Basically:
Sorry, but your suggestion cannot be taken seriously. (And hasn't, not in the >10 years that I dabble in this subject, not in the many dozen occurrences of some web designer popping up with that same idea.)
- The desire to use scripting language is usually felt by people who consider compiled languages "difficult". That is about the same group of people that will find OS development "insanely difficult".
- Most people from above group fail to realize that much of the "comfort" they feel when using their scripting language of choice is due to its runtime environment and standard library. Neither is available in kernel space. Porting runtime and standard library is about 95% of the work inherent in "writing an OS", or "porting to other hardware". (I.e., the "HAL" box in your schematics is the OS.)
- There are many tools available for debugging ASM or C code, even in kernel space. They are easy enough to use for anyone who knows those languages. There is no advantage to be had in the debugging department by chosing a scripting language; to the contrary actually.
- Whether or not something is OpenSource is not a factor of the language, but a factor of the license. If I post a piece of JavaScript and write "all rights reserved", that prohibits you from using it legally just as much as if I'd posted a binary without source. If I post C source and write "CC0", that's as open as it gets. Again, the advantage of scripting languages might be felt, but it's not real.
- XHTML and CSS are not programming languages at all, and utterly insufficient to build anything worth the name "application".
Sorry, but your suggestion cannot be taken seriously. (And hasn't, not in the >10 years that I dabble in this subject, not in the many dozen occurrences of some web designer popping up with that same idea.)
Every good solution is obvious once you've found it.
Re: An idea: Create an OS that's written in a scripting lang
What has yet another OS written in C got to do with this discussion?berkus wrote:webOS?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: An idea: Create an OS that's written in a scripting lang
I think the point was that the OP would be better off building on top of a browser-only system...
Re: An idea: Create an OS that's written in a scripting lang
I'm still not sure that I understand. The OP wants to write an OS, and this is a site dedicated to OS development. I'm not sure that writing user applications in javascript is of much interest in this context.
Re: An idea: Create an OS that's written in a scripting lang
Ah. Fair enough.
Re: An idea: Create an OS that's written in a scripting lang
I have a similar idea for my projects: Create a proper kernel in C/Assembly and the like, build a compiler that can combine different languages and compiles them, including a language like JavaScript for some aspects that aren't the core of a component but that can make such component more maintainable and readable, and use as many standards as possible to make it worthy. Some of those standards would be HTML/XHTML/JavaScript/CSS to build a GUI that obeys standard practices and in which we can use HTML to create an application's GUI, probably compiling it partially or totally to native code or some bytecode. However, there should always be the option of using any other languages.amirsaniyan wrote:I have an idea about creating an OS.
My idea is: Create an OS that's written in a scripting language (eg. JavaScript or Python).
This image shows the architecture:
Note:
HAL written in ASM/C/C++ and should be minimal. Some classes like CPU provides Interrupts/Privileges (Even CPU like Z80 not supported that feature).
OS (Kernel, Drivers and ...) written in a scripting language (eg. JavaScript or ECMA Script).
Applications written in a scripting language too (eg. XHTML + CSS + JavaScript).
Benefits:
* Open Source (Because OS written in a scripting language)
* Easy to port to other Hardwares.
* Easy to port to Mobile devices.
* Easy to debug.
* Easy to update.
* XHTML, CSS, JavaScript are popular.
....
Is it a good idea to create an OS that's written in a scripting language?
For example, how about creating an OS using JavaScript?
I would say it is a good idea only if you are capable of writing all of the above for yourself, use scripting languages as compiled code ultimately if you use them for parts of the system/kernel itself, and let the programmer choose the use of regular APIs, or fancy and easy interfaces that, like JavaScript, require no configuration from the end user/end developer. Otherwise it would be so pointless that you simply won't be able to implement that OS to begin with.
You still have a lot of work ahead, and will need to start with very low level stuff anyway, which won't be so fancy from that point of view, while you get the huge experience required to be capable of creating such a complex environment properly.
After all, if it wasn't a good idea to have such languages in an OS, they wouldn't be in the OS'es everyone use normally; but they must be used correctly, not necessarily in the same old way in which they have been used so far, but efficiently, and just compile them if it is beneficial to do so. And don't leave out the possibility of the rest of languages like C and Assembly, since they are still the primary ones in OS development, and in applications to.
I would be one to do so if I had enough information and expertise on ext2. However I have implemented tiny parts of FAT12 in JavaScript, and could finish a driver that can at least read the root directory, but since I already have a working implementation in assembly, I see no practical use for a FAT12 JavaScript driver in the short term, or maybe only to create an interactive tutorial about it with a driver in the web browser.iansjack wrote:I'll tell you what. Write an ext2fs driver in javascript and post it somewhere where I can review it; then I'll answer your question.
It is common knowledge that JavaScript can handle binary data easily in modern browsers since FireFox 3 (use Base64 functions btoa to load the binary data as plain text, and decode it back to its binary form using atob; in this way you could, for instance, request or embed part or all of a floppy image and parse it with pure JavaScript). Working with raw binary data in JavaScript is no longer something to be afraid of (at least not in moderate quantity, and in the default environment of a web browser, mainly to read it, unless you build an extension or use a web server to have it make writes to a file to save what you did at the JavaScript side).
YouTube:
http://youtube.com/@AltComp126
My x86 OS/software:
https://sourceforge.net/projects/api-simple-completa/
Donate to get more food/programming resources/computers:
https://www.paypal.com/donate/?hosted_b ... QS2YTW3V64
http://youtube.com/@AltComp126
My x86 OS/software:
https://sourceforge.net/projects/api-simple-completa/
Donate to get more food/programming resources/computers:
https://www.paypal.com/donate/?hosted_b ... QS2YTW3V64
Re: An idea: Create an OS that's written in a scripting lang
Writing OS drivers is not a question of handling raw byte data. If anything it is the opposite - you need the ability to treat data as complicated structures. I don't believe that javascript was designed with this in mind.
I'm sure that you are very expert in javascript, yet you have only been able to implement "a tiny bit" of a FAT driver, which is a relatively simple task. As for ext2fs, if you are interested copious documentation is available on the web.
If you just want to run javascript programs on top of a C/asm kernel, that's hardly revolutionary.
I'm sure that you are very expert in javascript, yet you have only been able to implement "a tiny bit" of a FAT driver, which is a relatively simple task. As for ext2fs, if you are interested copious documentation is available on the web.
If you just want to run javascript programs on top of a C/asm kernel, that's hardly revolutionary.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: An idea: Create an OS that's written in a scripting lang
The only scripting language I would ever attempt to write system components in is Lua. Even then, there would be a lot of work to be done writing extensions to it in C to make it suitable for driver writing. In general, I'd say it's more work than it's worth.