The Perfect OS Programming Language
The Perfect OS Programming Language
I was just thinking about this, wondered what other people thought.
If you could design a new language for OS development...
1) What methodology would it be? e.g. procedural, functional, object oriented, etc.
2) What parts would you include in the language itself, to speed development? e.g. built in exception handling, reading /writing to ports, remapping pic, etc.
3) What kind of support would you want at runtime? e.g. garbage collection, type checking, etc.
4) What format would it compile to? e.g. flat binary image ready to rawrite to disk with kernel and bootloader correctly setup, etc.
5) etc etc
looking forward to some interesting answers...
If you could design a new language for OS development...
1) What methodology would it be? e.g. procedural, functional, object oriented, etc.
2) What parts would you include in the language itself, to speed development? e.g. built in exception handling, reading /writing to ports, remapping pic, etc.
3) What kind of support would you want at runtime? e.g. garbage collection, type checking, etc.
4) What format would it compile to? e.g. flat binary image ready to rawrite to disk with kernel and bootloader correctly setup, etc.
5) etc etc
looking forward to some interesting answers...
Re:The Perfect OS Programming Language
well how it compiles is all the compiler, not the language itself. and for error-checking, and that junk, you shoudl do that yourself, cuz it could lead to slow code. and as for teh perfect langauge, or at least most perfect that i know of. its C. C was written just for writing operating systems. i dont think any other popular langauge has.
Re:The Perfect OS Programming Language
There's nothing like an absolute truth here... I have seen OS's coded even in pascal and ada...
it really depends on what is your philosophy when writing the os... if you just want to make a point (like if it is possible to write an os in basic) or you want to make it fast, or
portable, or secure, multiuser, etc...
C has a lot of flexibility, so it is the ideal language for almost anything you can code... but using c/c++ without prior experience can get you a shot on the foot
So.. this really dependes on you. On what you want to code, your prior experience, your current knowledge, etc.
it really depends on what is your philosophy when writing the os... if you just want to make a point (like if it is possible to write an os in basic) or you want to make it fast, or
portable, or secure, multiuser, etc...
C has a lot of flexibility, so it is the ideal language for almost anything you can code... but using c/c++ without prior experience can get you a shot on the foot
So.. this really dependes on you. On what you want to code, your prior experience, your current knowledge, etc.
Re:The Perfect OS Programming Language
Did MS make windows with pascal? I think so because in TASM win 3.1 programming, you use the
model somthing somthink PASCAL
hmmm...
model somthing somthink PASCAL
hmmm...
Re:The Perfect OS Programming Language
Prior to Windows 95, most of Windows was written in assembly language (no, really...). However, until at least Windows 3.0, there was an assumption that most programmers were going to be using Pascal, which was the most popular language for PC programming at the time, so the designed all the API codes to use the Pascal calling conventions. This remains the standard for at least the older 16-bit legacy code, for reasons of backwards contemptability.Tom wrote: Did MS make windows with pascal? I think so because in TASM win 3.1 programming, you use the model somthing somthink PASCAL
As for what language you can use, well, it really depends more on you rpreferences and you skills than anything else. I intend to mixed compiled/interpreted language of my own design (a derivative of Scheme which uses infix rather than prefix notation, with some influences from Smalltalk) for the bulk of my coding, with C and assembly for the time-critical or space-critical portions (one of the keys to successful optimization is to know what doesn't need to be tweaked, so you can concentrate on the parts that do need it). The only real rule is, the compiler you use has to generate code that does not have any system dependencies in it that you didn't explicitly put there.
Many will say that C is the best choice, and if you know C well, it certainly has many advantages when it comes to systems programming. However, it is hardly the only choice; if yo prefer the Pascal family, then you may be better off with Modula-2, or Oberon, or Ada all of which are also designed for systems programming and all of which have been used in working OSes in the past (Pascal itself has been too, but it makes a poor choice in many ways; too many nonstandard extensions are required to make it a viable systems language).
Despite what some C programmers may say, Modula-2 compilers can generate optimized code that is comparable to the equivalent from an optimized C compiler. Optimization is a highly variable thing, however, and different languages will have very different results. It is very easy to generate efficient objct code from C code without any great optimization, but it is hard to optimize it any further because it's rather irregular syntax and semantics. Modula-2, by comparison, produces object code that is somewhat less efficient by nature (but not all that much so), but is much easier to optimize. When you get to a very high level language Scheme, the language lends itself to many advanced optimizations which would be nearly impossible to use for either C or Modula-2, but the unoptimized code it procudes is often extremely inefficient. As a result, a Scheme compiler may, on average, match a C compiler for efficency, but the C code will generate executables that are consistently optimized, while the Scheme executables may be either far more efficient than the C executables for some programs, or far less so for others. Much of this also depends on the compiler writer's skills and design, as well; two compilers for the same language, especially a very highh level one, may produce very different object code.
Re:The Perfect OS Programming Language
i have a final answer for you(that wasnt a "who wants to be a millionare" pun). use whatever langauge your best at, that is capable of writing a kernel(that means no java or VB, at least im 99% sure u cant use java). sure C and assembly are fast, but who here actually expects to make an OS that every day people will use? or that anyone will use? if your dreaming of linux, keep on. im quite sure your only writing an OS to learn more, as i am. in that case, making your code a few milliseconds faster wont really matter. use what your msot familiar with, i havnt even heard of some of thsoe languages mentioned above, but im quite familiar with c, and thats wat im gonna use. do thae same
Re:The Perfect OS Programming Language
funnily enough....no one has actually answered my question
I was proposing ideas for a new language suited to implementing an operating system, not the pro's and con's of using *real* languages...... although there were some interesting responses
I was thinking more along the lines of a language in which you could write the whole OS and boot loader, with out linking assembler, or inlining.
A more portable language.
Look up to the first post for my actual questions
maybe I should have underlined the new partIf you could design a new language for OS development...
I was proposing ideas for a new language suited to implementing an operating system, not the pro's and con's of using *real* languages...... although there were some interesting responses
I was thinking more along the lines of a language in which you could write the whole OS and boot loader, with out linking assembler, or inlining.
A more portable language.
Look up to the first post for my actual questions
Re:The Perfect OS Programming Language
I wouldn't make a new language...unless I really liked it ( if it was made )...I think C/C++ is perfect [ for me ].
Re:The Perfect OS Programming Language
no language is perfect it's just a tool we use to represent ideas as closely as we can. New languages will be developed over time to better aid programmers to implement more complex ideas.
Re:The Perfect OS Programming Language
"Better a C code in hand than 20 zillions of stupid company-called-state-of-the-art-technology stucked in your @$$"
Re:The Perfect OS Programming Language
I prefer C/C++ but, here is the problem. Whenever I want to write kernel code or an application for my kernel, I have to compile it under Windows. I wish I could compile from within my O/S. Porting a C compiler is no easy task. Even an assembler would be kind of hard but not as bad.
Re:The Perfect OS Programming Language
Just thought about this as I was redesigning my FS (For the billionth time ).
What would be handy would be a standard mechanism for creating/managing linked lists, b-trees, in fact pretty much all those useful search/ordering schemes. As it stands you mostly have to reimplement the scheme every time you come across another part of the OS that requires it.
Just a thought, and probably a selfish one at that since these are precisely the areas I'm struggling with right now .
Curufir
What would be handy would be a standard mechanism for creating/managing linked lists, b-trees, in fact pretty much all those useful search/ordering schemes. As it stands you mostly have to reimplement the scheme every time you come across another part of the OS that requires it.
Just a thought, and probably a selfish one at that since these are precisely the areas I'm struggling with right now .
Curufir
Re:The Perfect OS Programming Language
I'd like C/C++ to have somthing that lets you make even more of your own data types...somthing that can hold different amounts of values like it can only hold a 1-10 value..like in Pascal.
That'd be good
And a way to make your own types of values like a 5-bit interger...( i.e. make 4-byte value next to a 1 byte value so that can work ) so you can have simple int's that can hold huge values.
That'd be good
And a way to make your own types of values like a 5-bit interger...( i.e. make 4-byte value next to a 1 byte value so that can work ) so you can have simple int's that can hold huge values.
Re:The Perfect OS Programming Language
I know a 5 bit int would not be big...maby a 10 bit one