7 ms·
ALGOL had almost everything that C had including portable types at least 10 years earlier: http://en.wikipedia.org/wiki/ALGOL http://en.wikipedia.org/wiki/ALGO
by acqq 15y ago
ALGOL had almost everything that C had including portable types at least 10 years earlier:
http://en.wikipedia.org/wiki/ALGOL http://en.wikipedia.org/wiki/ALGOL
and really innovative guys, Burroughs computers had their operating system written in an ALGOL dialect:
http://en.wikipedia.org/wiki/Burroughs_Corporation http://en.wikipedia.org/wiki/Burroughs_Corporation
all before C. Personally I appreciate the terseness of C and its closeness to assembly a lot, and I believe it all reflects the good taste of Ritchie, but still he didn't do anything "impossible" from my perspective.
To compare, you can read again:
"The Summer Of 1960 (Time Spent with don knuth)"
http://news.ycombinator.com/item?id=2856567 http://news.ycombinator.com/item?id=2856567
where Knuth writes an ALGOL compiler for Burroughs in 1960 working 40 hours a week in violation of Cal Tech's policy that limits the number of hours that a Ph.D. candidate can work.
- kragen 15y agoYou are mistaken. From the article: > There was no such thing > as a general-purpose program that was both > portable across a variety of hardware > and also efficient enough > to compete with custom code written for just that hardware. And that is true. You couldn't run the Burroughs 5000 Master Control Program on a PDP-11, as far as I know, at all, and certainly not efficiently. Ten years before the birth of C was about 1963. ALGOL-60 lacked a lot of things to compete with C, which is why people in the 1970s switched to C. ALGOL-68 required garbage collection, which wouldn't be reasonably efficient until the invention of generational GC in 1983, and still poses problems for real-time software like device drivers, which is why people usually use C or C++ instead of ALGOL-68 or Java for them. For some notes on what ALGOL-60 lacked in comparison with C, I recommend reading "Why Pascal is Not My Favorite Programming Language", from 1981: http://www.lysator.liu.se/c/bwk-on-pascal.html http://www.lysator.liu.se/c/bwk-on-pascal.html. Most of the objections to Pascal also apply to its ancestor ALGOL-60, although ALGOL was intended for real work, not just teaching. ALGOL-60 did have a sort of equivalent of pointer parameters, namely Jensen's Device, but it was dramatically less efficient than pointers. I think (I wasn't around in the 1960s) that ALGOL implementations from different vendors had different nonportable extensions to work around the lack of pointers, and of course the same thing happened with Pascal later. Burroughs was an immensely innovative company, and all of today's popular programming languages except C, C++, and PHP (JS, Java, C#, Python, Perl, Ruby, Objective-C) owe an enormous debt to Smalltalk, which draws much of its inspiration from the B5000. I do not deprecate the importance of Burroughs! They did indeed write the first OS in a high-level language. But C achieved what they could not. The measure of C's achievement is that in 2011, on a multiprocessor 32-bit machine with the x86 instruction set and a gigabyte of RAM, I still occasionally run programs originally written in 1981 for a single-processor 16-bit PDP-11 with 64k of RAM per program, and they're still efficient; and I still constantly run software written in the late 1980s, such as parts of the X server and much of GNU coreutils, on single-processor 32-bit 68000s, and much of the optimization done then is still valid. (Though not all of it!) It was C that first made it practical for people on different architectures to share code on a large scale, for code to outlive the architectures it was written for without suffering a dramatic slowdown, and for people to switch architectures, as Sun did from the 68000-family Sun3 to the SPARC, as everyone eventually did to the i386 we use today, and as we now are to AMD64. The SNOBOL Implementation Language, SIL, achieved the same thing in 1966 — but only for one program, the SNOBOL interpreter! TeX was another early endeavor in this direction; concurrent with the early evolution of C, Knuth wrote WEB, a literate programming language which compiled into Pascal, in order to get Pascal's portability without suffering from its drawbacks. Among other things, WEB used a single humongous Pascal packed array of char for all of its strings; and that was what Knuth wrote TeX and Metafont in. C's twin sibling Ratfor was a third similar approach, compiling C-like constructs into Fortran rather than assembly. I don't know of anything else that predated the popularity of C. In effect, C enabled both the birth of the SPARC and its death. Today we stand at or near the end of the C era, for three reasons. First, a vast amount of software is being written for which efficiency is of minimal concern. So C's drawbacks — its proneness to subtle bugs, its difficulty of debugging, its limited facilities for abstraction — drive people to more modern languages. Second, dynamic recompilation has reached a level of performance where it's feasible to use it to emulate another processor architecture at acceptable speeds. Transmeta was one of the most interesting explorations of this concept, but Apple's transition strategy from the PowerPC to the i386 probably had more field-deployed units, and I think some of the currently popular OS virtualization approaches work this way as well. (And of course there's Valgrind, although calling its speed "acceptable" is a bit of a stretch.) So now there are viable alternatives to the recompilation approach. Third, both computer architectures and compiler optimizations have changed so much in the 40 or so years since C was invented that C is stretched rather thin. Compilers exploiting undefined behavior makes it increasingly difficult to write working code in C, or to recompile old C programs. And, although people largely program GPUs in C, you cannot simply recompile Emacs for your Fermi or your Spartan-II to get it to run faster or use less energy. The C abstract model of computation is an increasingly poor fit to modern hardware, despite the pressure it has exerted on hardware designs for the last 25 years. ๛
- acqq 15y agoI'm not mistaken, only you appear not to have experience with FORTRAN and Pascal. > There was no such thing as a general-purpose program that was both portable across a variety of hardware and also efficient enough to compete with custom code written for just that hardware. Of course ALGOL easily matches this claim. Proof: Knuth's TeX was written in Pascal. Not to mention everything that was written in FORTRAN. > I still occasionally run programs originally written in 1981 for a single-processor 16-bit PDP-11 with 64k of RAM per program, and they're still efficient Try to check when most of the FORTRAN libraries still used today were written. Some -- decades before 1980. See also how long FORTRAN compilers generated faster scientific code than C -- for decades after C appeared. You can also find why: http://en.wikipedia.org/wiki/Pointer_aliasing http://en.wikipedia.org/wiki/Pointer_aliasing > "Why Pascal is Not My Favorite Programming Language" The paper, as far as I remember, doesn't claim impossibility of writing useful software, mainly laments for the lack of return, break, continue constructs, which are convenient to have but not real show-stoppers. Note also that Pascal standard features are just to be a "learner's language" not a "system language" -- for which there were working compilers and uses before C. > You couldn't run the Burroughs 5000 Master Control Program on a PDP-11, as far as I know, at all, and certainly not efficiently. You'd also have to port Unix the same way you had to port MCP -- you can think of MCP as Unix in which drivers are part of the kernel -- but "integer" in ALGOL is certainly as portable as "int" in Unix -- they both fit the "hardware word." Nicer pointer arithmetics in C is a good point. Though note that Wirth also had "Pascal lite" with pointers and which was closer to assembly for OS-level stuff just as Burroughs had ALGOL lite for OS-level stuff. The concepts of "closer to assembly" but higher-level languages existed certainly well before C. The idea to separate kernel and drivers is something else, and I don't know who achieved that first and when. Finally, see Google's go -- it's more or less acceptance of Wirth's directions, mixed with terser notation of C. (Now, finally, why are you still on my lawn?) > The C abstract model of computation is an increasingly poor fit to modern hardware No, you can observe C (as well as more or less all ALGOL descendants) as a higher level representation acceptably close to assembly, so as long as there are CPU's which execute machine code and we need to care about details (see http://news.ycombinator.com/item?id=3068513 http://news.ycombinator.com/item?id=3068513) we'll need something like that to have efficient and not too low level representation.