Example: bachelor of science

The Endurance of an Unmanageable Language

Some Were Meant for CThe Endurance of an Unmanageable LanguageStephen KellComputer LaboratoryUniversity of CambridgeCambridge, United C Language leads a double life: as an application program-ming Language of yesteryear, perpetuated by circumstance,and as a systems programming Language which remains aweapon of choice decades after its creation. This essay is aC programmer s reaction to the call to abandon ship. It ques-tions several properties commonly held to define the experi-ence of using C; these include unsafety, undefined behaviour,and the motivation of performance. It argues all these arein fact inessential; rather, it traces C s ultimate strength to acommunicativedesign which does not fit easily within theusual conception of a programming Language , but can beseen as a counterpoint to so-called managed languages.

The Endurance of an Unmanageable Language Stephen Kell Computer Laboratory University of Cambridge Cambridge, United Kingdom stephen.kell@cl.cam.ac.uk Abstract TheClanguageleadsadoublelife:asanapplicationprogram-ming language of yesteryear, perpetuated by circumstance, and as a systems programming language which remains a

Tags:

  Endurance

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of The Endurance of an Unmanageable Language

1 Some Were Meant for CThe Endurance of an Unmanageable LanguageStephen KellComputer LaboratoryUniversity of CambridgeCambridge, United C Language leads a double life: as an application program-ming Language of yesteryear, perpetuated by circumstance,and as a systems programming Language which remains aweapon of choice decades after its creation. This essay is aC programmer s reaction to the call to abandon ship. It ques-tions several properties commonly held to define the experi-ence of using C; these include unsafety, undefined behaviour,and the motivation of performance. It argues all these arein fact inessential; rather, it traces C s ultimate strength to acommunicativedesign which does not fit easily within theusual conception of a programming Language , but can beseen as a counterpoint to so-called managed languages.

2 This communicativity is what facilitates the essential aspectof system-building: creating parts which interact with other,remote parts being alongside not within .CCS Concepts Software and its engineering Gen-eral programming languages;Compilers; Social andprofessional topics History of programming languages;Keywordssystems programming, virtual machine, man-aged languages, safety, undefined behaviorACM Reference Format:Stephen Kell. 2017. Some Were Meant for C: The Endurance of anUnmanageable Language . InProceedings of 2017 ACM SIGPLANI nternational Symposium on New Ideas, New Paradigms, and Reflec-tions on Programming and Software (Onward! 17).ACM, New York,NY, USA, 17 !

3 17, October 25 27, 2017, Vancouver, Canada 2017 Copyright held by the owner/author(s). Publication rights licensedto the Association for Computing is the author s version of the work. It is posted here for your personaluse. Not for redistribution. The definitive Version of Record was publishedinProceedings of 2017 ACM SIGPLAN International Symposium on New Ideas,New Paradigms, and Reflections on Programming and Software (Onward! 17), IntroductionWhile some were meant for sea, in tug-boats Round the shore s knee,(Milling with the sand,and always coming back to land),For others, up aboveIs all they care to think of,Up there with the birds and clouds, andWords don t follow.

4 Tiny Ruins, from Priest with Balloons I am not ashamed to say that I program in C, and that Ienjoy it. This puts me at odds with much of programminglanguage discourse, among both researchers and influen-tial practitioners, which holds that C is evil and must bedestroyed. If only we had a safe systems programming lan-guage ! If only we could eke out a little more performancein implementations of other languages, to remove the lastremaining motivation for using C! If only we could make the industry see the error of its ways! Then C would beeradicated, and there would be much am a systems programmer . It doesn t mean I hack ker-nels, so much as that I build systems pieces of infrastructurethat integrate multiple interacting parts, and sit underneathapplication code.

5 Programming in C feelsrightfor doingthis; it has a viscerally distinctive feeling compared to other,safer, higher-level languages. Certainly, today s experienceof programming in C remains, despite certain advances, un-forgiving. But I have never felt C to be an encumbrance. Cis not a Language I use because I m stuck with it; I use it forpositive reasons. This essay explores those reasons and theirapparent contrast with conventional Two ViewpointsThe lyric from which this essay borrows its title evokes twocontrasting ways of being: that of the idealist who longs tobe among the clouds, and that of the sea-farers who carryon their business on the planet s all-too-limiting idealist in the song is a priest, who takes literally to theclouds.

6 One day, clutching at helium balloons, he steps offa cliff edge, floats up and away, and is never seen is, more-or-less, the true story of Father Adelir Ant nio de Carli,whose ill-fated April 2008 balloon flight from the Brazilian city of Paranaguawas a fundraising effort towards a spiritual rest stop for lorry ! 17, October 25 27, 2017, Vancouver, CanadaStephen KellMeanwhile, the tug-boats far below symbolise another wayto live: plying their trade along the rocky shoreline that isnature s unmovable constraint. The seafarers perspectiveis limited and earth-bound, shaped and constrained by viewpoints are familiar to anyone interested in pro-gramming. The singer sympathises with the priest, as canwe all: it is natural to dream of a better world (or Language ,or system) overcoming present earthly constraints, mov-ing over and beyond the ugly realities on the ground.

7 Butthe priest s fate is not a happy one. Meanwhile, just as thetug-boat crews are doing the world s work, the C languagecontinues to be a medium for much of the world s workingsoftware to the continued regret of many researchers in Language design and related topics, weface a recurring question: how much ought we to idealisethe rocks and waves inhabited by practitioners? We can ide-alise not onlyhowgadgets work (machines, software), butalsowhyparticular trade-offs win out in particular cases including why people use C. There is much valuable workto be done in idealised terms, on designs, or in clean-slatefashion, or atop theoretical rather than practical the balloonist s view does not seem to explain the en-durance of C, given its attendant problems; the sea-farersseem to live in some other, incommensurable reality.

8 To un-derstand this phenomenon, we will have to think the remainder of the essay, I ll argue the followingpoints (each in its own section), sharing the theme that weneed to think less about languages as discrete abstractions,less hierarchically in general, and more about thesystemswhich embody languages seeinglanguage implementationsas parts of those systems, and not shying away from con-textual details associated with implementation concerns andnon-portability. Despite this prevailing preference for talkingand thinking about languages in a discrete sense, I will alsonote certain ways in which we have the habit of confusingC s implementations with the Language itself.

9 At application level, C s continued popularity owesmostly not to performance but to a host of unglam-orous yet technically hard problems in the general ar-eas of migration, interoperation and integration. Theseare widely known but continue to be neglected andundervalued as topics of research per se perhaps, Isuggest, because they are about system design and en-gineering research (no contradiction) more than theyare about languages ( 4). For true systems programming (as I will define), C sbenefits are of another kind. Again, performance isnot the issue; I will argue thatcommunicationis whatdefines system-building, and that C s design, partic-ularly its use ofmemoryand explicitrepresentations,embodies a first-class approach to communicationwhich is lacking in existing safe languages ( 5).

10 I consider the valuable but limited paradigm ofman-agedlanguages, and argue that it is not the only wayto achievesafelanguages; in fact managedness rulesout first-class communication, socannotreplace C forsystem-building. Managed approaches are founded onhierarchical abstraction; I sketch an alternative medi-ated approach which is relatively heterarchical, suitsalternative styles of program-level reasoning, but ap-pears just as capable of safety guarantees, albeit at thelevel of a system and not a Language ( 6). Issues of unsafety and undefined behaviour in C arewidely misunderstood, particularly in the extent towhich undefined behaviour is motivated by perfor-mance, and also in what pertains to implementationsof C versus to the Language specification.


Related search queries