-A programming language is a computer language programmers use to develop applications, scripts, or other set of instructions for a computer to execute.
-A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms.
-The earliest programming languages preceded the invention of the computer, and were used to direct the behavior of machines such as Jacquard looms and player pianos.
-The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference.
A. Types of Programming LanguageDifferent languages have different purposes, so it makes sense to talk about different kinds, or types, of languages. Some types are:
- Machine languages — interpreted directly in hardware
- Assembly languages — thin wrappers over a corresponding machine language
- High-level languages — anything machine-independent
- System languages — designed for writing low-level tasks, like memory and process management
- Scripting languages — generally extremely high-level and powerful
- Domain-specific languages — used in highly special-purpose areas only
- Visual languages — non-text based
- Esoteric languages — not really intended to be used
Used for creating and editing pages on the web. Can do anything from putting plain text on a webpage, to accessing and retrieving data from a database. Vary greatly in terms of power and complexity.
-
HTML
Hyper Text Markup Language. The core language of the world wide web that is used to define the structure and layout of web pages by using various tags and attributes. Although a fundamental language of the web, HTML is static - content created with it does not change. HTML is used to specify the content a webpage will contain, not how the page functions. Learn HTML at our HTML tutorials section. -
XML
Extensible Markup Language. A language developed by the W3C which works like HTML, but unlike HTML, allows for custom tags that are defined by programmers. XML allows for the transmission of data between applications and organizations through the use of its custom tags. -
Javascript
A language developed by Netscape used to provide dynamic and interactive content on webpages. With Javascript it is possible to communicate with HTML, create animations, create calculators, validate forms, and more. Javascript is often confused with Java, but they are two different languages. Learn Javascript at our Javascript tutorials section. -
VBScript
Visual Basic Scripting Edition. A language developed by Microsoft that works only in Microsoft's Internet Explorer web browser and web browsers based on the Internet Explorer engine such as FlashPeak's Slim Browser. VBScript Can be used to print dates, make calculations, interact with the user, and more. VBScript is based on Visual Basic, but it is much simpler. Learn VBScript at our VBScript tutorials section. -
PHP
Hypertext Preprocessor (it's a recursive acronym). A powerful language used for many tasks such as data encryption, database access, and form validation. PHP was originally created in 1994 By Rasmus Lerdorf. Learn PHP at our PHP tutorials section. -
Java
A powerful and flexible language created by Sun MicroSystems that can be used to create applets (a program that is executed from within another program) that run inside webpages as well as software applications. Things you can do with Java include interacting with the user, creating graphical programs, reading from files, and more. Java is often confused with Javascript, but they are two different languages. Learn Java at our Java tutorials section.
Software languages
Used for creating executable programs. Can create anything from simple console programs that print some text to the screen to entire operating systems. Vary greatly in terms of power and complexity.-
C
An advanced programming language used for software application development. Originally developed by Dennis Ritchie at Bell Labs in the 1970's and designed to be a systems programming language but since then has proven itself to be able to be used for various software applications such as business programs, engineering programs, and even games. The UNIX operating system is written in C. -
C++
Descendant of the C language. The difference between the two languages is that C++ is object-oriented. C++ was developed by Bjarne Stroustrup at Bell Labs and is a very popular language for graphical applications. -
Visual Basic
A language developed by Microsoft based on the BASIC language . Visual Basic is used for creating Windows applications. The VBScript language (also developed by Microsoft) is based on Visual Basic. -
Java
A powerful and flexible language created by Sun MicroSystems that can be used to create applets (a program that is executed from within another program) that run inside webpages as well as software applications. Things you can do with Java include interacting with the user, creating graphical programs, reading from files, and more. Java is often confused with Javascript, but they are two different languages. Learn Java at our Java tutorials section.
II. Evolution of Programming Language
A.Early History
In some ways, the history of programming language theory predates even the development of programming languages themselves. The lambda calculus, developed by Alonzo Church and Stephen Cole Kleene in the 1930s, is considered by some to be the world's first programming language, even though it was intended to model computation rather than being a means for programmers to describe algorithms to a computer system. Many modern functional programming languages have been described as providing a "thin veneer" over the lambda calculus,[1] and many are easily described in terms of it.
The first programming language to be proposed was Plankalkül, which was designed by Konrad Zuse in the 1940s, but not publicly known until 1972 (and not implemented until 1998). The first widely known and successful programming language was Fortran, developed from 1954 to 1957 by a team of IBM researchers led by John Backus. The success of FORTRAN led to the formation of a committee of scientists to develop a "universal" computer language; the result of their effort was ALGOL 58. Separately, John McCarthy of MIT developed the Lisp programming language (based on the lambda calculus), the first language with origins in academia to be successful. With the success of these initial efforts, programming languages became an active topic of research in the 1960s and beyond.
Some other key events in the history of programming language theory since then:
1950s
- Noam Chomsky developed the Chomsky hierarchy in the field of linguistics; a discovery which has directly impacted programming language theory and other branches of computer science.
1960s
- The Simula language was developed by Ole-Johan Dahl and Kristen Nygaard; it is widely considered to be the first example of an object-oriented programming language; Simula also introduced the concept of coroutines.
- In 1964, Peter Landin is the first to realize Church's lambda calculus can be used to model programming languages. He introduces the SECD machine which "interprets" lambda expressions.
- In 1965, Landin introduces the J operator, essentially a form of continuation.
- In 1966, Landin introduces ISWIM, an abstract computer programming language in his article The Next 700 Programming Languages. It is influential in the design of languages leading to the Haskell programming language.
- In 1966, Corrado Böhm introduced the programming language CUCH (Curry-Church).[2]
- In 1967, Christopher Strachey publishes his influential set of lecture notes Fundamental Concepts in Programming Languages, introducing the terminology R-values, L-values, parametric polymorphism, and ad hoc polymorphism.
- In 1969, J. Roger Hindley publishes The Principal Type-Scheme of an Object in Combinatory Logic, later generalized into the Hindley–Milner type inference algorithm.
- In 1969, Tony Hoare introduces the Hoare logic, a form of axiomatic semantics.
- In 1969, William Alvin Howard observed that a "high-level" proof system, referred to as natural deduction, can be directly interpreted in its intuitionistic version as a typed variant of the model of computation known as lambda calculus. This became known as the Curry–Howard correspondence.
1970s
- In 1970, Dana Scott first publishes his work on denotational semantics.
- In 1972, Logic programming and Prolog were developed thus allowing computer programs to be expressed as mathematical logic.
- In 1974, John C. Reynolds discovers System F. It had already been discovered in 1971 by the mathematical logician Jean-Yves Girard.
- From 1975, Sussman and Steele develop the Scheme programming language, a Lisp dialect incorporating lexical scoping, a unified namespace, and elements from the Actor model including first-class continuations.
- Backus, at the 1977 ACM Turing Award lecture, assailed the current state of industrial languages and proposed a new class of programming languages now known as function-level programming languages.
- In 1977, Gordon Plotkin introduces Programming Computable Functions, an abstract typed functional language.
- In 1978, Robin Milner introduces the Hindley–Milner type inference algorithm for the ML programming language. Type theory became applied as a discipline to programming languages, this application has led to tremendous advances in type theory over the years.
1980s
- In 1981, Gordon Plotkin publishes his paper on structured operational semantics.
- In 1988, Gilles Kahn published his paper on natural semantics.
- A team of scientists at Xerox PARC led by Alan Kay develop Smalltalk, an object-oriented language widely known for its innovative development environment.
- There emerged process calculi, such as the Calculus of Communicating Systems of Robin Milner, and the Communicating sequential processes model of C. A. R. Hoare, as well as similar models of concurrency such as the Actor model of Carl Hewitt.
- In 1985, The release of Miranda sparks an academic interest in lazy-evaluated pure functional programming languages. A committee was formed to define an open standard resulting in the release of the Haskell 1.0 standard in 1990.
- Bertrand Meyer created the methodology Design by contract and incorporated it into the Eiffel programming language.
1990s
- Gregor Kiczales, Jim Des Rivieres and Daniel G. Bobrow published the book The Art of the Metaobject Protocol.
- Eugenio Moggi and Philip Wadler introduced the use of monads for structuring programs written in functional programming languages.
Current trends
programming language evolution continues, in both industry and research. Some of the current trends include:
- Increasing support for functional programming in mainstream languages used commercially, including pure functional programming for making code easier to reason about and easier to parallelise (at both micro- and macro- levels)
- Constructs to support concurrent and distributed programming.
- Mechanisms for adding security and reliability verification to the language: extended static checking, dependent typing, information flow control, static thread safety.
- Alternative mechanisms for modularity: mixins, delegates, aspects.
- Component-oriented software development.
- Metaprogramming, reflection or access to the abstract syntax tree
- Increased emphasis on distribution and mobility.
- Integration with databases, including XML and relational databases.
- Support for Unicode so that source code (program text) is not restricted to those characters contained in the ASCII character set; allowing, for example, use of non-Latin-based scripts or extended punctuation.
- XML for graphical interface (XUL, XAML).
- Open source as a developmental philosophy for languages, including the GNU compiler collection and recent languages such as Python, Ruby, and Squeak.
- AOP or Aspect Oriented Programming allowing developers to code by places in code extended behaviors.
- Massively parallel languages for coding 2000 processor GPU graphics processing units and supercomputer arrays including OpenCL.
- 2000 - ActionScript
- 2001 - C#
- 2001 - Visual Basic .NET
- 2002 - F#
- 2003 - Groovy
-Programming language theory (PLT) is a branch of computer science that deals with the design, implementation, analysis, characterization, and classification of programming languages and their individual features. It falls within the discipline of computer science, both depending on and affecting mathematics, software engineering and linguistics. It is a well-recognized branch of computer science, and an active research area, with results published in numerous journals dedicated to PLT, as well as in general computer science and engineering publications.
IV. Compiler vs Interpreter
Difference between Compiler and Interpreter
| No | Compiler | Interpreter |
|---|---|---|
| 1 | Compiler Takes Entire program as input | Interpreter Takes Single instruction as input . |
| 2 | Intermediate Object Code isGenerated | No Intermediate Object Code isGenerated |
| 3 | Conditional Control Statements are Executes faster | Conditional Control Statements are Executes slower |
| 4 | Memory Requirement : More(Since Object Code is Generated) | Memory Requirement is Less |
| 5 | Program need not be compiled every time | Every time higher level program is converted into lower level program |
| 6 | Errors are displayed after entire program is checked | Errors are displayed for every instruction interpreted (if any) |
| 7 | Example : C Compiler | Example : BASIC |
Explanation : Compiler Vs Interpreter
Just understand the concept of the compiler and interpreter -
- We give complete program as input to the compiler. Our program is in the human readable format.
- Human readable format undergoes many passes and phases of compiler and finally it is converted into the machine readable format.
- However interpreter takes single line of code as input at a time and execute that line. It will terminate the execution of the code as soon as it finds the error.
- Memory requirement is less in Case of interpreter because no object code is created in case of interpreter.
V.Defining Syntax
-In computer science, the syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document or fragment in that language. This applies both to programming languages, where the document represents source code, and markup languages, where the document represents data. The syntax of a language defines its surface form.[1] Text-based computer languages are based on sequences of characters, while visual programming languages are based on the spatial layout and connections between symbols (which may be textual or graphical). Documents that are syntactically invalid are said to have a syntax error.
Syntax – the form – is contrasted with semantics – the meaning. In processing computer languages, semantic processing generally comes after syntactic processing, but in some cases semantic processing is necessary for complete syntactic analysis, and these are done together or concurrently. In a compiler, the syntactic analysis comprises the frontend, while semantic analysis comprises the backend (and middle end, if this phase is distinguished).
A.Character Set
Syntax of character sets
set := set '#' set0
| set0
set0 := @char [ '-' @char ]
| '.'
| @smac
| '[' [^] { set } ']'
| '~' set0
The various character set constructions are:char- The simplest character set is a single Unicode character. Note that special characters such as
[and.must be escaped by prefixing them with\(see the lexical syntax, Section 3.1, “Lexical syntax”, for the list of special characters).
Certain non-printable characters have special escape sequences. These are:\a,\b,\f,\n,\r,\t, and\v. Other characters can be represented by using their numerical character values (although this may be non-portable):\x0Ais equivalent to\n, for example.
Whitespace characters are ignored; to represent a literal space, escape it with\. char-char- A range of characters can be expressed by separating the characters with a ‘
-’, all the characters with codes in the given range are included in the set. Character ranges can also be non-portable. .- The built-in set ‘
.’ matches all characters except newline (\n).
Equivalent to the set[\x00-\x10ffff] # \n. set0#set1- Matches all the characters in
set0that are not inset1. [sets]- The union of
sets. [^sets]- The complement of the union of the
sets. Equivalent to ‘. # [’.sets] ~set- The complement of
set. Equivalent to ‘. #’set
$ followed by an identifier. There are some builtin character set macros:$white- Matches all whitespace characters, including newline.
Equivalent to the set[\ \t\n\f\v\r]. $printable- Matches all "printable characters". Currently this corresponds to Unicode code points 32 to 0x10ffff, although strictly speaking there are many non-printable code points in this region. In the future Alex may use a more precise definition of
$printable.
$lls = a-z -- little letters
$not_lls = ~a-z -- anything but little letters
$ls_ds = [a-zA-Z0-9] -- letters and digits
$sym = [ \! \@ \# \$ ] -- the symbols !, @, #, and $
$sym_q_nl = [ \' \! \@ \# \$ \n ] -- the above symbols with ' and newline
$quotable = $printable # \' -- any graphic character except '
$del = \127 -- ASCII DEL
B.Syntax Group
You can show the syntax highlight group where the cursor is located in your statusbar. This is especially useful when tweaking a color theme.
First define a function which returns the highlight group syntax under the cursor:
First define a function which returns the highlight group syntax under the cursor:
function! SyntaxItem() return synIDattr(synID(line("."),col( "."),1),"name") endfunction
Then insert into your statusline a call to function SyntaxItem:
set statusline+=%{SyntaxItem()}
Here is a complete example showing the syntax highlight group among other things:
if has('statusline') set statusline=%#Question# " set highlighting set statusline+=%-2.2n\ " buffer number set statusline+=%#WarningMsg# " set highlighting set statusline+=%f\ " file name set statusline+=%#Question# " set highlighting set statusline+=%h%m%r%w\ " flags set statusline+=%{strlen(&ft)?&ft: 'none'}, " file type set statusline+=%{(&fenc==\"\"?&en c:&fenc)}, " encoding set statusline+=%{((exists(\"+bomb \")\ &&\ &bomb)?\"B,\":\"\")} " BOM set statusline+=%{&fileformat}, " file format set statusline+=%{&spelllang}, " language of spelling checker set statusline+=%{SyntaxItem()} " syntax highlight group under cursor set statusline+=%= " ident to the right set statusline+=0x%-8B\ " character code under cursor set statusline+=%-7.(%l,%c%V%)\ %< %P " cursor position/offset endif
C. Syntax and Program Reliability
Program syntax is a major source of confusion and bugs. Programs should be easy to read and, to help that, the syntax of a programming language should be simple. We now have the compiler technology to automatically parse very complex language grammars, but what is important is that humans should be able to quickly grasp and understand programs. Complex syntax is a problem.
The reliability program exists to plan, define and implement those reliability tasks that are considered necessary by the supplier to meet the overall reliability objective for the product. The scope of the objective drives the number and type of tasks required, and the level of detail necessary in performing each task. Successful implementation of the reliability program ensures that product reliability issues are addressed as part of the overall engineering and manufacturing effort, and provides a high degree of confidence that the objective of the reliability program will be met.
The reliability program exists to plan, define and implement those reliability tasks that are considered necessary by the supplier to meet the overall reliability objective for the product. The scope of the objective drives the number and type of tasks required, and the level of detail necessary in performing each task. Successful implementation of the reliability program ensures that product reliability issues are addressed as part of the overall engineering and manufacturing effort, and provides a high degree of confidence that the objective of the reliability program will be met.