Open-source News

How the C programming language has grown

opensource.com - Fri, 04/15/2022 - 15:00
How the C programming language has grown Jim Hall Fri, 04/15/2022 - 03:00

The C programming language will turn fifty years old in 2022. Yet despite its long history, C remains one of the top "most-used" programming languages in many "popular programming languages" surveys. For example, check out the TIOBE Index, which tracks the popularity of different programming languages. Many Linux applications are written in C, such as the GNOME desktop.

I interviewed Brian Kernighan, co-author (with Dennis Ritchie) of The C Programming Language book, to learn more about the C programming language and its history.

Where did the C programming language come from?

C is an evolution of a sequence of languages intended for system programming—that is, writing programs like compilers, assemblers, editors, and ultimately operating systems. The Multics project at MIT, with Bell Labs as a partner, planned to write everything in a high-level language (a new idea at the time, roughly 1965). They were going to use IBM's PL/1, but it was very complicated, and the promised compilers didn't arrive in time.

After a brief flirtation with a subset called EPL (by Doug McIlroy of Bell Labs), Multics turned to BCPL, a much simpler and cleaner language designed and implemented by Martin Richards of Cambridge, who I think was visiting MIT at the time. When Ken Thompson started working on what became Unix, he created an even simpler language, based on BCPL, that he called B. He implemented it for the PDP-7 used for the first proto-Unix system in 1969.

BCPL and B were both "typeless" languages; that is, they had only one data type, integer. The DEC PDP-11, which arrived on the scene in about 1971 and was the computer for the first real Unix implementation, supported several data types, notably 8-bit bytes as well as 16-bit integers. For that, a language that also supported several data types was a better fit. That's the origin of C.

Programming and development Red Hat Developers Blog Programming cheat sheets Try for free: Red Hat Learning Subscription eBook: An introduction to programming with Bash Bash shell scripting cheat sheet eBook: Modernizing Enterprise Java

How was C used within Bell Labs and the early versions of Unix?

C was originally used only on Unix, though after a while, there were also C compilers for other machines and operating systems. Mostly it was used for system-programming applications, which covered quite a spectrum of interesting areas, along with a lot of systems for managing operations of AT&T's telephone network.

What was the most interesting project written in C at Bell Labs?

Arguably, the most interesting, memorable, and important C program was the Unix operating system itself. The first version of Unix in 1971 was in PDP-11 assembly language, but by the time of the fourth edition, around 1973, it was rewritten in C. That was truly crucial since it meant that the operating system (and all its supporting software) could be ported to a different kind of computer basically by recompiling everything. Not quite that simple in practice, but not far off.

You co-authored The C Programming Language book with Dennis Ritchie. How did that book come about, and how did you and Dennis collaborate on the book?

I had written a tutorial on Ken Thompson's B language to help people get started with it. I upgraded that to a tutorial on C when it became available. And after a while, I twisted Dennis's arm to write a C book with me. Basically, I wrote most of the tutorial material, except for the system call chapter, and Dennis had already written the reference manual, which was excellent. Then we worked back and forth to smooth out the tutorial parts; the reference manual stayed pretty much the same since it was so well done from the beginning. The book was formatted with the troff formatter, one of many tools on Unix, and I did most of the formatting work.

When did C become a thing that other programmers outside of Bell Labs used for their work?

I don't really remember well at this point, but I think C mostly followed along with Unix for the first half dozen years or so. With the development of compilers for other operating systems, it began to spread to other systems besides Unix. I don't recall when we realized that C and Unix were having a real effect, but it must have been in the mid to late 1970s.

Why did C become such an influential programming language?

The primary reason in the early days was its association with Unix, which spread rapidly. If you used Unix, you wrote in C. Later on, C spread to computers that might not necessarily run Unix, though many did because of the portable C compiler that Steve Johnson wrote. The workstation market, with companies like Sun Microsystems, MIPS (which became SGI), and others, was enabled by the combination of Unix and C. The IBM PC came somewhat later, about 1982, and C became one of the standard languages, under MS-DOS and then Windows. And today, most Internet of Things (IoT) devices will use C.

C remains a popular programming language today, some 50 years after its creation. Why has C remained so popular?

I think C hit a sweet spot with efficiency and expressiveness. In earlier times, efficiency really mattered since computers were slow and had limited memory compared to what we are used to today. C was very efficient, in the sense that it could be compiled into efficient machine code, and it was simple enough that it was easy to see how to compile it. At the same time, it was very expressive, easy to write, and compact. No other language has hit that kind of spot quite so well, at least in my humble but correct opinion.

How has the C programming language grown or changed over the years?

C has grown modestly, I guess, but I haven't paid much attention to the evolving C standards. There are enough changes that code written in the 1980s needs a bit of work before it will compile, but it's mostly related to being honest about types. Newer features like complex numbers are perhaps useful, but not to me, so I can't make an informed comment.

What programming problems can be solved most easily in C?

Well, it's a good language for anything, but today, with lots of memory and processing power, most programmers are well served by languages like Python that take care of memory management and other more high-level constructs. C remains a good choice for lower levels where squeezing cycles and bytes still matter.

C has influenced other programming languages, including C++, Java, Go, and Rust. What are your thoughts on these other programming languages?

Almost every language is in some ways a reaction to its predecessors. To over-simplify a fair amount, C++ adds mechanisms to control access to information, so it's better than C for really large programs. Java is a reaction to the perceived complexity of C++. Go is a reaction to the complexity of C++ and the restrictions of Java. Rust is an attempt to deal with memory management issues in C (and presumably C++) while coming close to C's efficiency.

They all have real positive attributes, but somehow no one is ever quite satisfied, so there will always be more languages that, in their turn, react to what has gone before. At the same time, the older languages, for the most part, will remain around because they do their job well, and there's an embedded base where they are perfectly fine, and it would be infeasible to reimplement in something newer.

Thanks to Brian for sharing this great history of the C programming language!

Would you like to learn C programming? Start with these popular C programming articles from the last year: 5 ways to learn the C programming language in 2022.

Here's my interview with Brian Kernighan, co-author (with Dennis Ritchie) of The C Programming Language book, to discuss the C programming language and its 50-year history.

Programming What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Mesa 22.1-rc1 Brings Radeon Vulkan Enhancements, Imagination Driver & Microsoft Dozen

Phoronix - Fri, 04/15/2022 - 02:20
Following yesterday's Mesa 22.1 code branching / feature freeze, Mesa 22.1-rc1 was released this afternoon as the first step towards releasing Mesa 22.1 next month. Mesa 22.1 is bringing improvements for old NVIDIA graphics on open-source, many Radeon "RADV" Vulkan enhancements, a lot of work as always on the Intel side, the new Imagination Rogue PowerVR driver, and much more...

Intel Raptor Lake P Linux Graphics Driver Support Being Prepared

Phoronix - Fri, 04/15/2022 - 01:40
With the Linux 5.19 kernel there is going to be the initial graphics driver support for Raptor Lake S with the initial batch of PCI IDs being added. Published today in patch form and still potentially making it to mainline in v5.19 is Raptor Lake P support...

Open Source Networks in Action: How leading telcos are harnessing the power of LF Networking

The Linux Foundation - Fri, 04/15/2022 - 00:55

This post originally appeared in LF Networking’s blog

Now in its fifth year as an umbrella organization, LF Networking (LFN) and its projects enable organizations across the globe to more quickly and effectively achieve digital transformation via the community’s shared development efforts. This includes companies of all sizes and types that rely on LFN’s breadth of commercially-ready ecosystem offerings, all based on open source innovation spearheaded within the LF Networking community.

As mature LFN projects, ONAP (Open Network Automation Platform) and OpenDaylight are currently deployed as critical components in networks around the globe. Below is a sampling of specific case studies currently implemented in the real-world that are allowing organizations to transform their networks. 

  • Spark automates disaggregated network in just 6 months using ONAP. As Spark New Zealand Limited (Spark) approached 5G deployment, they started analyzing the status of automation across network and infrastructure and realized they needed an automation suite that would support future use cases that 5G could enable, such as network slicing, and closed loop automation.  In partnership with Infosys, Spark took a relatively short six months to go from kickoff to implementation of ONAP. More details are available here.
  • Verizon leverages OpenDaylight as its directional SDN controller. After initial work exploring OpenDaylight (ODL), Verizon decided to pull the testing, packaging, support in-house and create their own optimized ODL distribution. ODL now serves as Verizon’s foundational and directional SDN controller with two use cases in production across the network. Verizon brings a strong developer team to the project with several employees directly participating in ODL on eleven projects. Currently, Verizon is using Yang model driven platform solutions and wants to integrate different types of data modeling technology, Open APIs, rest platforms, and more. More details are available here.
  • Deutsche Telekom deploys ONAP in O-RAN Town. In its O-RAN Town project, DT deployed in the city of Neubrandenburg a multi-vendor Open RAN trial network for 4G and 5G services with massive MIMO integrated into the live network — the first in Europe. To automate services on all network domains, DT introduced a vendor-independent Service Management and Orchestration (SMO) component based on ONAP open source. The SMO is to be at the heart of complete lifecycle management of all O-RAN components in this deployment. More details are available here.
  •  Orange deploys automation framework powered by ONAP. Realizing a long-pursued goal of using ONAP, Orange has deployed and trialed an automation framework powered by ONAP. The current use case, in production in Orange Egypt, includes automating network services, network connectivity and resource management inside IP/MPLS, and configuration changes such as provisioning virtual private networks. Through this initiative, Orange has demonstrated that ONAP has reached the maturity and modularity for network operators to take combinations of ONAP projects and components from proof of concept to production. More details are available here.
  • Bell automates a significant amount of manual configuration, recovery, and provision work by using ONAP in production across multiple use cases. Since 2017, the use of ONAP at Bell Canada has expanded to automating numerous key network services across all business units. Moving forward, ONAP is playing a major role in 5G and multi-access edge computing (MEC) rollouts. The key metric Bell uses to measure the success of ONAP is the number of recurring manual task hours saved per month. Each project that adopts ONAP for a specific service tracks this metric. In 2019 alone, Bell saved a significant amount of recurring manual work per month as a result of using ONAP. In 2020, the team will also measure the acceleration of new services on-boarded to the platform. Currently, the on-boarding process can range from a few weeks to six months. Learn more in this detailed case study.

These are just a few examples of what is possible with open networking. Stay tuned to LF Networking channels for more industry proof points across the ecosystem and follow the LFN community journey (visit our website and follow us on Twitter)  to witness the power of open collaboration on the future of networking.

The post Open Source Networks in Action: How leading telcos are harnessing the power of LF Networking appeared first on Linux Foundation.

Pages