C kyun banayi gayi
C ke origins ko Unix, earlier languages aur systems software likhne ke practical problem se jodein.
Is chapter mein9 sections
Doosri languages hone ke bawajood C kyun banayi gayi? Designers ko Unix jaise systems software banane ka practical tareeka chahiye tha. Us problem ko samajhne se C ke kai design choices clear hote hain.
1. Context systems software ka tha
Operating system resources manage karke doosre programs ko services deta hai. Uske code ko data organise karna aur hardware aur existing interfaces ke saath work karna hota hai. Bell Labs ke early Unix work ne C designers ko ideas test karne ke liye real systems problems di.
Assembly language machine ke instructions se closely judi hoti hai. Control useful hai, lekin bade assembly program ko doosri machine par le jaane mein bahut changes lag sakte hain. Higher-level language har instruction likhe bina data aur operations express kar sakti hai. Isse large software maintain karna practical hota hai.
2. C ke predecessors the
C earlier languages se develop hui. Martin Richards ne BCPL develop ki. BCPL ne B ko influence kiya, jo mainly Ken Thompson se associated hai. Unix ke development ke dauran Dennis Ritchie ne Bell Labs mein C develop ki. Yeh influence ki line hai; languages interchangeable nahi hain.
- BCPL
- B
- C
- Unix mein C ka use
Diagram har influence ka family tree nahi. Languages experiments, implementation constraints aur users ke feedback se evolve hoti hain. Predecessor ka naam design choice samjha sakta hai; us predecessor ko seekhna C seekhne ki prerequisite nahi.
3. Development ek period tha, ek instant nahi
Ritchie C ka emergence 1969–1973 ke beech describe karte hain; 1972 mein development especially active thi. Isi liye histories mein 1972 aksar aata hai. Ise experiments aur improvements ka period samjhein; modern C ek hi din complete form mein nahi aayi.
1973 mein Unix kernel ka kaafi hissa C mein rewrite hona major milestone tha. “Kaafi hissa” important hai: saare low-level, machine-dependent parts disappear nahi hue. Ek milestone se har program instantly portable bhi nahi ho gaya. Later compiler work, porting experience aur standardization ne C ke wider use ko establish karne mein help ki.
4. Types se structured data express karna practical hua
C ka type system B se richer bana. Character aur doosre data types, pointers, arrays aur structures ne systems data describe karne mein help ki. Abhi saare features jaanna zaroori nahi. Main connection yeh hai ki language real program needs express karne ke liye evolve hui.
Language ne relatively small core aur common operations express karne ke economical forms rakhe. Control structures aur functions organization mein help karte hain; pointers aur representations carefully controlled data work ko support karte hain. In choices ke useful trade-offs hain aur aisi responsibilities bhi hain jo beginner ko explicitly seekhni chahiye.
5. Portability design karne wali property hai
C program ko systems ke beech move karna aasaan bana sakti hai, lekin portability mein care chahiye. Program kisi integer width, encoding, layout ya operating-system interface par depend kar sakta hai. Language guarantees samjhein, phir required extra assumptions record karein.
Modern desktop compiler selected C revision ke bahar extensions accept kar sakta hai. Extension useful hote hue bhi program ki usable environments restrict kar sakti hai. “Mera compiler accept karta hai” aur “C standard guarantee karta hai” alag sawaalon ke answers hain. Yeh distinction history ko current program ke everyday decisions se jodti hai.
6. Modern C ko apne context mein padhein
Aaj padhi jaane wali C mein decades ka later language aur library work hai. Reader C17 default baseline use karta hai aur C23-specific material mark karta hai. Kuch old examples aisi conventions par depend karte hain jinhe universal rules ki tarah copy nahi karna chahiye. Historical importance feature ka origin explain karti hai; old practice ko automatically aaj appropriate nahi banati.
Operating system ka bada part C mein rewrite karna kya prove karta hai ki har C program har computer par unchanged chalega?
Explanation padhein
Nahi. Yeh us systems work ke liye C ki usefulness dikhata hai. Program ki portability language rules, implementation choices, environment interfaces aur uski assumptions par depend karti hai.
Primary references aur aage ki reading
- Dennis M. Ritchie — The Development of the C Language: BCPL/B lineage, development period aur Unix context ka original historical account.
- WG14 N1570 — public C11 committee draft: Sections 4 aur 5 conformance aur implementation environments ko broad historical claims se alag samajhne mein help karti hain.
Aage badhne se pehle
- C earlier language ideas aur practical Unix systems work ke saath develop hui.
- Types aur structured operations se machine-specific instructions se aage systems data express hua.
- Portability language guarantees aur documented environment assumptions par depend karti hai.
In ideas ko alag rakhein
- Historical goal / Current guarantee
- Design goal motivation batata hai; current program ki guarantees selected C edition aur platform contracts se aati hain.
Unix ke liye C kaunsi problem solve karne mein useful thi, aur har C program automatically portable kyun nahi hua?
Optional: bolkar samjhein ya note rakhein. Tayyar hon toh aage badh sakte hain.Apni understanding check karein
Optional hai. Answers save ya send nahi hote; chapter kabhi lock nahi hota.
Har choice ki explanation padhein
- Unix samet systems software implement karna.
✓ Sahi reasoning. C, Unix ke saath develop hua aur earlier systems-language work se aage badha.
- Har program ko har machine par unchanged chalane ki guarantee.
C ki history program ki implementation aur environment assumptions nahi hataati.
- Har machine-specific operation ko automatic safety checks se replace karna.
C mein bounds, lifetimes aur interfaces par explicit dhyaan dena padta hai.
General
Pehle edition ka quick reference
Yeh compact reference existing links aur saved passages ke liye retained hai. Full context ke liye upar ki expanded lesson padhein.
C ko Dennis Ritchie ne Bell Labs mein early 1970s ke dauran Unix ke saath develop kiya. Ritchie development ka period 1969–1973 batate hain, jisme 1972 sabse creative period tha. Aim useful types aur efficient operations wali practical systems language banana tha; poori language ek hi date par taiyar nahi hui thi.
Iske predecessors Martin Richards ki BCPL (1960s mein developed) aur Ken Thompson ki B (lagbhag 1969–1970) thi. BCPL aur B largely typeless, word-oriented model use karti thi. Ritchie ne B mein richer type system add kiya, jisse C evolve hui; arrays, pointers aur structures isi process mein develop hue.
C ka initial implementation DEC PDP-11 ko target karta tha, aur isi se Unix kernel ko rewrite kiya gaya — yeh software portability aur maintainability ke field mein ek bahut bada milestone tha. Language ka design efficient system programming ki zaroorat, direct hardware manipulation, aur ek concise phir bhi powerful syntax ki chaah se influence hua tha.
Agla idea padhne ke liye tayyar?
Mark this chapter as read whenever you feel ready.