高级操作系统高级操作系统 (29).pdf
第 6 讲:The Programming Languages of OS第二节:The Evolution of C Programming Practices:A Study of the Unix Operating System 19732015IntroductionHistory of C1969:B created,based on BCPL,to replace PDP-7 assembleras the system programming language for Unix,remained atypeless language like BCPL1971:NB(”new B”)created when porting B to PDP-11,types(int,char,arrays and pointers),array-to-pointer conversion,compilation to machine code1972:Language renamed to C,structs,preprocessor,portableI/O1973:Unix re-written in C1978:The C Programming Language,1st editionThe Development of the C Language,Dennis M.Ritchie,1993.IntroductionWhy was C be used to develop UNIX?Thompson decided that Unix possibly needed a systemprogramming language,he created a language B(from BCPL).B can be thought of as C without types;BCPL,B,and C all fit firmly in the traditional proceduralfamily typified by Fortran and Algol 60.They are close to themachine abstractions.BCPL,B have a single data type,the word,or cell,afixed-length bit pattern.Memory in these languages consistsof a linear array of such cells.B generated threaded code.The C extended the B by adding types and also rewrote itscompiler to generate PDP-11 machine instructions.The C compiler is capable of producing programs fast andsmall enough to compete with assembly language.This DEC VAX 11/780 machine became much more popular.IntroductionWhy was C be used to develop UNIX?C was a traditional procedural family languageSPEED CLOSE TO ASSEMBLYCLOSE TO MACHINE ABSTRACTIONTYPE SAFETYPORTABILITYSIMPLE/SMALL LANG&BIG LIBRARY.IntroductionWhence Success?The success of Unix itself was the most important factorRemains a simple and small languageAt the same time the language is sufficiently abstracted frommachine details that program portability can be achievedC and its central library support always remained in touchwith a real environmentThe actual C language as seen by millions of users using manydifferent compilers has remained remarkably stable andunified compared to those of similarly widespreadcurrency,for example Pascal and Fortran.A Study of the Unix Operating System 19732015objectiveThe objective of this work is to study thelong term evo-lution of C programming inthe context of the Unix oper-ating systemdevelopment.Formulate seven hypotheses associatedwith the long term evolution of Cprogramming in the Unix operatingsystem.A Study of the Unix Operating System 19732015Seven hypotheses associated with the long term evolution of Cprogramming in the Unix operating systemProgramming practices reflect technology affordancesModularity increases with code sizeNew language features are increasingly used to saturationpointProgrammers trust the compiler for register allocationCode formatting practices converge to a common standardSoftware complexity evolution follows self correction feedbackmechanismsCode readability increases.A Study of the Unix Operating System 19732015Timeline of indicative analyzed revisions and milestones in(from top to bottom):C languageevolution,developer interfaces,programming guidelines,processing capacity,collaborationmechanisms,and tools.A Study of the Unix Operating System 19732015.A Study of the Unix Operating System 19732015H1:Programming practices reflect technology affordancesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H1:Programming practices reflect technology affordancesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H1:Programming practices reflect technology affordancesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H1:Programming practices reflect technology affordancesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H1:Programming practices reflect technology affordancesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H2:Modularity increases with code sizeHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H2:Modularity increases with code sizeHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H3:New language features are increasingly used to saturation pointHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H3:New language features are increasingly used to saturation pointHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H3:New language features are increasingly used to saturation pointHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H3:New language features are increasingly used to saturation pointHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H3:New language features are increasingly used to saturation pointHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H3:New language features are increasingly used to saturation pointHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H4:Programmers trust the compiler for register allocationHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H5:Code formatting practices converge to a common standardHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H5:Code formatting practices converge to a common standardHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H5:Code formatting practices converge to a common standardHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H6:Software complexity evolution follows self correctionHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H6:Software complexity evolution follows self correctionHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H6:Software complexity evolution follows self correctionHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H6:Software complexity evolution follows self correctionHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H6:Software complexity evolution follows self correctionHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H7:Code readability increasesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H7:Code readability increasesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H7:Code readability increasesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.A Study of the Unix Operating System 19732015H7:Code readability increasesHalf Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.ReferencesThe Development of the C Language,Dennis M.Ritchie,1993The Evolution of C Programming Practices:A Study of the Unix Operating System 19732015,Diomidis Spinellis,ICSE,2016Half Century of Unix:History,Preservation,and Lessons Learned,Diomidis Spinellis,keynote of OW2 Consortium,2017.