I’m not a Fortran developer myself, but I’m about to use it a little and found myself wondering why, if it is much older than C but equally as performant as C, was it never used to develop any operating system before C and UNIX came along?
A substitute answer, if the above is invalid, might be which operating systems were developed in Fortran. But still, it didn’t seem to catch on at all.
11
I’d say that Fortran, even of pre-C times, abstracts the programmer from hardware details too much.
- No pointer support. If you want to pass large amounts of data between subroutines, you use a
COMMON
block, and you don’t control its allocation. Pointer arithmetic and structure allocation control are hard to non-existent. - Data types are numeric-oriented. Referring to a particular byte is a bit hard, let alone bits.
- I/O is provided by language statements, not by subroutines. You depend on the compiler’s runtime for it, and cannot roll your own.
This is off the top of my head; last time I wrote Fortran-IV code was ~25 years ago.
Possibly you could alter a Fortran compiler to introduce the missing capabilities. But building a special-purpose ‘portable assembly’ language like C proved to be easier and more effective.
5
Who says FORTRAN was never used to develop an operating system?
Prime Computer’s PRIMOS was written in FORTRAN. I first encountered it in 1982, but it had been around for a while already. There was some assembler, but no more than there was in Unix, which is largely described as “written in C“.
No.
Aside from structural issues of lack of pointers and access to hardware that is typically necessary for operating system design (fortran is too abstract), fortran also had a significant issue with different versions from different manufactures being, well, different. Fortran 66 was the first industry standard version (before fortran 77), but even with these standards there were many other versions out there.
There were also other languages which did offer the necessary access to memory as memory, and hardware, and a bit less abstract. You had PL/I from ’64 which was used to write Multix. BCPL and B from ’66 and ’69 respectively were also used for operating system development. And then there was and C from ’72. And one shouldn’t forget the MCP for the Burroughs B5000 written in Algol in ’61 (compare with Fortran being introduced in ’58).
All of those better languages were better choices for operating system design – and were used for various operating systems. They were standardized, cross platform and stable in a time when Fortran wasn’t well standardized and programs that ran on IBM might not run on Digital equipment. They also were availabe very shortly after fortran and people started thinking about writing an OS in a language that was no longer seen as slow (compiler technology and optimizations were staring to catch up to hand coded assembly).
So, no. There was no reason to write an operating system in Fortran when there were much better tools available for those who wanted to take it up. As fortran as a systems language isn’t recorded in the history while other ones are, and it certainly would have been notable it is probably safe to say that no serious operating system development has been done in Fortran.
From a Fortran 95 handout:
Not being a general-purpose language, there are some things Fortran is very bad at. Anyone trying to write a compiler or operating system in Fortran is probably mad or about to become mad. However the ‘old’ University Library electronic catalogue, which is soon to be replaced, is written in Fortran, even though this is far from the sort of application for which Fortran was designed.
5
BTW, the significant portion of VMS (Digital Equipment Corporation) was written in FORTRAN 4. If you ever have a chance to see dumps e.g. on VAXVMS, you will notice it imminently.
B.E.S.T.
Fortran is a LINEAR programming language and is ill suited to the development of an OS.
The C family of languages are OBJECT ORIENTED PROGRAMMING (OOP) languages. They allow non-linear programs to run multiple, simultaneous routines, branches, sub-routines, all without unnecessary complications.
Think of Fortran as a pipe carrying water from point A to point B. Think of OOP languages as an ocean stretching from shore to shore, doing all sorts of things, all at once.
3