[HN Gopher] The C juggernaut illustrated (2012) ___________________________________________________________________ The C juggernaut illustrated (2012) Author : susam Score : 23 points Date : 2023-02-02 10:08 UTC (2 days ago) (HTM) web link (utcc.utoronto.ca) (TXT) w3m dump (utcc.utoronto.ca) | cesaref wrote: | From my perspective, there is a certain truth to this. I started | out as an assembler programmer in the early 80s, just a kid | messing about with the machines of the time (Z80, 6510 based). | There was BASIC on various machines, but it was slow and clunky, | and you just didn't get enough control or speed to do the things | that a kid in the 80s wanted to do (write games!). | | When I first came across C, it was around the time i'd been | writing 68k for the first time, and intel assembler was very | confusing, and already had a heap of different models to | consider. | | So, C allowed the majority of stuff to be written once, with | calls to library functions written in assembler. All of a sudden, | we went from 0% portability to 95% portability. C could be | written like assembler, basic types which map directly to | registers and memory locations, and so really it was a simple | step to write not great C, with obvious benefits. | | The first non-C language I came across was Fortran, closely | followed by Modula-2, and neither of these were in any way as | close to what i'd been writing in assembler, and so didn't | connect in the same way. | | I don't think i'm unusual in this regard, transitioning from | assembler to C. Of course these days there is a new generation of | programmers who haven't that experience, and are happier with | higher level abstractions, and so it must look weird to them to | see the fascination with C, and it probably has outlived it's | expected life - i'm certainly surprised we're not all functional | by now for example. | mistrial9 wrote: | the example about C at Apple Computer is accurate. The MPW group | had a tool suite but it was a niche project at the time | (mid-80s). Influential engineers had a great pascal compiler and | dropped into assembler for the fine points, quite a lot. The | environment at DeAnza 3 where TechSupport lived was a place of | change for Apple at that time. Within a few years, C was popular | as an application language, some drivers for the new Mac II, and | lots of community code was generated. | | _edit_ thinking about it, the resistance to C at the time was | for real reasons.. common microcomputer C famously shipped with a | minimal language but the I /O and string handling libs made the | environment a useful runtime. Interfaces to anything more than | that on a microcomputer were adhoc. But many professionals at | that time knew about the larger *nix systems, and wanted the | kinds of pipes and task management interfaces that they knew. | This was the wrong model for the Mac OS, which emphasized | graphical user interfaces at every step. There were no terminal | windows in the background at all, no pipes and no standardized | processes. | | It was the courage to break away from "grown up" multi-user | system, incremental engineering and make a completely mouse- | driven interface that made the Mac great. Later when C interfaces | to ROM Toolbox calls were built, they were used to support the | Mac OS, not drag in tons of technical debt and character-stream | kinds of ideas to this new computer. | quelsolaar wrote: | The "Likeability" of C is very underestimated. Many people think | that system code _should_ be written in other language, but | people who _want_ to actually write, and maintain system software | want to do so in C. | | A programming language has to be enjoyed, if someone is going to | dedicated a significant part of their lives o writing opensource | software in it. C is on paper not a safe language, but almost all | of the most trusted safety critical software is written in it, so | from a Darwinistic point of view it has produced more trusted | software. I strongly suspect that a big reason for this is that C | is enjoyable enough for maintainers stick around long enough | shake out all the issues. | tialaramex wrote: | I liked C perfectly well, and for over 25 years I wrote | software in it, including both Free Software you may have used | and in-house software I was directly employed to write for a | large corporation. However I began learning Rust back in 2021 | and not only do I now not want to write any more C, I want to | rewrite my C software in Rust, although obviously 25 years | worth of software means that's a whole lot of work and in a few | cases I don't own the rights. | Gigachad wrote: | Things have changed a lot since 2012. The Asahi Linux devs have | said positive things about writing OS code in Rust. They have | built a full M1 GPU driver in Rust which says a lot for the | future of system code in safer languages. | galangalalgol wrote: | Misra C is not normal likeable C. And while people have written | safety critical code in normal likeable C, that isn't at all | common. Ada, more recently spark, and various c++ subsets are | all far more common. But yes Misra C is very common. | | Zig seems likeable, but I haven't tried it yet. And rust is | enjoyable now that I'm into it as my daily driver. The | complexity is only there if I go looking. Mostly. | User23 wrote: | The first "real programming language" I learned was Pascal. This | was back in the 90s. Switching to C was like taking off a | straight-jacket. I think it's hard to explain how much more | freely you were able to code to someone who didn't go through the | experience. Pascal was derogatorily referred to as a "Bondage and | Discipline Language" by C programmers. | | Of course I've matured a bit and I see a value in discipline and | having the language get in the way of doing error prone things | more now, but even so I'd still choose K&R 2nd edition ANSI C | over late 80s and early 90s vintage Pascal if I had to pick one | today. | pyjarrett wrote: | Despite enjoying the terseness of C, with curly braces and short | notations, many "normalized" things in C used to trip up math | students I would tutor in elementary programming classes. "Why is | `=` assignment and not `==`? How can a function not produce a | value? Why does `||` mean "or"?, etc. | | Pascal family languages usually end up much more long winded, but | can often be more easily explained to non-programmers than C | solutions. I spent a couple years doing down the Ada rabbit hole | in open source and was amazed how many elements of the problem | domain you express directly with the language, and how you can | constrain your program to catch domain-specific issues with the | compiler. | | With the rise of things like ChatGPT, I'm curious if the next | revolution for programming languages is focusing on constraints | to verify correctness rather than expression of what to do. This | might help help an AI model develop code and provide validity | checks on the generated solution. | jmclnx wrote: | Around that time we had K&R c, which I liked because no really | messing around with prototypes. Were Pascal, IIRC you had to deal | with prototypes and variable types and other things. | | Since then, we have ANCI c, which I got use to prototypes, but I | still prefer K&R. At least for now, ANSI has yet to get anal | about variable types and memory. I hope that never happens but I | fear c is heading in that direction because of what the rust | people are doing. | mgaunard wrote: | Did you not get the memo? C was replaced by C++. | | Many languages are trying to replace C++ and failing to do so. ___________________________________________________________________ (page generated 2023-02-04 23:00 UTC)