Programming Languages
Total Page:16
File Type:pdf, Size:1020Kb
Programming Languages VIKEN CHOUCHANIAN California State University Northridge Communication is a vital aspect of any society. The transferring of ideas, thoughts, information, or any other pertinent data could not be possible without a specific form of communication that all parties involved can understand. One form of communication is the use of languages. Humans have been using a variety of formal languages with great success for millennia all over the globe. When the need to communicate with machines arose, humans created programming languages to fully command their creations. The first programming languages actually predate any computers, and existed in the form of punch cards, used to guide textile looms. As humans gave birth to more advanced computers, programming languages also evolved to meet the intricate complexities of these new machines. Thousands of programming languages have been created, and each programmer can choose which language is optimal for his or her, based on their specific programming styles, hardware being used, and genre of the program being created. Some of the most widely used languages are Java, C++, C, PHP, Javascript, and Python, because they are fairly easy to learn and can be applied to a variety of general use programs. Similar to any spoken language, programming languages have certain rules that must be fol- lowed. Syntax can be considered the grammar of a programming language, allowing the computer to understand the vocabulary used by the programmer. Programmers can use the syntax and vocabulary of a language to create almost anything in the virtual world, have machines build a car, produce the next great video game, or create the next great phone application. Categories and Subject Descriptors: D.3 [Programming Languages]: General Terms: Languages Additional Key Words and Phrases: Programming Langugages 1. INTRODUCTION A key factor in the evolution, socialization, and civility of human beings has been communication. From the early grunts of our first homosapian ancestors, to the intricate nuances of the plethora of complex present day languages, mankind has needed a method to transfer ideas and concepts to one another. The invention of writing over 5000 years ago assisted in the transfer of concepts and helped advance human civilization in every aspect of our daily lives. Absence of a common lan- guage would make it nearly impossible to have a person effectively perform any task or explain an idea conceptualized by another. Formal language has evolved into a malleable entity constantly changing to meet the needs of modern humans and has become bridge between 21st century humans and the machines they have cre- ... Permission to make digital/hard copy of all or part of this material without fee for personal or classroom use provided that the copies are not made or distributed for profit or commercial advantage, the ACM copyright/server notice, the title of the publication, and its date appear, and notice is given that copying is by permission of the ACM, Inc. To copy otherwise, to republish, to post on servers, or to redistribute to lists requires prior specific permission and/or a fee. c 20YY ACM 0000-0000/20YY/0000-0001 $5.00 ACM Journal Name, Vol. V, No. N, Month 20YY, Pages 1{0??. 2 · V. Chouchanian ated. Just as humans have passed on knowledge to each other for millennia, people now have the capacity to fully communicate with their electronic and mechanical creations through formal languages, that certain machines can understand. These languages, known as programming languages, are the key to future of computers, machines, and technology in general. Without these languages many modern day inventions would be reduced to expensive silicon and plastic paperweights. A programming language can be defined as a notational system for describing computation in machine-readable and human-readable form.[2] In simpler terms it is notation for communicating to a computer what you want it to do. Although, through programming languages humans and machines can communicate, there are limitations. Programming languages, unlike human natural languages, can only facilitate communication of algorithmic ideas, and cannot easily express or understand human emotion. Machines read the program, and do what they told, if they understand what is presented. Since the invention of the first complex machines, humans have been devising more intricate ways of communication with their machine to employ more efficient techniques to complete their goals. 2. HISTORY OF PROGRAMMING LANGUAGES The first programming language predates the computer by over 125 years. Pro- gramming languages first appeared as holes placed strategically on punch cards. These punch cards were fed into the Jacquard Looms and player pianos of the early 1800s to control a sequence of operations and created various patterns in the tex- tiles being created. By simply changing out the cards, the operator of the loom could change the pattern on the textile. This similarity to the early 5.25 and 3.5 inch floppy disks is uncanny. The first computer program was created by Charles Babbage in the early 19th century to run his conceptual Analytical Engine. The Analytical Engine would be able to calculate logarithms and trigonometric functions using his computer program. His original ideas, combined with various mathematical works throughout the late 19th century and early 20th century, were used by Alan M. Turing in his Turing Machines.[7] These machines were conceptualized in the late 1930s and they worked by manipulating various symbols written on a tape. These concepts gave birth to the ideas of computer memory, automated machines, and the basic working of the modern day CPU. The last of the primitive programming languages was used in the famous ENIAC and UNIVAC computers of the late 1940s and early 50s. Before 1954 almost all programming was done in assembly language.[6] Modern structured programming languages first appeared in the computers of the 1950s and 60s. The initial modern programming languages FORTRAN, LISP, ALGOL, and COBOL became the basis of the computing world in the middle of the 20th century, and many variations of these languages spawned a multitude of new languages.[1] Modified versions or FORTRAN, LISP, ALGOL and COBOL are still used in 21st century machines. As computers became more efficient and accessible to the public, programming languages were forced to match the increasing complexities associated with the vast increase of technology until the early 1970s. Here is an example of a simple FORTRAN II code: ACM Journal Name, Vol. V, No. N, Month 20YY. · 3 The 1970s brought forth the concept of object-oriented programming. Object oriented programming began using data structures to create computer programs. A multitude of the programming languages developed after this period, incorporated object oriented programming into their basic ideas. Another huge accomplishment during the 70s was the creation of the C programming language. C or some variation of C is arguably the most widely used programming language in the world in 2010. The Internet boom of the 90s gave birth to many of the languages used by pro- grammers today. Scripting languages such as Applescript, Javascript, and Python were born in this era, and paved the way for many other programming languages used for the virtual world of the web. Programming languages are constantly being created, updated, and used. There are currently tens of thousands of programming languages in the world. This is not surprising, because of our dependence on tech- nology and accessibility of powerful computers, designers have free reign to create any language they deem fit to solve any problem. Languages may be created for various reasons ranging from calculating salaries for a corporation to computing the grades of college students. ACM Journal Name, Vol. V, No. N, Month 20YY. 4 · V. Chouchanian 3. HOW PROGRAMMING LANGUAGES WORK The study of any language, natural or artificial, focuses on the two fundamentals of the language: syntax and semantics. Syntax of language takes into account the format, form, and compositional structure of the language. For example the sen- tence: three red dog, is syntactically incorrect. The syntax of a computer language is defined as the form of its expressions, statements, and program units. Semantics on the other hand have to do with the meaning behind what is being expressed. The sentence: Thoughtful body greens instigate butterflies, is syntactically correct, but has no semantic meaning. Semantics, in programming language, refer to the meaning of the expressions, statements, and program units in the syntax of the language. 3.1 Syntax The syntax of a language can help determine popularity and ease of use of a specific programming language. If a programmer finds himself or herself struggling through the syntax of a language, the programmer can easily switch to one of the other languages currently available. Like natural languages, programming languages have symbols called characters. These characters are put together in strings and these strings combine to form sentences. The simplest form of these strings is called a lexeme. Lexemes are also separated into groups, called identifiers, by various criteria. The criteria for separation can include methods, classes, or names of variables. The categories these lexemes belong to are called tokens.[5] For example, the lexeme, index, is in the token named, identifier. These tokens are then parsed. Parsing recognizes the tokens in a sentence and determines its structure relating to the formal grammar of the language. Formal grammar of a language relates to the ACM Journal Name, Vol. V, No. N, Month 20YY. · 5 syntax rules implemented. Formal grammar only relates to form and not content. The following are some lexemes in the C programming language. Grammar of programming languages can be classified into various categories using the Chomsky hierarchy, a system devised by Noam Chomsky in the mid 1950s. The hierarchy consists of 4 classes for grammar; Type-0, Type-1, Type- 2, and Type-3.