Hi this is Isha fromMaster programming lad and in this post we are going to talk about the computer, computer programming and the typesof programming languages. A computer is a general purpose machines whichcan perform many computational task now the modern day computers that we have they canperform billions or trillions of calculations within a fraction of second. now the thingthese computer's they can't really do anything on their own. so for a computer to do somethingone has to give the instructions to it and these instructions will contain step by stepinformation to perform a specific task and these instructions are called as program.now the person who is going to write these instructions or the program is called as theprogrammer and here the programmer will write instructions or the program and the computerwill execute that or computer will work on that instructions now the computers that we have they containa lot of programs in them. There are some programs which will manage the computer hardwareresources and they are called as the system programs and there are some programs whichwill provide specific functionality to a user for example the Notepad web browser musicplayer video player and all these types of programs are called as the application programs. now we know that we need to give instructionsto the computer so that the computer can work on it now the thing is how we can give theinstruction to the computer or in which language we can give the instructions to the computer.Now since this computer is a machine how we can communicate with this machine. now the language in which these instructionsare written or the language in which this program is written is called as the programminglanguage. now there are several types of programming languages and we are going to see the detailsabout them. now you guys may probably heard that the computerscan only understand the binary language. Now this binary language has only two values.0 and 1 so in this binary language whatever you want to say has to be in the form of this0 and 1. now here these computer's are built in such a way that they can understand orthey can recognise the pattern of the zeros and ones and then they can work on it accordingly. Now why we have built the computers to understandthis binary language? that is because this binary language whichhas only two values is easy to create in the hardware level for example if we have a wireand if the current is flowing through this wire then we can say it is 1 if the currentis not flowing then we can say it is zero. so in general we can say that one stands forsomething which exists and zero stands for something which doesn't exist so since thisbinary language is easy to create in the hardware level so the computer is built in the hardwarelevel to recognise this pattern of 0 and 1 and while building the computer for a specificpattern of 0 and 1 a specific setup operations are defined. so when the computer will see a specific patternof 0 and 1 it knows what it has to do. so now the computers can understand this binarylanguage and this binary language with the computers understand are also called as themachine language. now let's see the types of programming languagesavailable. now in this modern day we have a lot of programming languages available.so let's take a look at the types of programming languages.so the first type of programming language or the language in which we can communicatewith the computer is the language which the computer understands. now all of you knowthat this computer's can understand this binary language or the machine language which isthe combination of zeros and ones. so the first type of programming languagesis the machine level language And in this machine level language we have the instructionsin the form of 0 and 1. so whatever you want to say has to be in theform of zero and one and since the computers are built in such a way that they can recognisethis zeros and ones and perform some specific operation on that the combination of zerosand ones you know we can communicate with his computer in this language. now the problem with this machine level languageis in order to program in this machine level language one has to know everything aboutthe computer. so here the programmer is directly dealing with the hardware level so he is directlyworking on the memory and the data. so the programeer needs to know everythingabout the computer, computer processor the computer architecture everything about thathe has to know and that's why this machine level language is a bit difficult to learnand also think about this let's say you want to write a program in the machine level languageor you want to give instructions to the computer in the machine level language and your programconsists of thousand lines. all your instruction will contain this 0 and 1 and this combinationof the zeros and ones. first of all it is difficult to write the program and also ifyou make some mistakes in your program then it is difficult to spot and because of allthese, a normal guy can't really learn the programming easily. so to solve these kind of problems anothertype of programming languages were invented and they are called as the Assembly levellanguage. in this assembly level language instead ofthat zeros and ones combination mnemonic the symbolic codes were introduced for exampleif the programmer has to write an instruction let's say he wants to add the numbers 5 and6. then in the machine level language it hasto be in the form of this zeros and ones. so let's say this is gonna be the instructionto add the numbers 5 and 6. so in the machine level language it will looklike this but in the Assembly level language mnemonic codes for used and the programmercould write ADD 5 6. So a lot of mnemonic or the symbolic codeswhere used and the programmer could write the program in this way.so it was a lot more human readable format the programmer can understand the code justby looking at it and it was a lot easier to code than the machine level language. so now the thing is the source code of theprogram written in this assembly level language by using this mnemonic or the symbol Codescannot be directly executed in this computer that is because this computer can only understandthe machine language. so what we have to do is we have to convertthe code which is written in the Assembly level language to machine level language sothat the computer can understand it and execute it.so the program written in the Assembly level language needs to be converted to the machinelevel language and to convert that a program was used and that program is called as theassembler. so this assembler will convert the code writtenin the Assembly level language to machine level language.now this assembly level language was lot more easy to learn and someone can learn the programminga lot more easily than the machine level language but this assembly level language also hadthe same difficulties. although it was a lot easy to write the programsthan the machine level language in assembly level language if the program size increasesthen again it is difficult to spot the errors and also the code written in the Assemblylevel language was also Computer Architecture dependent. so the code return for one type of computercannot be executed in another type of computer which has different architecture so againto solve these kind of problems a new types of languages by invented so that a lot morepeople can come and write the programs and that type of programming languages are calledas the Higher level languages. the high level languages are designed in sucha way that they are very easy for a beginner to learn and they were very close to the humanreadable language for example in this higher level language one could write the instructionto add 5 and 6 like this. so this 5 + 6 is a lot more similar to thehuman language so just by looking at the code one can understand what we're trying to doand since this higher level languages where a lot more easy to learn many people startedlearning computer programming and started creating lot more programs. now again the thing is the program writtenin the higher level language cannot be directly executed in the computer that is because the computer can only understand the machine language which can contain 0 and 1 but the higher level language is very close to the human languages. so we have to convert the program which iswritten in the high level language to machine language which the computers can understandand execute.
so for this high level languages there are two ways in which we can convertthe source code from high level language to machine level language and execute it andthe two methods which were used to convert the high level language program to machinelevel language one was the compilation method where a program called compiler was used. this is the compilation method another methodis called as the interpretation and for this interpretation method another type of programcalled as interpreter was used and we will see the details of this compilation and interpretationmethod a bit later but here just remember that although these are two different methodswhat they do is they convert the program which is written in the high level language to machinelevel language which the computers can understand and execute. now here this machine level language and theAssembly level language they are called as the lower level languages.because while writing the programs in this machine and assembly level language the programmerscould easily access the computer memory and directly work with the data. but with themost of this high level languages the programmers can't directly access the memory and the workwith data. but there are some languages in the high levellanguage type which allow the programmer to work with the Computer memory and the dataand they are called as the middle level languages and this middle level languages they provideall the features of the higher level languages and also they allow the programmer to workwith the Computer memory and data directly and since this languages provide the featureof the lower level language and also the high level language they are called as the middlelevel languages and we have the languages like C and C plus plus are these are all themiddle level languages because allow the programmer to work with the Computer memory and dataand also they provide all the features of this high level language and in the high levellanguages we have Java C Sharp python etc. this machine level language which is veryclose to the machine or you know this language the computer directly understands, it executesmuch faster than all these languages. so the execution speed of this machine languageis very high and after this machine level language we have the Assembly languages andtheir execution speed is better than the high level languages but a bit slower than themachine level language and then we have the high level languages. so now as I said before in this high levellanguages we can convert the code from higher level language to machine code in two differentways one is the compilation method another one is interpretation method. let's see this compilation and interpretationmethod in detail. so first see the compilation.so in the compilation method a program called compiler is used and this compiler Will takethe high level language program and it will convert that to the machine language and thisprocess is called as the compilation method and here what happens is this compiler willread the high level language program let's say this is high level language program itwill read this program and it will convert that to the machine language. it will convertthis entire program into machine language and then this machine language code will beexecuted. so the thing is compiler will convert entireprogram which is written in the high level language to machine level language and thenthat machine level language code will be executed. now let's take a look at this interpretationmethod so here also we will be converting the program written in the high level languageto the machine level language and then executing that. and for that purpose we will be usinga program called as the interpreter and this process is called as the interpretation. so the process of converting the high levellanguage program to machine language by using the program interpreter is called as the interpretationmethod now here what happens is lets say this is the source code or the programs writtenin the high level language and this interpreter what it does is first it will read the firstline of this source code or the program which is in the high level language and then itwill convert that to the machine code and then it will execute it immediately and afterthat it will go to the next line of the high level language program it will read that itwill convert that code and then it will execute it immediately and then it will go to thethird line and then again it will convert that code and then it will execute it. so in the compilation process the entire programwhich was written in the high level language was read first then it was converted to machinelevel language and then that entire program was executed at once but with the interpretationmethod the interpreter will read the program which is in the high level language line byline it and it will convert and execute each line immediately at a time. and this is howthe compiler and interpreter work. now there are many languages in the high levellanguage type and in that languages some follow the compilation method and some follow theinterpretation method. the languages which follow the compilationmethod are called as the compiled languages and for example we have C C + + etc theseare all the compiled languages where the compilation method is used to convert the program iwhichis written in these languages to the machine language and the higher level languages whichfollow the interpretation method are called as the interpreted languages for example wehave Python and this Python is an interpreted language. All right. this is it guys this is about thecomputers computer programming types of programming languages compilation and the interpretationmethod and I really hope that you have learn something from this post and if you likethis post then give a thumbs up and if you don't like it then give a thumbs down andalso share your opinion about this post what do you think about it and if you think thatthis post will help some of your friends then do share this post with them and I'll see you in Next post.
There's a book just over your shoulder that's carefully been placed there, can you pick the book up and tell me about it? Right! Great book, you shouldbuy the newer version of this. Brief commercial announcement yeah sure I think I mentioned at some point in our conversation the fact that the peopleworking on MULTICS, well MULTICS was sort of the second version of timesharing that wasdone at MIT with collaboration of Bell Labs and General Electric very big system for providing in effect a computingutility for programmers. Multex was actually being written in high-level languages ah they started with PL1 which was not a good choice and thenthey moved to BCPL language which developed in fact byMartin Richards of Cambridge. The people doing that who are at Bell Labs inparticular Ken Thompson and Dennis Ritchie had gotten used to the idea thatyou could write really interesting operating system kind of software andtools that supported it in high-level languages so you weren't writingassembly language and so when they started working on UNIX this very smallstripped-down version that was done at Bell Labs they were at the same timeexploring the use of high-level languages and there were a variety ofthese there was a language called B which was the first attempt it was doneby Ken Thompson a very simple language and I suppose you could say it was sortof like a stripped down version of BCPL A weak naming convention there andso you could do interesting things with B but it wasn't quite powerful enoughand in particular it was an interpreter not a compiler and that meant it didn'tgenerate machine code for the particular machine was running on it was just aprogram that interpreted what it was trying to sayso it meant it ran relatively slowly. The other thing is that the language did not support the architecture of newer machines that were showing up inparticular that PDP 11 newer machines instead of having everything in themachine be a single size of in effect integer let's say 16 bits or something like that they had different sizes that were, the machine would efficiently and naturallymanipulate 8bit, 16bit maybe thirty two-bit & the language B didn't reflectthat and so Dennis Ritchie undertook to design what amounted to a version ofB that was richer and had mechanisms in the language to say this is an 8-bitquantity this is a 16 bit quantity basically the char and int types that you see in the early versions of C and so he wrote a compiler for that and then with thecompiler in hand they started to rewrite the operating system itself in Cand this took a while but something in the order of six months to get that workingand at that point then you've got the operating system of course all kinds ofother critical core software written in a high-level language rather than inassembly language and that's important for all kinds of reasons one is meansthat it's just a lot easier for lots of people to see what the code does youneed so much expertise because it's a high-level language and the other thingis that it's portable in the sense that if somebody makes a C compiler for adifferent kind of machine different architecture then you can recompilewhatever your program is for that new architecture in that way you can move your program to adifferent machine of this always been the advantage of high-level languagesbut now you could do it for the operating system and that meant that UNIX, theoperating system no longer was only PDP 11 but could run on a variety of othermachines as well I think the concept of having a high-level language Iget right, you compile it down to hexes, machine code that tells the processors to do stuff. and if you have a different compiler for a different machine it just changes what those Hexes are -right that's exactly right so so it should be really simple to understand how you write an OS in a high level language, but is it a bit like, making a sharp tool and using that sharp tool to make a sharper tool? Yeah, right, I think in fact, the complication is in building in writingof operating system and high-level language in translating it into let'ssay multiple different architectures is there's a lot of detail to get rightthere in there are some things which the high-level language just doesn't supportSo you need a little tiny bit of assembly language assist for any given operatingsystem the one that's more like that the conceptual problem that you wereexplaining well is how does the compiler itself get started because of course theC compiler is written in C so there is the how do you get it started and your ideaof the sharper tool making yet a sharper tool and so on is metaphorically the right idea becausewhat you do is you say I wrote some code in C on paper let me mechanicallytranslate that into something that will process a bit more of C code andbootstrap myself up from that so it's a bootstrapping process and I've neverdone it so take me with a grain of salt on that but that's the basic idea so. - OK, so tell me about this book, how did this come about? that's the first edition (is it autographed?) this one isn't actually no dear oh dear this however is the 24th printing so. (I'll just point out that Prof Brailsford brought in a pen for the autograph there.) OK I will autograph it... somewhere early on in this process ofpeople building interesting languages I got intrigued by the idea of how do youexplain those languages to other people and so I wrote tutorial documents I wrote a tutorial document on B so that people could learn B because Ken Thompsonand to a lesser degree Dennis didn't write tremendous amount of documentationlet's say it was a spare and there was not much tutorial stuff so I wrote atutorial document on B that was useful when C came along then I wrote atutorial document on C and at some point I had already written I guess couplebooks at that point and it seemed like the market, the market!? That there mightbe a market for a C book and so I twisted Dennis Ritchies arm intowriting the book with me and that is the smartest thing I ever did in my wholelife no ambiguity so we took my tutorial document as kind of a piece of it, wetook his reference manual which is a excellent reference manual as a bigpiece of it took that verbatim and then we filled in material in the middle to explain the various parts of the language at length, and we published that, we wrote it in 1977published at the beginning of 78 and of course it was done with all of thedocument preparation tools that we had been working on over the years and so ithad mathematical expressions in it using EQNit had tables of things like operators using Mike Lesk's TBL programit the first edition predates pic thepicture drawing language the second edition has pic pictures so on so isthis incestuous or is this building on what people have done I don't know butthat's how it came about and I remember talking to the editor this is publishedby Prentice Hall with Karl Karlstrom the editor there and I remember discussionwith him about how many copies do you think this will sell no idea well maybefive thousand done better than that which is just as well there never an A because B was based on? There was a language SteveJohnson who was all part of this the creator of Yacc, Steve Johnson spent a sabbaticalat University of Waterloo in Ontario and he came back with a link I don'tsomebody else had done that the language they're called "A" but it was spelled "EH"- Bit of Canadian humor I guess...
Thank ,you for watching this post in case of any doubt you can ask in the comment section and will meet you in the next section.



Comments
Post a Comment
If you have any doubts , please let me know ....