当前位置:网站首页>C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.1 The Prehistoric Phase of the C Language
C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.1 The Prehistoric Phase of the C Language
2022-08-01 21:09:00 【weixin_Guest time】
The C language was born from a failed project---the Multics project.This project attempts to build a very large operating system that can be applied to very small hardware systems.Multics became a treasure trove of engineering lessons, but it also paved the way for C to embody "small is beautiful".
Ken Thompson Dennis Ritchie
Thompson PDP-7 New Operating System (Assembly Language)
Brian Kernighan 1970 named UNXI(1970.1.1)
Thompson created the B language, which he used for researchThe language BCPL has been simplified so that B's interpreter can reside in the PDP-7's only 8KB of memory.Because of the memory constraints of the hardware system, it only allowed to place an interpreter, not a compiler, and the resulting inefficiency prevented the use of the B language for system programming of UNIX itself.
1965-7 (BCPL)---"1969 (B)---"1971 (New B)---"1972-3 (early C)
Language
UNIX (with PDP-7 written in assembly language)---"UNIX (written in PDP-11 assembly language)---"UNIX (written in C)
Operating system
PDP-7 PDP-11
IBM 360
Honeywell 635
Exactly, UNIX appeared earlier than C (that's why UNIX's system time is measured in seconds from January 1, 1970, because that's when it was created.
Golden Rule for Compiler Designers: Efficiency is (Almost) Everything
Things to Care About: Meaningful Error Messages; Good Documentation; Product Support
Compiler efficiency includes: running efficiency (the speed at which the code runs) and compilation efficiency (the speed at which executable code is generated).Except for some development and learning environments, operational efficiency plays a decisive role.
There are a number of compiler optimizations that increase compile time, but reduce run time.There are also optimizations (such as weeding out dead code and ignoring run-time checks, etc.) that reduce compile time and run time while reducing memory usage.The downside of these optimizations is that invalid running results in the program may not be discovered.
Dennis Ritchie invented the efficiency-focused "New B" and succeeded.
B language promotes the idea that "referencing an array element is equivalent to a reference to a pointer plus an offset".The B language also maintains the typeless characteristics of the BCPL language, and its only operand is the word of the machine.Thomposon invented the ++ and -- operators and added them to the PDP-7's B compiler.They still exist in the C language.
// In C, the statement that copies one character of a string:
*p++ = *s++;
can be compiled into PDP-11 code extremely efficiently:
moveb (r0)+, (r1)+
Thompson PDP-11 (Assembly)
After PDP-11, untyped languages quickly became anachronistic.This processor features hardware support for several data types of different lengths that the B language cannot express.
"New B"->C uses compilation mode to introduce the type system, and each variable must be declared before use.
边栏推荐
猜你喜欢

C语言_typedef和结构体
Godaddy domain name resolution is slow and how to use DNSPod resolution to solve it
![漏洞分析丨HEVD-0x6.UninitializedStackVariable[win7x86]](/img/37/09ab9b5a490c6ab9bc7991ecc4c8f4.png)
漏洞分析丨HEVD-0x6.UninitializedStackVariable[win7x86]

徒步,治好了我的精神内耗

Graph adjacency matrix storage

ISC2022 HackingClub白帽峰会倒计时1天!最全议程正式公布!元宇宙集结,精彩绝伦!

98. Embedded controller EC actual combat EC development board development completed

【接口测试】JMeter调用JS文件实现RSA加密

OSG笔记:设置DO_NOT_COMPUTE_NEAR_FAR,手动计算远近平面

宝塔搭建PESCMS-Ticket开源客服工单系统源码实测
随机推荐
C Pitfalls and Defects Chapter 7 Portability Defects 7.11 An Example of a Portability Problem
WeChat applet cloud development | personal blog applet
30+的女性测试人面试经验分享
Internet使用的网络协议是什么
wps excel 插入公式 整列
【微信小程序】【AR】threejs-miniprogram 安装(76/100)
C陷阱与缺陷 第8章 建议与答案 8.1 建议
网络安全与基础设施安全局(CISA):两国将在网络安全方面扩大合作
测试的意义并不是能找到全部的缺陷
Taobao's API to get the list of shipping addresses
封装一个管理 url 状态的 hook
C Pitfalls and Defects Chapter 5 Library Functions 5.5 Library Function Signal
kubernetes各名词缩写
Day33 LeetCode
LeetCode
Postman 批量测试接口详细教程
C专家编程 第1章 C:穿越时空的迷雾 1.1 C语言的史前阶段
Suggestions and answer 8.1 C traps and defect chapter 8
左旋氧氟沙星/载纳米雄黄磁性/As2O3磁性Fe3O4/三氧化二砷白蛋白纳米球
Jmeter实战 | 同用户重复并发多次抢红包