skip to main content
research-article
Open access

C Is Not a Low-level Language: Your computer is not a fast PDP-11.

Published: 01 April 2018 Publication History

Abstract

In the wake of the recent Meltdown and Spectre vulnerabilities, it’s worth spending some time looking at root causes. Both of these vulnerabilities involved processors speculatively executing instructions past some kind of access check and allowing the attacker to observe the results via a side channel. The features that led to these vulnerabilities, along with several others, were added to let C programmers continue to believe they were programming in a low-level language, when this hasn’t been the case for decades.

References

[1]
C Defect Report 260. 2004; http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_260.htm.
[2]
Chadwick, G. A. 2013. Communication centric, multi-core, fine-grained processor architecture. Technical Report 832. University of Cambridge, Computer Laboratory; http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-832.pdf.
[3]
Memarian, K., Matthiesen, J., Lingard, J., Nienhuis, K., Chisnall, D. Watson, R. N. M., Sewell, P. 2016. Into the depths of C: elaborating the de facto standards. Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation: 1-15; http://dl.acm.org/authorize?N04455.
[4]
Ou, A., Nguyen, Q., Lee, Y., Asanovic, K. 2014. A case for MVPs: mixed-precision vector processors. Second International Workshop on Parallelism in Mobile Platforms at the 41st International Symposium on Computer Architecture.
[5]
Perlis, A. 1982. Epigrams on programming. ACM SIGPLAN Notices 17(9).

Cited By

View all
  • (2022)Strategy and algorithms for the parallel solution of the nearest neighborhood problem in shared-memory processorsEngineering with Computers10.1007/s00366-021-01304-y38:Suppl 2(1669-1679)Online publication date: 1-Jun-2022
  • (2019)Reproducibility in Benchmarking Parallel Fast Fourier Transform based ApplicationsCompanion of the 2019 ACM/SPEC International Conference on Performance Engineering10.1145/3302541.3313105(5-8)Online publication date: 27-Mar-2019
  • (2019)Sequential Codelet Model of Program Execution. A Super-Codelet model based on the Hierarchical Turing Machine.2019 IEEE/ACM Third Annual Workshop on Emerging Parallel and Distributed Runtime Systems and Middleware (IPDRM)10.1109/IPDRM49579.2019.00005(1-8)Online publication date: Nov-2019
  • Show More Cited By

Recommendations

Reviews

Andrea F Paramithiotti

Early computers were programmed with low-level languages that were very close to their physical architecture. Although those languages guaranteed efficient use of machine resources, they were not particularly user-friendly, meaning it was hard for researchers in any domain outside computer science to write programs that solved their problems. The C programming language was developed as an effort to overcome these difficulties. It was, at the same time, compatible with the greatest number of computer architectures and more comprehensible by people who were not computer scientists. Yet as processor architecture evolved and became more sophisticated, the C language developed problems of its own, some of which are highlighted in this article. In short, C natively uses sequential execution and flat memory spaces-no problem for early computers where processor architectures were built precisely on those requirements, but a big pain for modern computers where processors heavily use threading for program execution and caching for fast data retrieval. Compiling C programs to make use of these features creates huge, inefficient, low-level programs. On the other hand, forgoing these features makes inefficient use of processor power. More alarmingly, these weaknesses have been known to be exploited by the Spectre and Meltdown viruses. The author's answer to this issue seems rather blunt at first: stop using C when programming on machines with modern processor architectures. On second thought, though, this recommendation holds only for newer code; the world literally runs on plenty of legacy C programs, and they continue to be efficient and reliable.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image Queue
Queue  Volume 16, Issue 2
Consistency
March-April 2018
70 pages
ISSN:1542-7730
EISSN:1542-7749
DOI:10.1145/3212477
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 April 2018
Published in QUEUE Volume 16, Issue 2

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article
  • Popular
  • Editor picked

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)75,699
  • Downloads (Last 6 weeks)14,731
Reflects downloads up to 22 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2022)Strategy and algorithms for the parallel solution of the nearest neighborhood problem in shared-memory processorsEngineering with Computers10.1007/s00366-021-01304-y38:Suppl 2(1669-1679)Online publication date: 1-Jun-2022
  • (2019)Reproducibility in Benchmarking Parallel Fast Fourier Transform based ApplicationsCompanion of the 2019 ACM/SPEC International Conference on Performance Engineering10.1145/3302541.3313105(5-8)Online publication date: 27-Mar-2019
  • (2019)Sequential Codelet Model of Program Execution. A Super-Codelet model based on the Hierarchical Turing Machine.2019 IEEE/ACM Third Annual Workshop on Emerging Parallel and Distributed Runtime Systems and Middleware (IPDRM)10.1109/IPDRM49579.2019.00005(1-8)Online publication date: Nov-2019
  • (2018)High-Performance Molecular Dynamics Simulation for Biological and Materials Sciences: Challenges of Performance Portability2018 IEEE/ACM International Workshop on Performance, Portability and Productivity in HPC (P3HPC)10.1109/P3HPC.2018.00004(1-13)Online publication date: Nov-2018

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Magazine Site

View this article on the magazine site (external)

Magazine Site

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media