4 ms·
> Memory safety by proof was coming along well in the early 1980s. Working systems existed. Automatic prover technology was working. Then came C. K&R was publi
by haberman 8y ago
> Memory safety by proof was coming along well in the early 1980s. Working systems existed. Automatic prover technology was working. Then came C.
K&R was published in 1978. So at best this story and timeline are incomplete.
More illuminating would be an account of why C beat these other languages in the marketplace in the 80s, despite its disadvantages in safety.
- pjmlp 8y agoEasy, it came with an OS, given away for a symbolic price, with source code tapes alongside. Had Bell Labs been allowed to sell UNIX at the same price as other companies were selling theirs, and C would never have taken off. Burroughs, developed in 1961 in a memory safe systems programming language is still sold by Unisys as ClearPath MCP. Same applies to the IBM mainframes. The surviving systems from the 60-70's where C only plays a guest role at most.
- v_lisivka 8y agoBecause, C is portable assembler. In Pascal, for example, if something cannot be done in Pascal, then assembler must be used. If assembler is used, then program is tied to single platform. If you need to support two or more platforms at same time over long period, then C wins.
- pjmlp 8y agoThat is the myth, in practice ISO C specifies an abstract machine and libc is impossible to be written 100% in ISO C, some functions require either external Assembly or language extensions for their implementation.
- int_19h 8y agoI would also be curious what are all those things that C can do but e.g. Modula-2 cannot, when it comes to being a "portable assembler".
- pjmlp 8y agoNaturally Modula-2 also faces the same issue. What it offers is better type safety and being honest about it. The whole point is that contrary to its sales prospect, not only does C also require to write Assembly, it doesn't have any language support for modern hardware CPU/GPUs, just like any other high level language, requiring extensions to the standard, not necessarly portable across implementations.
- v_lisivka 8y agoToo many years are passed, but as far as I remember, only C code was portable between 8, 16, and 32 bit platforms. It was possible to incrementally convert program from assembler to C and then port to different platforms, but it was not possible to do conversion using Pascal, or other programming language.
- pjmlp 8y agoYeah, if you were writing using a safe subset across all C variants that happened to be supported across all those C compilers. Check language support across Small-C, Turbo C, Quick C, Aztech C, Metrowerks C and many others from those days. Likewise it was possible to do the same across Pascal compilers that implemented variants of ISO Extended Pascal/UCSD Pascal, Modula-2 and a couple of other high level languages.
- afiori 8y agoC the language can be portable even if the libc is entirely in assembly. Of course you assume to have compiler/std on the platform you want to use it.
- pjmlp 8y agoThat capability is shared among all high level programming languages, nothing special about C here, once upon a time it was also only available to UNIX users.
- afiori 8y agoMy understanding is that C/UNIX were together portable between platforms. Portability of C between OS was relevant mostly later.
- yawaramin 8y agoThere is nothing wrong with the timeline. K&R may have been published in '78 but it really took over the industry by the '80s.