@ Brendan:
Please understand me correctly. I'm not trying to discourage you, or tell you you're doing something wrong. I just want to make sure you realize the implications of your decisions, which are significant.
Brendan wrote:
Under MINGW it compiles and runs, but it creates a console window that disappears before anything can be read.
That's an issue of current GUIs handling console applications badly. (IIRC, AmigaOS would pop a window titled like the executable, and reading "Hello World!" until you close it). Of course the standard output of applications has to go somewhere, but that's for your runtime environment to handle, not the application in question (which is allowed to be as simple as possible).
Under windows it'd look much better if a dialog box was used instead (same goes for KDE/Gnome/X) - after all who wants software that looks like a 1970's dumb terminal?
Someone who wants to write up a quick&dirty solution? Testing whether the compiler works, without writing up some lengthy GUI code?
I wonder what the standard library call for creating a dialog box is? Hmm - there isn't one. It seems that if this code is written with any professionalism it isn't portable anymore. Pity.
Wrong notion. C (and C++ as well) don't go into GUI, networking etc. because they want to leave all options in
your hands. They just define bare necessities.
Languages like Java go into great detail on how a GUI has to be constructed, in
addition to defining a standard-in and standard-out - leaving you
less design leeway, not more.
Are the standard file IO functions (fopen, fgetc, fread, etc) ANSI?
They're standard in all application programming languages I know of. You'll have a heyday implementing "your way" in all these languages - or waiting till judgement day for others to adapt widespread languages to your niche OS.
If so I won't be supporting them - my OS doesn't do blocking file IO...
What keeps you from implementing
both? A blocking wrapper called fopen() around your non-blocking OpenFile()?
If your asynchronous OpenFile() is useful, people will use it. If it isn't (or people don't know about it), they will use fopen(). There is any number of reasons for people to use fopen() - because it's simpler, they're used to it, they want their tool to run on other platforms too... doesn't matter. Providing fopen() betters your chances of getting
software for your system, of overcoming
the chicken and egg problem. And the pain for you is near neglectable, especially with ISO C being a very small standard (and virtually every other language capable of being implemented in C).
Make it easy for people to migrate to your system, and - even more important -
make it easy to migrate away again (highly recomended reading, that article!). Software is the lifeblood of any OS!
My OS is designed from scratch without any consideration for current programming methods.
Absolutely ACK. My OS is designed the same way. But every time I come up wih a nifty new design, I ask myself two things: 1) "Does it improve things for the programmer and / or user?", and 2) "Could I possibly add some compatibility with the old ways without compromising my design?".
I'm not even sure I'll have a C compiler, as currently I'm leaning towards a language with syntax remotely similar to BASIC (which would be both interpretted and compiled).
But
other people
will want to code in their language of choice. They
will add such wrappers around your nifty OS API anyway. Doing so in advance will make your OS a friendlier place for all of them.
You'd be surprised how few developers can be convinced to use a better mousetrap if it's sitting right in front of them, if it means to leave the old ways behind just right now. Smoothen the path, so they can run their crufty old stuff on your OS, getting used to your superior designs one by one.
I fully accept that I might have difficulty getting other people to write software for my OS. This is fine (and likely regardless of what I do)
I understand your approach, but there's a difference in avoiding crippling legacies and needlessly crippling your OS. Just make sure you're making your design decisions for the right reasons.
Again, someone
will attempt to write / port a C/C++ compiler for your system. You could make his work a charm, a hell, or nigh impossible. All the while he's trying to work
for you...
OK, I've fielded all I had to say. No more ranting on this subject.