skip to main content
research-article
Free Access

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

Published:01 April 2018Publication History
Skip Abstract Section

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.Google ScholarGoogle Scholar
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  5. Perlis, A. 1982. Epigrams on programming. ACM SIGPLAN Notices 17(9). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

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

      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

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • 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

        Copyright © 2018 ACM

        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: 1 April 2018

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Popular
        • Editor picked

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      HTML Format

      View this article in HTML Format .

      View HTML Format