37 ms·
On the history and justification of the C programming language
- sam4ritan 10y agoThis makes a whol lot of good points. C is really not suited for most modern applications, and some of its design choices are questionable (to say the least). On the other hand: In my opinion, C is a good language to show beginning programmers how memory management is done. Basically, it could be a third learned language, after a scrip language (like python) and an OOP language (Java or C++).
- dalke 10y agoIt's hard to figure out which are the good points and which are hyperbole. "EDSAC was the second electronic digital stored-program computer to go into regular service" and with "the world's first assembler" dating from 1949, says the Wikipedia reference. As such, many languages can be traced back to that "Most Godawful Computer on Earth (TM)". Or, "4. ALGOL60 [4] had many nice features of languages today but was too theoretical: only existed on paper." Yet its reference 4, at https://en.wikipedia.org/wiki/ALGOL_60#ALGOL_60_implementations_timeline https://en.wikipedia.org/wiki/ALGOL_60#ALGOL_60_implementati... , lists a number of ALGOL60 implementations even in the 1960s.
- dllthomas 10y agoAlgol60 could never be taken seriously as a mainstream language, lacking Algol-like syntax.
- AnimalMuppet 10y agoAlgol60 lacked Algol-like syntax? In one sense, that's almost tautologically impossible. I presume you mean "like the other Algols", which makes it a non-absurd statement, but... could you expand or clarify what you mean here?
- dalke 10y agoI believe it's a joke. Gold isn't a gold-like substance because it is gold. Algol isn't an Algol-like language because it's Algol. If so, I don't believe it's a good joke.
- dllthomas 10y agoIt's a joke, but not the one you thought. The joke is that the syntax of Algol didn't actually look all that much like what people mean when they say "Algol-like syntax". No curly braces anywhere to be seen.
- dalke 10y agoAs my introduction to Algol-like languages was through Pascal, the joke completely passed me by.
- dllthomas 10y agoI could see that putting you in a place where encountering people misusing "Algol-like" to mean C-like, when trying to distinguish from something more like Algol, would be extra noticeable and annoying. Likely you have just been lucky :)
- dalke 10y agoI hang around computational chemists. They wouldn't say "Algol-like" in the first place. So, double lucky!
- nickpsecurity 10y agoHyperbole and reference will probably be worked on in next one. ALGOL mostly existed on paper or in complex compilers on expensive systems. The "computer" that is the EDSAC is not on that list. So, they would have to build their own ALGOL... a difficult thing anyway in that period... using a machine and process like this: https://youtu.be/6v4Juzn10gM?t=3m41s https://youtu.be/6v4Juzn10gM?t=3m41s Can you imagine trying to make a robust, fast compiler for such a weak machine in tape batches on that weak machine? I could understand them giving up with BCPL as a useful result on that machine. The cost-benefit analysis of using a PDP-11 like an EDSAC is opposite. Wirth et al showed you could do better. C inventors just liked BCPL. I'd understand if they used BCPL to bootstrap a Modula-2 or other ALGOL subset with good design. Instead, they kept trying to force BCPL to do something it wasn't designed for... wait, it wasn't designed period lol. It was just what compiled on a 1940's calculating device. It's bad foundations vs others' good foundations. Might have worked for them sure. Today, though, we need to know why they did it that way and why we definitely shouldn't if we don't absolutely have to. That's the point of the essay. Plus, to clear up associated misinformation.
- deleted 10y ago[deleted]
- moron4hire 10y agoIt's often said that you won't be a programmer until you understand pointers, but my own experience was the other way around: I didn't understand pointers until after I had been programming in languages like C# and Java for a long time. I had first started out in C, hacked around for a while, even made a few simple programs. But I wasn't ever able to get very far with it. My first Java app had me doing GUI programming right away and I was making things a lot faster than I could have ever done in C. The problem was, there are two things a beginner needs to learn: how to solve problems with programming, and the particular programming language they are using. So I think it's best to keep one of those things very, very simple. And you tend to lose a lot of people from boredom if that thing is the types of problems you're solving. So we have to default to the language being simple. Pointers and memory management are an implementation detail. They are important, but they aren't the job. The job is fulfilling requirements. Some days the requirements might be "fit inside this tiny box of memory", but it's far more likely to be "so, like, when I click on the link, the screen flickers. <you mean a new page loads?> Yeah, whatever, just make it stop flickering."
- pif 10y agoCalling UNIX Bad by Design... oh my gosh!
- hga 10y agoMuch of it is, because they had to squeeze big concepts like those from Multics into very small minicomputers. I don't know how much memory they had on their PDP-7, but for the original PDP-11 it would have been 64K each for data and instructions, with some of that almost certainly taken for the memory mapped hardware (one of the 11's innovations). The PDP-11/45 allowed a user program the same, with 8K taken from normal data space for the stack.
- gcr 10y agoIf you thought that was entertaining, you'll get a kick out of reading the old UNIX Hater's Handbook. http://www.vbcf.ac.at/fileadmin/user_upload/BioComp/training/unix_haters_handbook.pdf http://www.vbcf.ac.at/fileadmin/user_upload/BioComp/training... In particular, at least check out Page 36, showing an articulately hand-drawn Dennis Ritchie, in stoic defiance, blowing raspberries at UNIX critics through his thick-rimmed glasses. It's by far the high point of the book.
- loeg 10y agoThe nice part about the Unix Haters book is that the authors were actually familiar with their subject material :-).
- nickpsecurity 10y agoThe funny thing about gcr's comment is that I posted ESR's review of UNIX Hater's Handbook here before. He agreed with a good chunk of it while noting other stuff changed or was ranting. As for your comment, I came to C after using alternative, system languages that compiled faster, crashed less, and ran fast. After I figured out basics of C & read secure coding books, I said "F#$@ this!" It was an unnecessary and horrible development experience. So, I coded up a 4GL that let me develop in industrial BASIC that compiled to C apps with checks in to use their compilers and libraries. Macro'd out boilerplate. People thought my "C code" was fast and thorough but I never wrote in that garbage language except prototyping the tool. (Long gone so don't ask.) My application areas were OS-level stuff, games, AI, networked apps, and GUI apps. Shows how easy it would've been to ditch given I sucked at compiler design. Eventually, I discovered how it was created, that most proponents claims weren't accurate depiction, and did this write-up. Glad you enjoyed that I kept it close to subject material from its inventors. Meanwhile, the C inventors went onto design, with Pike's help, a better language that solves most of C's problems while maintaining a Wirth-like level of safety and development. Pick up Go language if you want to know what that experience is like. Personally, I'm more for a subset of Modula-3 with Rust's dynamic safety, SPARK Ada's extensions for correctness, and macro's for DSL, productivity benefits. Or efficient functional one with similar properties.
- myst 10y agoGood overview. Wrong conclusions.
- TorKlingberg 10y ago> There's a recurring theme where people think the C language's design is good for systems programming, even today. These people think that someone sat down, thought of every tradeoff, and made the best ones for system programming. Or, people think that a good practical language can only come from using it to solve real problems and iterating on the design. Sitting down and conjuring up the perfect language just does not work. Now, I am the first to agree that C has plenty of flaws. For one, the integer types are just a mess. I will be happy if something can replace it, but so far most attempts have ended up either too slow or too complicated.
- davegauer 10y agoWhat is your opinion of Rust? Does it fall under the category of "too complicated"? Or is it simply far too young to be proven yet?
- TorKlingberg 10y agoI'm curious about Rust but haven't tried it enough yet to form an opinion.
- dman 10y agoIntend to spend this years Christmas holidays catching up on Rust.
- alfalfasprout 10y agoRust is extremely interesting, but here's the thing: at this point it's going to be hard to dethrone a language like C++. Far too many excellent libraries exist for C++ and even recent but slightly more mature languages like Go will need at least a decade to catch up. Sure, you could write bindings but it's never going to be quite the same.
- nickpsecurity 10y agoThis is probably true. It also applies to Java, C#, PHP, COBOL, x86, and ARM. Although, it might be noted that various things on that list dethroned others in certain segments. Still doesn't matter. You don't have to dethrone anything. Just build an advantageous ecosystem with a good chance of short-term and long-term commercial support. Do that right, there will be uptake that can slowly build into something competitive. We've seen it happen numerous times with Mathworks (MATLAB), Borland (Delphi/Pascal), Eiffel (Eiffel), Microsoft (C#), Sun (Java), Google (Go), Mozilla (Rust), and Apple (Swift). Really useful and superior tech can also attract people into closer-knit, small, and high-quality communities as we see with Haskell. So, I tell people not to worry if vast majority will use your stuff. Just worry if a good chunk of them will find it useful enough to pick up and extend. Then you might make it. Note: A cheat I've already mentioned is making your language or whatever integrate with a popular one and its libraries. Clojure, in an anti-LISP world, is proof of how unusually effective that can be. The typical example is how most C alternatives can compile to C or use its libraries.
- hossbeast 10y agoThe conclusions do not follow from the facts presented
- dboreham 10y agoThis completely misses the key factor: (most) computers were not big or fast enough to run high level languages back then. So for people who only got to use small computers, they had to code in assembler (or cross-compile on a big computer). So anyone who could come up with a high(er) level language that would run on smaller machines was a winner. It meant the difference between a life of misery hacking assembler or a life of milk and honey coding in a high level language. There was no "Oh, let's be stupid and omit <safety feature du jour> from our language". It was more like "Wow, I got a compiler to run on that PDP-11/20 and it only had to be split into 5 passes to fit into core". There were many many simple languages back then that occupied this niche. Only C has survived into the modern era (thanks to open source compilers and Unix and Microsoft's adoption of C for WindowsNT). If things had turned out differently we would be complaining about the lack of safety in code stil being written in Bliss or IMP or PL/S.
- alayne 10y agoHuh? The conclusion was "the worst aspects of UNIX and C were intention design decisions that had nothing to do with what a good, systems language should look like and everything to do with limitations of an EDSAC, PDP-7, & PDP-11."
- emptybits 10y ago> This completely misses the key factor: (most) computers were not big or fast enough to run high level languages back then. The first paragraph leads with that key factor: "Even back then, there were better languages/OS's that cheap hardware just hadn't caught up to. That cheap hardware's limitations, and them alone, drove the design decisions of BCPL, B, and then C."
- stcredzero 10y agoThis completely misses the key factor: (most) computers were not big or fast enough to run high level languages back then From the 1st paragraph, that's what I thought they were going to talk about: totally contradicts real reasons why C is designed the way it is. Even back then, there were better languages/OS's [1] that cheap hardware just hadn't caught up to. That cheap hardware's limitations, and them alone, drove the design decisions of BCPL, B, and then C. But you're right, they're mostly talking about the compilers. So anyone who could come up with a high(er) level language that would run on smaller machines was a winner. I think that's what the Objective-C folks were thinking. I guess the author would lament that they chose C as the other partner. Only C has survived into the modern era Forth was around in those days. So was Smalltalk and Lisp. So maybe, "survived as more than a niche language?" (Forth and Smalltalk are really from the 70's. You could argue that only Lisp is from "those days.")
- CrLf 10y agoThe best things always have detractors, yet they live on. C is over 40 years old and is still in widespread use today, even though there have been (supposedly) better languages targeting the same use cases for decades now. There is more to it than just inertia. I've been using it less and less over the years, mostly because I've also been tackling less and less problems in the domains where it excels. It is still my favorite language though.
- gautamdivgi 10y agoDefinitely agree there. I've moved through several languages - c, c++, java and now python. Over the years my work has progressed from real hard development to more of an analysis & design & architecture role. So, when I decided to get back in touch with programming and complete problems on online judges as a hobby - I just went with c/c++ (c++ just to use the template library).
- optforfon 10y agoI respectfully disagree. I think C is a giant disaster that will continue to plague us entirely due to inertia. You're really underestimating how entrenched it is. Try to go program on micro in something other than C. Try programming a driver. The toolchains simply don't exist - the comparability with several decades of work is also shaky. C is a terrible cross platform assembly b/c it doesn't allow you the level of control which one would expect in this day and age. Maybe it was written in the days when CPUs were brain-dead simple, but basic things that are available on most architectures aren't part of the language. It has no notion of a CPU cache, it has no notion of branching (you can't tag a likely branch and an unlikely one), it even goes as far as to ignore user keywords for inlining and provides no keyword for blocking inlining. RVO is implicit magic that you just pray happens. Const != immutability. When you write C you have no notion of what the compiler is going to output whatsoever A lot of these things are available through compiler extensions (so great, now it's not cross-platform), but even still the language is broken. "Expert C Programming" has a really long chapter that goes over all the more confusing subtly problems C has beyond just arrays being pointers-but-not-really. I have to use C pretty regularly and all I can think is "God.. why hasn't anyone made this better yet"
- stephen82 10y agoI remember reading an answer on Quora by a professional C developer why none of existing newly designed programming languages will ever replace C and to be honest with you, I agree with him. https://www.quora.com/Which-language-has-the-brightest-future-in-replacement-of-C-between-D-Go-and-Rust-And-Why/answer/Roger-DiPaolo https://www.quora.com/Which-language-has-the-brightest-futur...
- nickpsecurity 10y agoI'll review it for you as a C opponent who used C and safe alternatives at various points in time. 1. C is popular. Means nothing for its approach since COBOL, DOS, and VB6 were massively deployed. He'd not endorse them I bet. It won't go away, though, due to socio-economic reasons. 2. C is popular No 2. In embedded with same result as above. Meanwhile, there's embedded projects in subsets of Ada (lots of these), Haskell (Galois Ivory or Atom), Oberon (see Astrobe), BASIC (mikroBASIC), Pascal (mikroPascal), Python (microPython), LISP (L lang/Franz), Ocaml (OcaPIC), and ATS language (8-bitter). A few of these have serious advantages over C. One is niche industry with tens of millions probably spent. 3. C has ecosystem advantages. Definitely true for C and many others. Fortunately, you can use C's ecosystem using what's called a FFI. You can compile to C. So, you can avoid C at your level while benefiting from it. Replace the pieces gradually if you want. Rust is an example of better language trying to integrate well w/ C ecosystem while letting you incrementally rewrite it. 4. "C just works." Propaganda piece in action. C ecosystem is legendary for problems at compile time, build time if 3rd party, and runtime. Even pro's make common mistakes. On other hand, Ada (esp SPARK) and Haskell will tend to run without crashes if you can get them to compile. You have to really work to cause as many problems as average coder runs into with C. 5. "C is, and was designed to be, a “portable assembly language”" This is a myth I demolish in my article above using primary, source material. C was meant to code on three, specific machines with specific philosophies. It inherits their traits in ways that help and harm. It was ported because it was so small & limited. Incidental. An example of portable assembly language is P-code Wirth created to make Pascal portable. He knew writing compilers, standard libraries, OS's, etc was too much for average developer. So, he made an idealized assembler that was super-easy to port. He targeted compiler backend of Pascal/P to generate P-code. They just port P-code then get all the software using same, reference compiler. The result was Pascal was put on 70 architectures in about 2 years varying from 8-bitters to mainframes. I'm still curious what the number and timing was on C ports for comparison. 6. "Your garbage collection, your classes, your libraries and APIs" Alternatives like Modula-2 were about as simple as C just safer, easier to compile, and with less problems. Light, manual C vs heavyweight, OOP, Java or C# is false dilemma. Especially given my list above. Author has done no research in safe, systems languages. I could stop knowing that but I'll be a good sport. :) 7. "C is not a language for programmers that need to be babysat or have their hands held. If you can’t deal with managing your own arrays manually" This kind of counterpoint was originally directed at C itself by assembly and Fortran programmers. It embeds the false assumption that a person with limited time, energy, and focus should spend that on micro-managing a machine because a language designer told them to. If that's unnecessary, that person shouldn't be doing that & it follows C is a waste of time/energy. If it's occasionally necessary, a good language will allow you to optionally do that only where needed. If it's not necessary, a good language will do it for you quite efficiently. A great language will allow all three. Keeping complexity low, I'd say Wikipedia's Modula-3 page illustrates such a language. One neat use was in SPIN OS that could safely load code into a running kernel for acceleration. So, the author points out popularity has advantages, ignors our ability to use it regardless, pretends C ecosystem is seemless, misinforms about portability, only compares his apple to oranges, and tells people to waste time just because. Terrible defense of C. I've seen some decent ones and plenty of use-cases I agreed on for practicality. This just shows the author has done almost no research on the subject past reading some proponents' claimed advantages on their marketing pages.
- agentultra 10y ago... as if all development of C stopped with the first ANSI standard? C99 and C11 are great languages. VLAs, anonymous structs, variable initializers, atomics... they're not the C of the 80s and 90s. They still have the usual warts but the tooling is great and support is coming along for the newest features to most platforms. While the spirit of, "trust the programmer," might have been a historical accident there is some merit for its usefulness. Our chief problem as programmers is managing data: taking some source inputs, performing a transformation, and sending the output somewhere. That's true of video games, web applications, embedded sensors, etc. As a high-level language, C is one of the few that gives the programmer some control over how memory is mapped to the target platform and allows them to build the appropriate abstractions on that hardware. It's also a loaded weapon... humans make mistakes and inevitably those mistakes make it into our programs. When working in a language like C one must conduct ones self accordingly. I'm a fan of FP and ML-style languages. I'm looking forward to a day when we can have our cake and eat it too. It'd be nice to be able to define how memory should be handled for a particular application at the granularity of the target platform while still getting the safety guarantees. I like where Blow is going with his Jai language. It'd be neat to see more research in this area.
- pcwalton 10y ago> C99 and C11 are great languages. I think the amount of undefined behavior in C--and that undefined behavior is necessary to compensate for its design mistakes (e.g. signed overflow)--disqualifies it from being a "great language". Empirically, virtually every single large C program in existence depends on undefined behavior to continue working. And that UB is very difficult to spot [1]. > It'd be nice to be able to define how memory should be handled for a particular application at the granularity of the target platform while still getting the safety guarantees. > I like where Blow is going with his Jai language. It'd be neat to see more research in this area. You said that you wanted safety guarantees, but Jai is explicitly not about safety guarantees. In fact, being memory unsafe is one of the key design criteria behind the language. That's what differentiates it from for example Rust. [1]: https://news.ycombinator.com/item?id=11728324 https://news.ycombinator.com/item?id=11728324
- 10y ago
- moron4hire 10y agoEDIT: I got lost in the comment thread. I was intending to reply to this article: https://www.quora.com/Which-language-has-the-brightest-future-in-replacement-of-C-between-D-Go-and-Rust-And-Why/answer/Roger-DiPaolo https://www.quora.com/Which-language-has-the-brightest-futur... Do Go, Rust, or D programmers really fantasize about their language replacing C in any other context than their own work? The article setups up a huge strawman of a caricature of a person to start and then uses really rather spurious arguments to take pot-shots at that strawman. But just some easy ones, right off the bat: "C is not a language for programmers that need to be babysat" I think the number of buffer overflow exploits that we have seen in the wild over the years indicates that C programmers really do need to be babysat. If you're starting a project and you say "let's do it in C", the rest of your team needs to be taking a really hard look at you and asking, "and just who do you think you are?" I have never met anyone who knows how to program in C "correctly", because those that have opinions on how it's done always seem to be at odds with some other cohort that is equally convinced of their own superiority.
- ArkyBeagle 10y agoIt's possible to write perfectly correct[1] code in 'C'. It's just that some people can't be bothered, and they can't be bothered because it's somewhat tedious. [1] not to C.A.R. Tony Hoare levels of "provably correct" , the other sort of correct. Pre-open source, I never saw buffer overflows. When I was dealing with full time, professional 'C' coders, this didn't happen. Because we all talked to each other and taught each other how to not do that. It's like any other skill or bundle of habits. I did see the odd "signed integer going negative" or other integer overflow problem, but that was much more about broken analysis and flawed testing. Yeah, it took a little more time to make sure this was the case, but it was just required.
- nickpsecurity 10y agoArkyBeagle must have worked with some talented people. Most of the programmers, sloppy or rushed, made enough of specific errors they became the top 10. This included proprietary systems given Microsoft was in the lead on bug-count due to bugs in product and market share (i.e. targeting). Their choice was a combo of stronger review of unsafe code, introducing managed code to get rid of it everywhere possible, and huge investments in various, formal verifications. Their 0-day rate very low these days to point attackers hit 3rd party applications, usually also in C or C++. They said it cost many millions to do that bug-hunting, though. Might be cheaper for next shop to just pick a language that's easier to do correctly. Someone giving that hard look as you stated saying, "Bro, have you even heard of Ada, Go, or Rust? And you still want to suffer through making a robust app in C? Why!?"
- AnimalMuppet 10y agoC is horrible but Algol60, CPL, and Algol68 were wonderful? Um... sure. (Backs away slowly...) This reeks of ideological blindness, of having reached a conclusion and then throwing mud to try to support it, no matter how biased a twist on the facts it takes.
- dleslie 10y agoThe author snorts at aspects of C that led to its commonplace usage. > 9. New design goal: trim out anything hard to compile from CPL. Naturally eliminates most features for robust and maintainable programming. Naturally? If those features are hard to compile, then they are hard to reason about; the author begs the question in their statement, but I am not convinced by their conclusion. There's a tendency for things which are hard to reason about to be difficult to port to other systems; it is a complexity issue, and the complexity of a behaviour influences how it can be re-implemented easily or swiftly by others. > 11. The result of these was BCPL [5]: a typeless, word-oriented language with few keywords and unrestricted use of memory. Created philosophy of "the programmer is in charge and gets no help." Compiler was easy to write on Most Godawful Computer on Earth. Ran fast on it, too. Great! Sounds like BCPL was an excellent tool for their use case, and in providing power with a low difficulty for implementation, it would be easy for others to enjoy its benefits. > 14. [...] Stripped out or changed most features benefiting safety/security, maintenance, and consistency. Because they were unnecessary. Don't over-engineer your products, or you'll end up with a product that fails in the market; like MULTICS. It's like they learned a thing or two from their past ventures. My Conclusion: C and Unix succeeded because they were simple to re-implement and/or port. Other, more complex systems were too hard or near-impossible to re-implement and/or port. At a time when good, cheap software was in-demand but scarce the pair were well-positioned to sweep the market, and so they did. Unix may have failed to reach the desktop, but C made it there; because it was easy to implement, had a small foot print, and produced fast code. It's not like C and Unix stopped development, either. Let's not ignore the last 30 years, now.
- spc476 10y agoRecursion today is easy to compile, but it's something that is hard to support on some older architectures. For instance, you would have a hard time (if not outright impossible) supporting recursion on a PDP-8, which stored return addresses at a fixed location (so subroutines are inherently non-reentrant). For a fun time, try implementing a C compiler for 6502. 256 byte stack, 8 bit index registers, single accumulator, 64K RAM max (which only became affordable in the mid 80s). Those are the types of constraints compiler writers were facing at the time. "Features" weren't hard to compile because they were difficult to reason about, they were hard to compile due to physical constraints of the hardware.
- raarts 10y agoIn a world that is overflowing with competing and incompatible operating systems, it's the most portable and fast language that wins over the hearts of those writing software.
- stcredzero 10y agoI imagined this being read by one of the Honest Trailer guys.
- nickpsecurity 10y agoThe OS won due to a number of factors. The language came with it. Then, as the OS spread, the compilers for its source language spread. Then that language was everywhere. With that OS and language everywhere, esp on cheap machines, ecosystem effect kicks in from there where people start building on, using, or targeting it. Most portable and fast language isn't why it succeeded as UNIX could've been built with alternatives. UNIX itself was the killer app that caused C to flourish.
- planteen 10y agoI assume the author meant Bjarne Stroustrup for items 20 and 21. It's spelled wrong twice, as Bjourne and Bjourn. > Conclusion 3: C and UNIX should be avoided where possible because they're Bad by Design for reasons that stopped applying sometime in the 80's or early 90's. What does the author propose instead? Is there a major OS that has a kernel not written in C?
- AnimalMuppet 10y agoAnd, "designed to deal with a certain set of limitations" != "Bad by Design". The latter implies malice. The author seems to wish that Algol had won instead. I can't imagine that the level of complaining would be less in that hypothetical world...
- nickpsecurity 10y ago" I can't imagine that the level of complaining would be less in that hypothetical world..." We don't need to hypothesize as Wirth and Hansen took the path of subsetting and improving ALGOL instead of BCPL. We get to see the result. :) The C alternative would've been a subset of ALGOL like Modula-2 or something. Gradually-improving type-safety, memory-safety by default, option to remove checks for performance, modules, less undef behavior, better linking, easier analysis for optimization, and quicker compile/test cycles. Having coded performance-sensitive applications in languages like that and C tells me the level of complaining would be much lower if it's in any way tied to number of vulnerabilities, time spent debugging, or ease of modifying legacy systems without major breaks. It's also not hypothetical: all kinds of developers use such languages. C is the exception to the rule these days. Even in UNIX & C's domains, there's new comers kicking the crap out of it in terms of balancing development speed, production speed, safety, and extensibility. Redox in Rust comes to mind given the OS and language attempt a Right Thing approach to bootstrapping an OS with small team. Progress has been impressive.
- dalke 10y agoPerhaps the IBM operating systems? https://en.wikipedia.org/wiki/IBM_zEnterprise_System#Operating_systems https://en.wikipedia.org/wiki/IBM_zEnterprise_System#Operati... . I can't tell what they are written in. Their heritage extends to before C existed. It also depends on where your major/minor cutoff is located.
- gravypod 10y agoI think a large problem with this is that people unreasonably idealize the features of ALGOL 60 and many other "Perfect Systems Languages" The issue is that there are not any major open source projects to examine that use these languages to see how they actually work in the wild. For example, writing a Java codebase with nothing other then the standard library you can do some very nice design patterns. You can come up with some very clean and concise code and everything can be perfect. Then, when you go to integrate with someone else's code (see Spring) you notice that everything becomes a mess since they are using some crazy things that make it very difficult to integrate with it. Due to this it's impossible to say how well another language would behave in the wild since I don't think anyone can predict how well the language will be used to it's extent. That being said, I think C succeeded because it was SIMPLE. Not only for the compiler, but I can teach pretty much anyone how to understand C in most likely a few days to a week. It's very simple and very little you need to know to understand how to start writing your programs. On the other hand, ALGOL is MASSIVE. There are 106 reserved identifiers in the language according to wikipedia and I don't think I could ever remember what every one of them did. Currently C has about 32 key words and I can tell you in full detail what every one of them means except union as I don't work much with C. This is good for the beginning programmer since it shortens the time they need to hit the books and helps them jump strait into writing. Something that's good for the advanced programmer, in my opinion, is the use of braces and not words. I know this is kind of controversial but I do honestly think that a code should be easily segmented by the eye not readable. Begin and End only help so much and by so much I mean not at all. Words should not be syntax in my opinion. Seeing { } is less to look at and understand then seing Begin and End. This sample phenomenon can be looked at from the recent Linux 1000 patches debacle. Linus said he didn't want to replace unix file permission numbers with the symbolic values. Why? Because it's much much faster for someone to see the numbers and know what's going on then to have to read a bunch of text. It's much quicker in parsing. That's where the breakdown comes in these discussions. People will throw "You've never used these, how do you know yours is faster." While that's true that doesn't really present a good argument for changing everything. I also hate needing to type := for assignment. It makes no sense. Fixing the beginner issue of missing the second equal sign in an if statement has a much simpler fix. Use some kind of IDE/Editor with a linter. You'll not have this problem.
- nickpsecurity 10y ago@ Tomte Thanks for posting it as the comments have valuable feedback. I was holding off on responses until it dropped off the front page to let the discussions happen unimpeded. I can already see ways to make the case more clear. What I haven't seen is any contradictory evidence supplied with citations about (a) why C's justifications then no longer apply outside maybe embedded or (b) why it was better a design level than others. A few, good opinions, though. A few comments also have some misinformation on C the article itself addresses despite citations in article... from inventors of BCPL and C... directly contradicting their claims. That's the psychological effect I mention where cause and effect being so far separated in history that affected people not knowing bad causes (or no longer applicable ones) start inventing better, false causes to reinforce their choice of language or faith in its design process. All in all, I've enjoyed reading the feedback on my ranty summary of that Vimeo vid I did in half an hour or so after doing a C debate. I did condense hours of watching/reading into something digestible but presentation is still shit in a number of ways. Many of points survived with others needing to be improved or replaced to make case clearer. Will do in near future. :)