Search This Blog

Thursday, 10 July 2014

I. What is Programming Language?
-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 Language
Different 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
Web languages
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.  
Another Different Types of Programming Languages:
ALGOL
Ada
AIML
Assembly
AutoHotkey
BASIC
Batchfile
BCPL
C
C#
C++
COBOL
CPL
D
DarkBASIC
dBASE
FORTRAN
FoxPro
Go
HDML
HTML
Java
JavaScript
JCL
LISP
Live Script
LOGO
Matlab
Pascal
Perl
PHP
Pick
Python
Prolog

QBasic
R
Ruby
SGML
Smalltalk
SQL
Tcl
True BASIC
VHDL
Visual Basic
Visual FoxPro
WML
WHTML
XML

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

1960s

1970s

1980s

1990s

B.Modern History
Current trends
programming language evolution continues, in both industry and research. Some of the current trends include:
III. What is Programming Language Theory
 -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

NoCompilerInterpreter
1Compiler Takes Entire program as inputInterpreter Takes Single instruction as input .
2Intermediate Object Code isGeneratedNo Intermediate Object Code isGenerated
3Conditional Control Statements are Executes fasterConditional Control Statements are Executes slower
4Memory Requirement : More(Since Object Code is Generated)Memory Requirement is Less
5Program need not be compiled every timeEvery time higher level program is converted into lower level program
6Errors are displayed after entire program is checkedErrors are displayed for every instruction interpreted (if any)
7Example : C CompilerExample : BASIC

Explanation : Compiler Vs Interpreter

Just understand the concept of the compiler and interpreter -
  1. We give complete program as input to the compiler. Our program is in the human readable format.
  2. Human readable format undergoes many passes and phases of compiler and finally it is converted into the machine readable format.
  3. 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.
  4. 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

Character sets are the fundamental elements in a regular expression. A character set is a pattern that matches a single character. The syntax of character sets is as follows:
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): \x0A is 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 set0 that are not in set1.
[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
A set macro is written as $ 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.
Character set macros can be defined at the top of the file at the same time as regular expression macros (see Chapter 4, Regular Expression). Here are some example character set macros:
$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: 
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==\"\"?&enc:&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.