当前位置:网站首页>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.
边栏推荐
- 移植MQTT源码到STM32F407开发板上
- C语言_枚举类型介绍
- Kubernetes 如何实现组件高可用
- 宝塔搭建PESCMS-Ticket开源客服工单系统源码实测
- How to encapsulate the cookie/localStorage sessionStorage hook?
- Postman 批量测试接口详细教程
- Based on FPGA in any number of bytes (single-byte or multibyte) serial port (UART) to send (including source engineering)
- Day33 LeetCode
- 职场如象棋,测试/开发程序员如何突破成长瓶颈期?
- 关键字搜索:“淘宝商品 API ”
猜你喜欢

牛血清白蛋白刺槐豆胶壳聚糖缓释纳米微球/多西紫杉醇的纳米微球DTX-DHA-BSA-NPs

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

C语言之字符串函数二

An online JVM FullGC made it impossible to sleep all night and completely crashed~

C专家编程 第1章 C:穿越时空的迷雾 1.4 K&R C

Hiking, cured my mental internal friction
Godaddy domain name resolution is slow and how to use DNSPod resolution to solve it

Pytorch学习记录(八):生成对抗网络GAN

CS-NP白蛋白包覆壳聚糖纳米颗粒/人血清白蛋白-磷酸钙纳米颗粒无机复合材料

图的邻接矩阵存储
随机推荐
Nacos 配置中心
案例:MySQL主从复制与读写分离
Pytorch框架学校记录11——搭建小实战完整细节
2022年秋招,软件测试开发最全面试攻略,吃透16个技术栈
记录第一次给开源项目提 PR
左旋氧氟沙星/载纳米雄黄磁性/As2O3磁性Fe3O4/三氧化二砷白蛋白纳米球
1374. 生成每种字符都是奇数个的字符串 : 简单构造模拟题
和我一起写一个音乐播放器,听一首最伟大的作品
ISC2022 HackingClub white hat summit countdown 1 day!Most comprehensive agenda formally announced!Yuan universe, wonderful!
正则表达式
Common pits in the Go language
C Pitfalls and pitfalls Appendix B Interview with Koenig and Moo
C Pitfalls and Defects Chapter 7 Portability Defects 7.9 Case Conversion
Interview Blitz 70: What are sticky packs and half packs?How to deal with it?
C陷阱与缺陷 附录B Koenig和Moo夫妇访谈
C语言_枚举类型介绍
Hiking, cured my mental internal friction
(七)《数电》——CMOS与TTL门电路
有点奇怪!访问目的网址,主机能容器却不行
StringTable Detailed String Pool Performance Tuning String Concatenation