programming languages

Wednesday, January 31, 2007

PROGRAMMING LANGUAGES


COBOL

COBOL is a third-generation programming language, and one of the oldest programming languages still in active use. Its name is an acronym for Common Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments.

The COBOL 2002 standard includes support for object-oriented programming and other modern language features.



COBOL was initially created in 1959 by The Short Range Committee, one of three committees proposed at a meeting held at the Pentagon on May 28 and 29, 1959, organized by Charles Phillips of the United States Department of Defense (exactly one year after the Zürich ALGOL 58 meeting). The Short Range Committee was formed to recommend a short range approach to a common business language. It was made up of members representing six computer manufacturers and three government agencies. In particular, the six computer manufacturers were Burroughs Corporation, IBM, Minneapolis-Honeywell (Honeywell Labs), RCA, Sperry Rand, and Sylvania Electric Products. The three government agencies were the US Air Force, the David Taylor Model Basin, and the National Bureau of Standards (Now NIST).

This committee was chaired by a member of the NBS. An Intermediate-Range Committee and a Long-Range Committee were proposed at the Pentagon meeting as well. However although the Intermediate Range Committee was formed, it was never operational; and the Long-Range Committee was never even formed. In the end a sub-committee of the Short Range Committee developed the specifications of the COBOL language. This sub-committee was made up of six individuals:

William Selden and Gertrude Tierney of IBM
Howard Bromberg and Howard Discount of RCA
Vernon Reeves and Jean E. Sammet of Sylvania Electric Products

This subcommittee completed the specifications for COBOL as the year of 1959 came to an end. The specifications were to a great extent inspired by the FLOW-MATIC language invented by Grace Hopper, commonly referred to as "the mother of the COBOL language", and the IBM COMTRAN language invented by Bob Bemer.



Modula-3

Modula-3 is a now little-used programming language conceived as a successor to an upgraded version of Modula-2. It was designed by Luca Cardelli, Jim Donahue, Mick Jordan, Bill Kalsow and Greg Nelson at the DEC Systems Research Center and Olivetti in the late 1980s. Its design was heavily influenced by work on the Modula-2+ language in use at DECSRC at the time, which was the language in which the operating system for the DEC Firefly multiprocessor VAX workstation was written. Modula-3's main features are simplicity and safety while preserving the power of a systems-programming language. Modula-3 aimed to continue the Pascal tradition of type safety, while introducing new constructs for practical real-world programming. In particular Modula-3 added support for generic programming (similar to templates), multithreading, exception handling, garbage collection, object-oriented programming, partial revelation and encapsulation of unsafe code. The design goal of Modula-3 was a language that implements the most important features of modern imperative languages in quite basic forms. Thus dangerous and complicating features like multiple inheritance and operator overloading were omitted.

The Modula-3 project started in November 1986 when Maurice Wilkes wrote to Niklaus Wirth with some ideas for a new version of Modula. Wilkes had been working at DEC just prior to this point, and had returned to England and joined Olivetti's Research Strategy Board. Wirth had already moved on to Oberon, but had no problems with the Wilkes' team continuing development under the Modula name. The language definition was completed in August 1988, and an updated version in January 1989. Compilers from DEC and Olivetti soon followed, and 3rd party implementations after that.

During the 1990s, Modula-3 gained considerable currency as a teaching language, but it was never widely adopted for industrial use. Contributing to this may have been the demise of DEC, a key Modula-3 supporter. In any case, in spite of Modula-3's simplicity and power, it appears that there was little demand for a highly structured compiled language with restricted implementation of object-oriented programming. For a time, a closed source compiler called CM3 and integrated development environment called Reactor were offered by Critical Mass, Inc., but that company ceased active operations in 2000. Modula-3 is now no longer taught in universities, and all its textbooks are out of print. Essentially the only corporate supporter of Modula-3 is elego Software Solutions GmbH, which inherited the complete sources from Critical Mass and has since made several releases of the CM3 system in source and binary form. The Reactor IDE could not, however, be released yet by elego due to unclear licensing terms. In March 2002 elego also took over the repository of the last other active Modula-3 distribution, PM3, till then maintained at the École Polytechnique de Montréal.



FORTRAN


Fortran (previously FORTRAN) is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing. Originally developed by IBM in the 1950s for scientific and engineering applications, Fortran came to dominate this area of programming early on and has been in continual use in computationally intensive areas such as climate modeling, computational fluid dynamics (CFD), computational physics, and computational chemistry for half a century.

Fortran (an acronym derived from The IBM Mathematical Formula Translating System) encompasses a lineage of versions, each of which evolved to add extensions to the language while retaining compatibility with previous versions. Successive versions have added support for processing of character-based data (FORTRAN 77), array programming, module-based programming and object-based programming (Fortran 90/95), and object-oriented and generic programming (Fortran 2003).


In late 1953, John W. Backus submitted a proposal to his superiors at IBM to develop a more efficient alternative to assembly language for programming their IBM 704 mainframe computer. A draft specification for The IBM Mathematical Formula Translating System was completed by mid-1954. The first manual for FORTRAN appeared in October 1956, with the first FORTRAN compiler delivered in April 1957. This was an optimizing compiler, because customers were reluctant to use a high-level programming language unless its compiler could generate code whose performance was comparable to that of hand-coded assembly language.

The language was widely adopted by scientists for writing numerically intensive programs, which encouraged compiler writers to produce compilers that could generate faster and more efficient code. The inclusion of a complex number data type in the language made Fortran especially suited to technical applications such as electrical engineering.

By 1960, versions of FORTRAN were available for the IBM 709, 650, 1620, and 7090 computers. Significantly, the increasing popularity of FORTRAN spurred competing computer manufacturers to provide FORTRAN compilers for their machines, so that by 1963 over 40 FORTRAN compilers existed. For these reasons, FORTRAN is considered to be the first widely used programming language supported across a variety of computer architectures [citation needed].

The development of FORTRAN paralleled the early evolution of compiler technology; indeed many advances in the theory and design of compilers were specifically motivated by the need to generate efficient code for FORTRAN programs.



PHP

PHP (PHP: Hypertext Preprocessor) is a reflective programming language originally designed for producing dynamic Web pages and remote application software.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications.

The sole implementation is produced by The PHP Group and released under the PHP License. It is considered to be free software by the Free Software Foundation. This implementation serves to define a de facto standard for PHP, as there is no formal specification.
PHP was written as a set of CGI binaries in the C programming language by the Danish/Greenlandic programmer Rasmus Lerdorf in 1994, to replace a small set of Perl scripts he had been using to maintain his personal homepage.[2] Lerdorf initially created PHP to display his résumé and to collect certain data, such as how much traffic his page was receiving. "Personal Home Page Tools" was publicly released on June 8, 1995 after Lerdorf combined it with his own Form Interpreter to create PHP/FI (this release is considered PHP version 2).[3][4]

Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion - Israel Institute of Technology, rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism "PHP: Hypertext Preprocessor". The development team officially released PHP/FI 2 in November 1997 after months of beta testing. Public testing of PHP 3 began immediately and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999.[5] They also founded Zend Technologies in Ramat Gan, Israel, which actively manages the development of PHP.

In May 2000, PHP 4, powered by the Zend Engine 1.0, was released. The latest version as of December 2006 is 4.4.4. PHP 4 is currently still supported by security updates for those applications that require it.



PERL

Perl is a dynamic programming language created by Larry Wall and first released in 1987. Perl borrows features from a variety of other languages including C, shell scripting (sh), AWK, sed and Lisp.[1]

Structurally, Perl is based on the brace-delimited block style of AWK and C, and was widely adopted for its strengths in string processing, and lack of the arbitrary limitations of many scripting languages at the time.[

Larry Wall began work on Perl in 1987, while working as a programmer at Unisys,[3] and released version 1.0 to the comp.sources.misc newsgroup on December 18, 1987. The language expanded rapidly over the next few years. Perl 2, released in 1988, featured a better regular expression engine. Perl 3, released in 1989, added support for binary data.

Until 1991, the only documentation for Perl was a single (increasingly lengthy) man page. In 1991, Programming Perl (known to many Perl programmers as the "Camel Book") was published, and became the de facto reference for the language. At the same time, the Perl version number was bumped to 4, not to mark a major change in the language, but to identify the version that was documented by the book.

Perl 4 went through a series of maintenance releases, culminating in Perl 4.036 in 1993. At that point, Larry Wall abandoned Perl 4 to begin work on Perl 5.

Initial design of Perl 5 continued into 1994. The perl5-porters mailing list was established in May 1994 to coordinate work on porting Perl 5 to different platforms. It remains the primary forum for development, maintenance, and porting of Perl 5.

Perl 5 was released on October 17, 1994. It was a nearly complete rewrite of the interpreter, and added many new features to the language, including objects, references, packages, and modules. Importantly, modules provided a mechanism for extending the language without modifying the interpreter. This allowed the core interpreter to stabilize, even as it enabled ordinary Perl programmers to add new language features.



PASCAL

Pascal is an imperative computer programming language, developed in 1970 by Niklaus Wirth as a language particularly suitable for structured programming. A derivative known as Object Pascal was designed for object oriented programming.

Pascal is based on the ALGOL programming language and named in honor of mathematician and philosopher Blaise Pascal. Wirth subsequently developed Modula-2 and Oberon, languages similar to Pascal.

Initially, Pascal was a language intended to teach students structured programming, and generations of students have "cut their teeth" on Pascal as an introductory language in undergraduate courses. Variants of Pascal are still widely used today, for example Free Pascal can be used in both 32 and 64 bit formats, and all types of Pascal programs can be used for both education and software development.

Parts of the original Macintosh operating system were hand-translated into Motorola 68000 assembly language from the Pascal code used in the Apple Lisa (though later versions incorporated substantial amounts of C++ as well), and the primary high-level language used for development in the first couple of years of the Mac was Pascal. In addition, the popular typesetting system TeX was written by Donald E. Knuth in WEB, a variant of Pascal designed for literate programming.

The first Pascal compiler was designed in Zurich for the CDC 6000 computer family, and it became operational in 1970. Welsh and Quinn at the Queen’s University of Belfast completed the first successful port of the CDC Pascal compiler to another mainframe in 1972. The target was the ICL 1900 computer.

The first Pascal compiler written in North America was constructed at the University of Illinois under Donald B. Gillies for the PDP-11 and generated native machine code.

In order to rapidly propagate the language, a compiler "porting kit" was created in Zurich that included a compiler that generated code for a "virtual" stack machine (i.e. code that lends itself to reasonably efficient interpretation), along with an interpreter for that code - the p-code system. Although the p-code was primarily intended to be compiled into true machine code, at least one system, the notable UCSD implementation, utilized it to create an interpretive system UCSD p-System. The P-system compilers were termed P1-P4, with P1 being the first version, and P4 being the last. Watcom Pascal was developed for the IBM mainframe in the early 1980s.



BASIC
History

Prior to the mid-1960s, computers were extremely expensive tools used only for special-purpose tasks. A simple batch processing arrangement ran only a single "job" at a time, one after another. During the 1960s, however, faster and more affordable computers became available. With this extra processing power, computers would sometimes sit idle, without jobs to run.

Programming languages in the batch programming era tended to be designed, like the machines on which they ran, for specific purposes (such as scientific formula calculations or business data processing or eventually for text editing). Since even the newer less expensive machines were still major investments, there was strong tendency to consider efficiency (ie, execution speed, and such) to be the most important feature of a language. In general, these specialized languages were difficult to use and had widely disparate syntax.

As prices decreased, the possibility of sharing computer access began to move from research labs to commercial use. Newer computer systems supported time-sharing, a system which allows multiple users or processes to use the CPU and memory. In such a system the operating system alternates between running processes, giving each one running time on the CPU before switching to another. The machines had become fast enough that most users could feel they had the machine all to themselves. In theory, timesharing reduced the cost of computing tremendously, as a single machine could be shared among (up to) hundreds of users

Early years — the mini computer era

The original BASIC language was designed in 1963 by John Kemeny and Thomas Kurtz and implemented by a team of Dartmouth students under their direction. BASIC was designed to allow students to write programs for the Dartmouth Time-Sharing System. It intended to address the complexity issues of older languages with a new language design specifically for the new class of users time-sharing systems allowed — that is, a less technical user who did not have the mathematical background of the more traditional users and was not interested in acquiring it. Being able to use a computer to support teaching and research was quite attractive enough. In the following years, as other dialects of BASIC appeared, Kemeny and Kurtz' original BASIC dialect became known as Dartmouth BASIC.
The eight design principles of BASIC were:
Be easy for beginners to use.
Be a general-purpose programming language.
Allow advanced features to be added for experts (while keeping the language simple for beginners).

Be interactive.
Provide clear and friendly error messages.
Respond quickly for small programs.
Not require an understanding of computer hardware.
Shield the user from the operating system.

The language was based partly on FORTRAN II and partly on ALGOL 60, with additions to make it suitable for timesharing. (The features of other time-sharing systems such as JOSS and CORC, and to a lesser extent LISP, were also considered). It had been preceded by other teaching-language experiments at Dartmouth such as the DARSIMCO (1956) and DOPE (1962 implementations of SAP and DART (1963) which was a simplified FORTRAN II). Initially, BASIC concentrated on supporting straightforward mathematical work, with matrix arithmetic support from its initial implementation as a batch language and full string functionality being added by 1965. BASIC was first implemented on the GE-265 mainframe which supported multiple terminals. Contrary to popular belief, it was a compiled language at the time of its introduction. It was also quite efficient, beating FORTRAN II and ALGOL 60 implementations on the 265 at several fairly computationally intensive programming problems such as maximization Simpson's Rule.
The designers of the language decided to make the compiler available without charge so that the language would become widespread. They also made it available to high schools in the Dartmouth area and put a considerable amount of effort into promoting the language. As a result, knowledge of BASIC became relatively widespread (for a computer language) and BASIC was implemented by a number of manufacturers, becoming fairly popular on newer minicomputers like the DEC PDP series and the Data General Nova. In these instances the language tended to be implemented as an interpreter, instead of (or in addition to) a compiler.

Several years after its release, highly-respected computer professionals, notably Edsger W. Dijkstra, expressed their opinions that the use of GOTO statements, which existed in many languages including BASIC, promoted poor programming practices.[2] Some have also derided BASIC as too slow (most interpreted versions are slower than equivalent compiled versions) or too simple (many versions, especially for small computers left out important features and capabilities).

Explosive growth — the home computer era

Commodore BASIC V2.Notwithstanding the language's use on several minicomputers, it was the introduction of the MITS Altair 8800 microcomputer in 1975 that provided BASIC a path to universality. Most programming languages required more memory (and/or disk space) than were available on the small computers most users could afford. With the slow memory access that tapes provided and the lack of suitable text editors, a language like BASIC which could satisfy these constraints was attractive. BASIC also had the advantage that it was fairly well known to the young designers who took an interest in microcomputers. Kemeny and Kurtz's earlier proselytizing paid off in this respect. One of the first to appear for the 8080 machines like the Altair was Tiny BASIC, a simple BASIC implementation originally written by Dr. Li-Chen Wang, and then ported onto the Altair by Dennis Allison at the request of Bob Albrecht (who later founded Dr. Dobb's Journal). The Tiny BASIC design and the full source code were published in 1976 in DDJ.

MSX BASIC version 3.0In 1975, MITS released Altair BASIC, developed by Bill Gates and Paul Allen as Micro-Soft. The first Altair version was co-written by Gates, Allen and Monte Davidoff. Versions of Microsoft BASIC soon started appearing on other platforms under license, and millions of copies and variants were soon in use; it became one of the standard languages on the Apple II (based on the quite different 6502 MPU). By 1979, Microsoft was talking with several microcomputer vendors, including IBM, about licensing a BASIC interpreter for their computers. A version was included in the IBM PC ROM chips and PCs without floppy disks automatically booted into BASIC just like many other small computers.

Newer companies attempted to follow the successes of MITS, IMSAI, North Star and Apple, thus creating a home computer industry; meanwhile, BASIC became a standard feature of all but a very few home computers. Most came with a BASIC interpreter in ROM, thus avoiding the unavailable, or too expensive, disk problem. Soon there were many millions of machines running BASIC variants around the world, likely a far greater number than all the users of all other languages put together.
There are more dialects of BASIC than there are of any other programming language. Most of the home computers of the 1980s had a ROM-resident BASIC interpreter.

The BBC published BBC BASIC, developed for them by Acorn Computers Ltd, incorporating many extra structuring keywords, as well as comprehensive and versatile direct access to the operating system. It also featured a fully integrated assembler. BBC BASIC was a very well-regarded dialect, and made the transition from the original BBC Micro computer to more than 30 other platforms.

During this growth time for BASIC, many magazines were published such as Creative Magazine that included complete source codes for games, utilities, and other programs. Given BASIC's straightforward nature, it was considered a simple matter to type in the code from the magazine and execute the program. Different magazines were published featuring programs for specific computers, though some BASIC programs were universal and could be input into any BASIC-using machine.

Maturity — the personal computer era

GW-BASIC 3.22, shown here with the simple Hello world programMany newer BASIC versions were created during this period. Microsoft sold several versions of BASIC for MS-DOS/PC-DOS including BASICA, GW-BASIC (a BASICA-compatible version that did not need IBM's ROM) and QuickBASIC. Turbo Pascal-publisher Borland published Turbo BASIC 1.0 in 1985 (successor versions are still being marketed by the original author under the name PowerBASIC).

These languages introduced many extensions to the original home computer BASIC, such as improved string manipulation and graphics support, access to the file system and additional data types. More important were the facilities for structured programming, including additional control structures and proper subroutines supporting local variables.

However, by the latter half of the 1980s newer computers were far more capable with more resources. At the same time, computers had progressed from a hobbyist interest to tools used primarily for applications written by others, and programming became less important for most users. BASIC started to recede in importance, though numerous versions remained available. Compiled BASIC or CBASIC is still used in many IBM 4690 OS point of sale systems.

BASIC's fortunes reversed once again with the introduction of Visual Basic by Microsoft. It is somewhat difficult to consider this language to be BASIC, because of the major shift in its orientation towards an object-oriented and event-driven perspective. While this could be considered an evolution of the language, few of the distinctive features of early Dartmouth BASIC, such as line numbers and the INPUT keyword, remain.

Many BASIC dialects have also sprung up in the last few years, including Bywater BASIC and True BASIC (the direct successor to Dartmouth BASIC from a company controlled by Kurtz). Recently, the remaining community using Microsoft's pre-Visual Basic products have begun to switch wholesale to FreeBASIC, a GPLed compiler which has been in the process of moving BASIC onto a GCC backend. Many other BASIC variants and adaptations have been written by hobbyists, equipment developers, and others, as it is a relatively simple language to develop translators for. An example of an open source interpreter, written in C, is MiniBasic.

The ubiquity of BASIC interpreters on personal computers was such that textbooks once included simple TRY IT IN BASIC exercises that encouraged students to experiment with mathematical and computational concepts on classroom or home computers. Futurist and sci-fi writer David Brin mourns the loss of ubiquitous BASIC in a recent Salon article Why Johnny Can't Code.

Examples
A first program
New BASIC programmers on a home computer might start with a simple program similar to the Hello world program made famous by Kernighan and Ritchie. This generally involves a simple use of the language's PRINT statement to display the message (such as the programmer's name) to the screen. Often an infinite loop was used to fill the display with the message.

Classic BASIC
Note that this example is actually well structured, demonstrating that use of the GOTO statement need not necessarily lead to an unstructured program.
10 INPUT "What is your name: "; U$
20 PRINT "Hello "; U$
30 REM
40 INPUT "How many stars do you want: "; N
50 S$ = ""
60 FOR I = 1 TO N
70 S$ = S$ + "*"
80 NEXT I
90 PRINT S$
100 REM
110 INPUT "Do you want more stars? "; A$
120 IF LEN(A$) = 0 THEN GOTO 110
130 A$ = LEFT$(A$, 1)
140 IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40
150 PRINT "Goodbye ";
160 FOR I = 1 TO 200
170 PRINT U$; " ";
180 NEXT I
190 PRINT
Modern BASIC
"Modern" structured BASICs (for example, QuickBASIC, BCX, FreeBasic, PureBasic, BBC BASIC for Windows, Blitz BASIC, PowerBASIC, and TrueBASIC) support classic commands such as GOTO statements to varying degrees, while adding many more modern keywords.
The previous example in QuickBASIC:
INPUT "What is your name"; UserName$
PRINT "Hello "; UserName$
DO
INPUT "How many stars do you want"; NumStars
Stars$ = ""
Stars$ = REPEAT$("*", NumStars) ' <- ANSI BASIC
--or--
Stars$ = STRING$(NumStars, "*") ' <- MS BASIC
PRINT Stars$
DO
INPUT "Do you want more stars"; Answer$
LOOP UNTIL Answer$ <> ""
Answer$ = LEFT$(Answer$, 1)
LOOP WHILE UCASE$(Answer$) = "Y"
PRINT "Goodbye ";
FOR I = 1 TO 200
PRINT UserName$; " ";
NEXT I
PRINT
For comparison, the same program in the more modern PureBasic:
OpenConsole()
Print("What is your name ")
UserName$ = Input()
PrintN("Hello " + UserName$)
Repeat
Print("How many stars do you want ")
NumStars = Val(Input())
Stars$ = RSet("", NumStars, "*")
PrintN(Stars$)
Repeat
Print("Do you want more stars ")
Answer$ = Input()
Until Answer$ <> ""
Answer$ = Left(Answer$, 1)
Until UCase(Answer$) <> "Y"
Print("Goodbye ")
For I = 1 To 200
Print(UserName$ + " ")
Next I
PrintN("")
CloseConsole()
[edit] See also
List of BASIC dialects
List of BASIC dialects by platform
Notes
^ The acronym is tied to the name of an unpublished paper by Thomas Kurtz and is not a backronym, as is sometimes suggested.

^ In a 1968 letter, Dutch computer scientist Edsger Dijkstra considered programming languages using GOTO statements for program structuring purposes harmful for the productivity of the programmer as well as the quality of the resulting code ("Go To Statement Considered Harmful", Communications of the ACM Volume 11, 147-148. 1968).

The letter, which contributed the phrase considered harmful to programming jargon, did not mention any particular programming language; instead it states that the overuse of GOTO is damaging and gives technical reasons why this should be so. In a 1975 tongue-in-cheek article, "How do We Tell Truths that Might Hurt", Sigplan Notices Volume 17 No. 5, Dijkstra gives a list of uncomfortable "truths", including his opinion of several programming languages of the time, such as BASIC. While the GOTO statement is often associated with BASIC, it receives no worse treatment in the piece than PL/I, COBOL or APL




Lisp
Lisp was invented by John McCarthy in 1958 while he was at MIT. McCarthy published its design in a paper in Communications of the ACM in 1960, entitled "Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I"[1](Part II was never published). He showed that with a few simple operators and a notation for functions, one can build a Turing-complete language for algorithms.

Lisp was first implemented by Steve Russell on an IBM 704 computer. Russell had read McCarthy's paper, and realized (to McCarthy's surprise) that the eval function could be implemented as a Lisp interpreter.

The first complete Lisp compiler, written in Lisp, was implemented in 1962 by Tim Hart and Mike Levin at MIT.[2] This compiler introduced the Lisp model of incremental compilation, in which compiled and interpreted functions can intermix freely. The language used in Hart and Levin's memo is much closer to modern Lisp style than McCarthy's earlier code.

Curiosities of the early history

Information Processing Language was the first AI language, from 1955 or 1956, and already included many of the concepts, such as list-processing and recursion, which came to be used in Lisp.

McCarthy's original notation used bracketed "M-expressions" that would be translated into S-expressions. As an example, the M-expression car[cons[A,B]] is equivalent to the S-expression (car (cons A B)). Once Lisp was implemented, programmers rapidly chose to use S-expressions, and M-expressions were abandoned. M-expressions surfaced again with short-lived attempts of MLISP[3] by Horace Enea and CGOL by Vaughan Pratt.

Two assembly language macros for the IBM 704 became the primitive operations for decomposing lists: car (Contents of Address Register) and cdr (Contents of Decrement Register). Lisp dialects still use car and cdr (pronounced: [kr] and ['kdr]) for the operations that return the first item in a list and the rest of the list respectively.

Lisp and AI

Since its inception, Lisp was closely connected with the artificial intelligence research community, especially on PDP-10[4] systems. Lisp was used as the implementation of the programming language Micro Planner that was the foundation for the famous AI system SHRDLU. In the 1970s, as AI research spawned commercial offshoots, the performance of existing Lisp systems became a growing issue.
Partly because of garbage collection and partly because of its representation of internal structures, Lisp became difficult to run on the memory-limited stock hardware of the day. (The specific garbage collection routines for LISP were coded by then-MIT graduate student Daniel Edwards. This was a significant accomplishment because it made it practical to run Lisp on any general-purpose computing system.) This led to the creation of LISP machines: dedicated hardware for running Lisp environments and programs. Along with modern compiler construction techniques, gigantic computer capacities (by the standards of the 1970s) have made this specialization unnecessary, so Lisp environments are now available without dedicated hardware.

During the 1980s and 1990s, a great effort was made to unify the numerous Lisp dialects (most notably, InterLisp, Maclisp, ZetaLisp, and Franz Lisp) into a single language. The new language, Common Lisp, was essentially a compatible subset of the dialects it replaced. In 1994, ANSI published the Common Lisp standard, "ANSI X3.226-1994 Information Technology Programming Language Common Lisp." At that time the world market for Lisp was much smaller than it is today.

Lisp today

Having declined somewhat in the 1990s, Lisp has experienced a regrowth of interest since 2000. Most new activity is focused around open source implementations of Common Lisp, and includes the development of new portable libraries and applications. Tiobe Software, which ranks programming languages' popularity by measuring online discussions, ranks Lisp as the #17 programming language in December 2006.

Many new Lisp programmers were inspired by writers such as Paul Graham and Eric S. Raymond to pursue a language others consider antiquated. New Lispers often describe the language as an eye-opening experience and claim to be substantially more productive than in other languages.

Peter Seibel's Practical Common Lisp, a tutorial for new Lisp programmers published in 2004, was briefly Amazon.com's second most popular programming book.[citation needed]
The language is among the oldest programming languages still in use as of the time of writing in 2006. Algol, Fortran and COBOL are of a similar vintage.

Language innovations

Lisp was the first homoiconic programming language: the primary representation of program code is the same type of list structure that is also used for the main data structures. As a result, Lisp functions can be manipulated, altered or even created within a Lisp program without extensive parsing or manipulation of binary machine code. This is generally considered one of the primary advantages of the language with regards to its expressiveness, and makes the language amenable to metacircular evaluation.

The now-ubiquitous if-then-else structure, now taken for granted as an essential element of any programming language, was invented by McCarthy for use in Lisp, where it saw its first appearance in a more general form (the cond structure). It was inherited by Algol, which popularized it.

Lisp deeply influenced Alan Kay, the leader of the research on Smalltalk, and then in turn Lisp was influenced by Smalltalk, by adopting object-oriented programming features (classes, instances, etc.) in the late 1970s. Largely because of its resource requirements with respect to early computing hardware (including early microprocessors), Lisp did not become as popular outside of the AI community as Fortran and the ALGOL-descended C language. Newer languages such as Java and Python have incorporated some limited versions of some of the features of Lisp, but are necessarily unable to bring the coherence and synergy of the full concepts found in Lisp. Because of its suitability to ill-defined, complex, and dynamic applications, Lisp is currently enjoying some resurgence of popular interest.
See also "The evolution of Lisp"[7], a paper written by Guy L. Steele, Jr. and Richard P. Gabriel.

Syntax and semantics

Note: This article's examples are written in Common Lisp (though most are also valid Scheme).

Lisp is an expression-oriented language. Unlike most other languages, no distinction is made between "expressions" and "statements"; all code and data are written as expressions. When an expression is evaluated, it produces a value (or list of values), which then can be embedded into other expressions.

McCarthy's 1958 paper introduced two types of syntax: S-expressions (Symbolic Expressions, also called "sexps"), which mirror the internal representation of code and data; and M-expressions (Meta Expressions), which express functions of S-expressions. M-expressions never found favour, and almost all Lisps today use S-expressions to manipulate both code and data.

The heavy use of parentheses in S-expressions has been criticized — some joke acronyms for Lisp are "Lots of Irritating Superfluous Parentheses"[2], "Let's Insert Some Parentheses", or "Long Irritating Series of Parentheses" — but the S-expression syntax is also responsible for much of Lisp's power; the syntax is extremely regular, which facilitates manipulation by computer. However, the syntax of Lisp is not limited to traditional parentheses notation. It can be extended to include alternative notations. XMLisp, for instance, is a Common Lisp extension that employs the metaobject-protocol to integrate S-expressions with the Extensible Markup Language (XML).

The reliance on expressions gives the language great flexibility. Because Lisp functions are themselves written as lists, they can be processed exactly like data. This allows easy writing of programs which manipulate other programs (metaprogramming). Many Lisp dialects exploit this feature using macro systems, which enables extension of the language almost without limit.

A Lisp list is written with its elements separated by whitespace, and surrounded by parentheses. For example, (1 2 foo) is a list whose elements are three atoms, the values 1, 2, and foo. These values are implicitly typed: they are respectively two integers and a Lisp-specific data type called a "symbol", and do not have to be declared as such.

The empty list () is also represented as the special atom nil. This is the only entity in Lisp which is both an atom and a list. Expressions are written as lists, using prefix notation. The first element in the list is the name of a form, i.e., a function, operator, macro, or "special operator" (see below.) The remainder of the list are the arguments. For example, the function list returns its arguments as a list, so the expression

(list '1 '2 'foo) evaluates to the list (1 2 foo). The "quote" before the arguments in the preceding example is a "special operator" which prevents the quoted arguments being evaluated (not strictly necessary for the numbers, since 1 evaluates to 1, etc). Any unquoted expressions are recursively evaluated before the enclosing expression is evaluated.

For example,
(list 1 2 (list 3 4))
evaluates to the list (1 2 (3 4)). Note that the third argument is a list; lists can be nested.
Arithmetic operators are treated similarly. The expression
(+ 1 2 3 4)
evaluates to 10. The equivalent under infix notation would be "1 + 2 + 3 + 4". Arithmetic operators in Lisp are variadic (or n-ary), able to take any number of arguments.
"Special operators" (sometimes called "special forms" by older users) provide Lisp's control structure. For example, the special operator if takes three arguments. If the first argument is non-nil, it evaluates to the second argument; otherwise, it evaluates to the third argument. Thus, the expression
(if nil
(list 1 2 "foo")
(list 3 4 "bar"))
evaluates to (3 4 "bar"). (Of course, this would be more useful if a non-trivial expression had been substituted in place of nil!)

Lambda expressions
Another special operator, lambda, is used to bind variables to values which are then evaluated within an expression. This operator is also used to create functions: the arguments to lambda are a list of arguments, and the expression or expressions to which the function evaluates (the returned value is the value of the last expression that is evaluated). The expression
(lambda (arg) (+ arg 1))
is an expression which, when applied, takes one argument, bound to arg and returns the number one greater than that argument. Lambda expressions are treated no differently from named functions; they are invoked the same way. Therefore, the expression
((lambda (arg) (+ arg 1)) 5)
evaluates to 6.

Atoms

In the original LISP there were two fundamental data types: atoms and lists. A list was a finite ordered sequence of elements, where each element is in itself either an atom or a list, and an atom was a number or a symbol. A symbol was essentially a unique named item, written as an Alphanumeric string in source code, and used either as a variable name or as a data item in symbolic processing. For example, the list (FOO (BAR 1) 2) contains three elements: the symbol FOO, the list (BAR 1), and the number 2.
The essential difference between atoms and lists was that atoms were immutable and unique. Two atoms that appeared in different places in source code but were written in the exact same way represented the same object, whereas each list was a separate object that could be altered independently of other lists and could be distinguished from other lists by comparison operators.
As more data types were introduced in later Lisp dialects, and programming styles evolved, the concept of an atom lost importance. Many dialects still retained the predicate atom for legacy compatibility, defining it as true for anything that is not a cons cell (ie. a list or a partial list).

Conses and lists
Main article: Cons

A Lisp list is a singly-linked list. Each cell of this list is called a cons (in Scheme, a pair), and is composed of two pointers, called the car and cdr respectively. These are equivalent to the data and next fields discussed in the article linked list.
Of the many data structures that can be built out of singly-linked lists, one of the most basic is called a proper list. A proper list is either the special nil (empty list) symbol, or a cons in which the car points to a datum (which may be another cons structure, such as a list), and the cdr points to another proper list.

If a given cons is taken to be the head of a linked list, then its car points to the first element of the list, and its cdr points to the rest of the list. For this reason, the car and cdr functions are also called first and rest when referring to conses which are part of a linked list (rather than, say, a tree).
Thus, a Lisp list is not an atomic object, as an instance of a container class in C++ or Java would be. A list is nothing more than an aggregate of linked conses. A variable which refers to a given list is simply a pointer to the first cons in the list. Traversal of a list can be done by "cdring down" the list; that is, taking successive cdrs to visit each cons of the list; or by using any of a number of higher-order functions to map a function over a list.
Parenthesized S-expressions represent linked list structure. There are several ways to represent the same list as an S-expression. A cons can be written in dotted-pair notation as (a . b), where a is the car and b the cdr. A longer proper list might be written (a . (b . (c . (d . nil)))) in dotted-pair notation. This is conventionally abbreviated as (a b c d) in list notation. An improper list may be written in a combination of the two – as (a b c . d) for the list of three conses whose last cdr is d (i.e., the list (a . (b . (c . d))) in fully-specified form).
Because conses and lists are so universal in Lisp systems, it is a common misconception that they are Lisp's only data structures. In fact, all but the most simplistic Lisps have other data structures – such as vectors (arrays), hash tables, structures, and so forth.

List-processing procedures
Lisp provides many built-in procedures for accessing and controlling lists. Lists can be created directly with the list procedure, which takes any number of arguments, and returns the list of these arguments.
(list 1 2 'a 3)
;Output: (1 2 a 3)
(list 1 '(2 3) 4)
;Output: (1 (2 3) 4)
Because of the way that lists are constructed from cons pairs, the cons procedure can be used to add an element to the front of a list. Note that the cons procedure is asymmetric in how it handles list arguments, because of how lists are constructed.
(cons 1 '(2 3))
;Output: (1 2 3)
(cons '(1 2) '(3 4))
;Output: ((1 2) 3 4)
The append procedure appends two (or more) lists to one another. Because Lisp lists are linked lists, appending two lists has asymptotic time complexity O(n).
(append '(1 2) '(3 4))
;Output: (1 2 3 4)
(append '(1 2 3) '() '(a) '(5 6))
;Output: (1 2 3 a 5 6)
[edit] Shared structure
Lisp lists, being simple linked lists, can share structure with one another. That is to say, two lists can have the same tail, or final sequence of conses. For instance, after the execution of the following Common Lisp code:
(setq foo (list 'a 'b 'c))
(setq bar (cons 'x (cdr foo)))
the lists foo and bar are (a b c) and (x b c) respectively. However, the tail (b c) is the same structure in both lists.
In many languages, the usual way to place the same data in two different structures is to copy it. Sharing structure rather than copying can give a dramatic performance improvement. However, this technique can interact in undesired ways with functions that alter lists passed to them as arguments. Altering one list, such as by replacing the c with a goose, will affect the other:
(setf (third foo) 'goose)
This changes foo to (a b goose), but also changes bar to (x b goose) – a possibly unexpected result. This can be a source of bugs, and functions which alter their arguments are documented as destructive for this very reason.
Aficionados of functional programming avoid destructive functions. In the Scheme dialect, which favors the functional style, the names of destructive functions are marked with a cautionary exclamation point, or "bang" — such as set-car! (read set car bang), which replaces the car of a cons. In the Common Lisp dialect, destructive functions are commonplace; the equivalent of set-car! is named rplaca for "replace car." This function is rarely seen however as Common Lisp includes a special facility, setf, to make it easier to define and use destructive functions. A frequent style in Common Lisp is to write code functionally (without destructive calls) when prototyping, then to add destructive calls as an optimization where it is safe to do so.

Self-evaluating forms and quoting
Lisp evaluates expressions which are entered by the user. Symbols and lists evaluate to some other (usually, simpler) expression – for instance, a symbol evaluates to the value of the variable it names; (+ 2 3) evaluates to 5. However, most other forms evaluate to themselves: if you enter 5 into Lisp, you just get back 5.

Any expression can also be marked to prevent it from being evaluated (as is necessary for symbols and lists). This is the role of the quote special operator, or its abbreviation ' (a single quotation mark). For instance, usually if you enter the symbol foo you will get back the value of the corresponding variable (or an error, if there is no such variable). If you wish to refer to the literal symbol, you enter (quote foo) or, usually, 'foo.

Both Common Lisp and Scheme also support the backquote operator (often called quasiquote by Schemers), entered with the ` character. This is almost the same as the plain quote, except it allows variables to be interpolated into a quoted list with the comma and comma-at operators. If the variable snue has the value (bar baz) then `(foo ,snue) evaluates to (foo (bar baz)), while `(foo ,@snue) evaluates to (foo bar baz). The backquote is most frequently used in defining macro expansions.

Self-evaluating forms and quoted forms are Lisp's equivalent of literals. However, they are not necessarily constants. In some Lisp dialects it is possible to modify the values of literals in program code. For instance, if a quoted form is used in the body of a function, and is changed as a side-effect, that function's behavior may differ on subsequent iterations. This is usually a bug. When behavior like this is intentional, using a closure is the explicit way to do it.

Lisp's formalization of quotation has been noted by Douglas Hofstadter (in Gödel, Escher, Bach) and others as an example of the philosophical idea of self-reference.

Scope and closure
The modern Lisp family splits over the use of dynamic or static (aka lexical) scope. Scheme and Common Lisp make use of static scoping by default, while the more primitive Lisp systems used as embedded languages in Emacs and AutoCAD use dynamic scoping.


List structure of program code
A fundamental distinction between Lisp and other languages is that in Lisp, program code is not simply text. Parenthesized S-expressions, as depicted above, are the printed representation of Lisp code, but as soon as these are entered into a Lisp system they are translated by the parser (called the read function) into linked list and tree structures in memory.

Lisp macros operate on these structures. Because Lisp code has the same structure as lists, macros can be built with any of the list-processing functions in the language. In short, anything that Lisp can do to a data structure, Lisp macros can do to code. In contrast, in most other languages the parser's output is purely internal to the language implementation and cannot be manipulated by the programmer. Macros in C, for instance, operate on the level of the preprocessor, before the parser is invoked, and cannot re-structure the program code in the way Lisp macros can.

In simplistic Lisp implementations, this list structure is directly interpreted to run the program; a function is literally a piece of list structure which is traversed by the interpreter in executing it. However, most actual Lisp systems (including all conforming Common Lisp systems) also include a compiler. The compiler translates list structure into machine code or bytecode for execution.

Evaluation and the Read-Eval-Print Loop

Lisp languages are frequently used with an interactive command line, which may be combined with an integrated development environment. The user types in expressions at the command line, or directs the IDE to transmit them to the Lisp system. Lisp reads the entered expressions, evaluates them, and prints the result. For this reason, the Lisp command line is called a "read-eval-print loop", or REPL.

The basic operation of the REPL is as follows. This is a simplistic description which omits many elements of a real Lisp, such as quoting and macros. The read function accepts textual S-expressions as input, and parses them into list structure. For instance, if you type the string (+ 1 2) at the prompt, read translates this into a linked list with three elements – the symbol +, the number 1, and the number 2. It so happens that this list is also a valid piece of Lisp code; that is, it can be evaluated. This is because the car of the list names a function – the addition operation.

The eval function evaluates list structure, returning some other piece of structure as a result. Evaluation does not have to mean interpretation; some Lisp systems compile every expression to native machine code. It is simple, however, to describe evaluation as interpretation: To evaluate a list whose car names a function, eval first evaluates each of the arguments given in its cdr, then applies the function to the arguments. In this case, the function is addition, and applying it to the argument list (1 2) yields the answer 3. This is the result of the evaluation. Evaluation is performed in applicative order.
It is the job of the print function to represent output to the user. For a simple result such as 3 this is trivial. An expression which evaluated to a piece of list structure would require that print traverse the list and print it out as an S-expression.
To implement a Lisp REPL, it is necessary only to implement these three functions and an infinite-loop function. (Naturally, the implementation of eval will be complicated, since it must also implement all special operators like if.) This done, a basic REPL itself is but a single line of code: (loop (print (eval (read)))).

Control structures

Lisp originally had very few control structures, but many more were added during the language's evolution. (Lisp's original conditional operator, cond, is the precursor to later if-then-else structures.)

Programmers in the Scheme dialect often express loops using tail recursion. Scheme's commonality in academic computer science has led some students to believe that tail recursion is the only, or the most common, way to write iterations in Lisp; this is incorrect. All frequently-seen Lisp dialects have imperative-style iteration constructs, from Scheme's straightforward do loop to Common Lisp's complex loop expressions.

Some Lisp control structures are special operators, equivalent to other languages' syntactic keywords. Expressions using these operators have the same surface appearance as function calls, but differ in that the arguments are not necessarily evaluated -- or, in the case of an iteration expression, may be evaluated more than once.

In contrast to most other major programming languages, Lisp allows the programmer to implement control structures using the language itself. Several control structures are implemented as Lisp macros, and can even the programmer who wants to know how they work expand macro.

Both Common Lisp and Scheme have operators for non-local control flow. The differences in these operators are some of the deepest differences between the two dialects. Scheme supports re-entrant continuations using the call/cc procedure, which allows a program to save (and later restore) a particular place in execution. Common Lisp does not support re-entrant continuations, but does support several ways of handling escape continuations.

Frequently, the same algorithm can be expressed in Lisp in either an imperative or a functional style. As noted above, Scheme tends to favor the functional style, using tail recursion and continuations to express control flow. However, imperative style is still quite possible. The style preferred by many Common Lisp programmers may seem more familiar to programmers used to structured languages such as C, while that preferred by Schemers more closely resembles pure-functional languages such as Haskell.
Because of Lisp's early heritage in list processing, it has a wide array of higher-order functions relating to iteration over sequences. In many cases where an explicit loop would be needed in other languages (like a for loop in C) in Lisp the same task can be accomplished with a higher-order function. (The same is true of many functional programming languages.)

A good example is a function which in Scheme is called map and in Common Lisp is called mapcar. Given a function and one or more lists, mapcar applies the function successively to the lists' elements in order, collecting the results in a new list:
(mapcar #'+ '(1 2 3 4 5) '(10 20 30 40 50))
This applies the + function to each corresponding pair of list elements, yielding the result (11 22 33 44 55).

Examples

Here are examples of Common Lisp code. While unlike Lisp programs used in industry, they are similar to Lisp as taught in computer science courses.
The basic "Hello world" program:
(print "Hello world")
(print (list 'Hello 'world))
As the reader may have noticed from the above discussion, Lisp syntax lends itself naturally to recursion. Mathematical problems such as the enumeration of recursively-defined sets are simple to express in this notation.
Evaluate a number's factorial:
(defun factorial (n)
(if (<= n 1)
1
(* n (factorial (- n 1)))))
An alternative implementation, often faster than the previous version if the Lisp system has tail recursion optimization:
(defun factorial (n &optional (acc 1))
(if (<= n 1)
acc
(factorial (- n 1) (* acc n))))
Contrast with an iterative version which uses Common Lisp's loop macro:
(defun factorial (n)
(loop for i from 1 to n
for fac = 1 then (* fac i)
finally (return fac)))
The following function reverses a list. (Lisp's built-in reverse function does the same thing.)
(defun -reverse (l &optional acc)
(if (atom l)
acc
(-reverse (cdr l) (cons (car l) acc))))



C++

C++ (pronounced "see plus plus", IPA: [siː plʌs plʌs]) is a general-purpose, high-level programming language with low-level facilities. It is a statically typed free-form multi-paradigm language supporting procedural programming, data abstraction, object-oriented programming, generic programming and RTTI. Since the 1990s, C++ has been one of the most popular commercial programming languages.

Bjarne Stroustrup developed C++ (originally named "C with Classes") in 1983 at Bell Labs as an enhancement to the C programming language. Enhancements started with the addition of classes, followed by, among other features, virtual functions, operator overloading, multiple inheritance, templates, and exception handling. The C++ programming language standard was ratified in 1998 as ISO/IEC 14882:1998, the current version of which is the 2003 version, ISO/IEC 14882:2003. A new version of the standard (known informally as C++0x) is being developed.

Stroustrup began work on C with Classes in 1979. The idea of creating a new language originated from Stroustrup's experience in programming for his Ph.D. thesis. Stroustrup found that Simula had features that were very helpful for large software development, but the language was too slow for practical use, while BCPL was fast but too low-level and unsuitable for large software development. When Stroustrup started working in Bell Labs, he had the problem of analyzing the UNIX kernel with respect to distributed computing. Remembering his Ph.D. experience, Stroustrup set out to enhance the C language with Simula-like features. C was chosen because it is general-purpose, fast, and portable. Besides C and Simula, some other languages which inspired him were ALGOL 68, Ada, CLU and ML. At first, the class, derived class, strong type checking, inlining, and default argument features were added to C via Cfront. The first commercial release occurred in October 1985.[1]

In 1983, the name of the language was changed from C with Classes to C++. New features were added including virtual functions, function name and operator overloading, references, constants, user-controlled free-store memory control, improved type checking, and a new single-line comment style with two forward slashes (//). In 1985, the first edition of The C++ Programming Language was released, providing an important reference to the language, as there was not yet an official standard. In 1989, Release 2.0 of C++ was released. New features included multiple inheritance, abstract classes, static member functions, const member functions, and protected members. In 1990, The Annotated C++ Reference Manual was published. This work became the basis for the future standard. Late addition of features included templates, exceptions, namespaces, new casts, and a Boolean type.

As the C++ language evolved, a standard library also evolved with it. The first addition to the C++ standard library was the stream I/O library which provided facilities to replace the traditional C functions such as printf and scanf. Later, among the most significant additions to the standard library, was the Standard Template Library.

After years of work, a joint ANSI-ISO committee standardized C++ in 1998 (ISO/IEC 14882:1998). For some years after the official release of the standard in 1998, the committee processed defect reports, and published a corrected version of the C++ standard in 2003. In 2005, a technical report, called the "Library Technical Report 1" (often known as TR1 for short) was released. While not an official part of the standard, it gives a number of extensions to the standard library which are expected to be included in the next version of C++. Support for TR1 is growing in almost all currently maintained C++ compilers. While the C++ language is royalty-free, the standard document itself is not freely available.

The name "C++"

This name is credited to Rick Mascitti (mid-1983) and was first used in December 1983. Earlier, during the research period, the developing language had been referred to as "new C", then "C with Classes". In computer science C++ is still referred to as a superstructure of C. The final name stems from C's "++" operator (which increments the value of a variable) and a common naming convention of using "+" to indicate an enhanced computer program. According to Stroustrup: "the name signifies the evolutionary nature of the changes from C". C+ was the name of an earlier, unrelated programming language.

Stroustrup addressed the origin of the name in the preface of later editions of his book, The C++ Programming Language, adding that "C++" might be inferred from the appendix of George Orwell's Nineteen Eighty-Four. Of the three segments of the fictional language Newspeak, the "C vocabulary" is the one dedicated to technical terms and jargon. "Doubleplus" is the superlative modifier for Newspeak adjectives. Thus, "C++" might hold the meaning "most extremely technical or jargonous" in Newspeak.

When Rick Mascitti was questioned informally in 1992 about the naming, he indicated that it was given in a tongue-in-cheek spirit. He never thought that it would become the formal name of the language.

A common joke of the name is that in c++ when you postfix ++ the addition happens only after the operation - it should be ++C and not c++.


Future development

C++ continues to evolve to meet future requirements. One group in particular, Boost.org, works to make the most of C++ in its current form and advises the C++ standards committee as to which features work well and which need improving. Current work indicates that C++ will capitalize on its multi-paradigm nature more and more. The work at Boost, for example, is greatly expanding C++'s functional and metaprogramming capabilities. A new version of the C++ standard is currently being worked on, entitled C++0x (denoting the fact it is expected to be released before 2010) which will include a number of new features.
Sample Program:

// // for std::cout
using namespace std; // import std:: names

int main()
{
cout <<"Hello World!"<<
// getch;
}




class Bird // the "generic" base class
{
public:
virtual void OutputName() {std::cout << "a bird";}
virtual ~Bird() {}
};

class Swan : public Bird // Swan derives from Bird
{
public:
void OutputName() {std::cout << "a swan";} // overrides virtual function
};

int main()
{
Bird* myBird = new Swan; // Declares a pointer to a generic Bird,
// and sets it pointing to a newly created Swan.

myBird->OutputName(); // This will output "a swan", not "a bird".

delete myBird;

//getch;
}










C

C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.[1] It has since spread to many other platforms, and is now one of the most widely used programming languages. C has also greatly influenced many other popular languages,[2] especially C++, which was originally designed as an enhancement to C. It is the most commonly used programming language for writing system software,[3][4] though it is also widely used for writing applications.

Early developments
The initial development of C occurred at AT&T Bell Labs between 1969 and 1973; according to Ritchie, the most creative period occurred in 1972. It was named "C" because many of its features were derived from an earlier language called "B," which according to Ken Thompson was a stripped down version of the BCPL programming language.

There are many legends as to the origin of C and the closely related Unix operating system, including these:

The development of Unix was the result of programmers' desire to play the Space Travel video-game. They had been playing it on their company's mainframe, but as it was underpowered and had to support about 100 users, Thompson and Ritchie found they did not have sufficient control over the spaceship to avoid collisions with the wandering space rocks. This led to the decision to port the game to an idle PDP-7 in the office. As this machine lacked an operating system, the two set out to develop one, based on several ideas from colleagues. Eventually it was decided to port the operating system to the office's PDP-11, but faced with the daunting task of translating a large body of custom-written assembly language code, the programmers began considering using a portable, high-level language so that the OS could be ported easily from one computer to another. They looked at using B, but it lacked functionality to take advantage of some of the PDP-11's advanced features. This led to the development of an early version of the C programming language.

The justification for obtaining the original computer to be used in developing the Unix operating system was to create a system to automate the filing of patents. The original version of the Unix system was developed in assembly language. Later, the entire operating system was rewritten in C, an unprecedented move at a time when nearly all operating systems were written in assembly.
By 1973, the C language had become powerful enough that most of the Unix kernel, originally written in PDP-11 assembly language, was rewritten in C. This was one of the first operating system kernels implemented in a language other than assembly. (Earlier instances include the Multics system (written in PL/I), and MCP (Master Control Program) for the Burroughs B5000 written in ALGOL in 1961.)



K&R C

In 1978, Dennis Ritchie and Brian Kernighan published the first edition of The C Programming Language. This book, known to C programmers as "K&R", served for many years as an informal specification of the language. The version of C that it describes is commonly referred to as "K&R C". The second edition of the book covers the later ANSI C standard.

K&R introduced several language features:

struct data types
long int data type
unsigned int data type
The =- operator was changed to -= to remove the semantic ambiguity created by the construct i=-10, which could be interpreted as either i =- 10 or i = -10
For many years after the introduction of ANSI C, K&R C was still considered the "lowest common denominator" to which C programmers restricted themselves when maximum portability was desired, since many older compilers were still in use, and because carefully written K&R C code can be legal ANSI C as well.

In early versions of C, only functions that returned a non-integer value needed to be declared if used before the function definition; a function used without any previous declaration was assumed to return an integer.

For example:

long int SomeFunction();
int OtherFunction();

int CallingFunction()
{
long int test1;
int test2;

test1 = SomeFunction();
if (test1 > 0) test2 = 0;
else test2 = OtherFunction();

return test2;
}
In the example, both SomeFunction and OtherFunction were declared before use. In K&R, OtherFunction declaration could be omitted.

Since K&R function declarations did not include any information about function arguments, function parameter type checks were not performed, although some compilers would issue a warning message if a local function was called with the wrong number of arguments, or if multiple calls to an external function used different numbers of arguments. Separate tools such as Unix's lint utility were developed that (among other things) could check for consistency of function use across multiple source files.

In the years following the publication of K&R C, several unofficial features were added to the language (since there was no standard), supported by compilers from AT&T and some other vendors.



JAVA


Java is an object-oriented programming language developed by Sun Microsystems in the early 1990s. Java applications are often compiled to bytecode, which may be compiled to native machine code at runtime.

The language itself derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. JavaScript, a scripting language, shares a similar name and has similar syntax, but is not directly related to Java.

Sun Microsystems provides a GNU General Public License implementation of a Java compiler and Java virtual machine, in compliance with the specifications of the Java Community Process, although the class library that is required to run Java programs is not free software

Java was started as a project called "Oak" by James Gosling in June 1991.[2] Gosling's goals were to implement a virtual machine and a language that had a familiar C/++ style of notation. The first public implementation was Java 1.0 in 1995. It promised "Write Once, Run Anywhere" (WORA), providing no-cost runtimes on popular platforms. It was fairly secure and its security was configurable, allowing network and file access to be restricted. Major web browsers soon incorporated the ability to run secure Java "applets" within web pages. Java became popular quickly. With the advent of "Java 2", new versions had multiple configurations built for different types of platform. For example, J2EE was for enterprise applications and the greatly stripped down version J2ME was for mobile applications.

In 1997, Sun approached the ISO/IEC JTC1 standards body and later the Ecma International to formalize Java, but it soon withdrew from the process.[3][4][5] Java remains a proprietary de facto standard that is controlled through the Java Community Process [6]. Sun makes most of its Java implementations available without charge, with revenue being generated by specialized products such as the Java Enterprise System. Sun distinguishes between its Software Development Kit (SDK) and Runtime Environment (JRE) which is a subset of the SDK, the primary distinction being that in the JRE the compiler is not present.

On November 13, 2006, Sun released parts of Java as Free/Open Source Software, under the GNU General Public License. The release of the complete sources under GPL is expected in the first quarter of 2007.


// Hello.java
import java.applet.Applet;
import java.awt.Graphics;

public class Hello extends Applet {
public void paint(Graphics gc) {
gc.drawString("Hello, world!", 65, 95);
}
}





Hello World Applet








// Hello.java
import java.io.*;
import javax.servlet.*;

public class Hello extends GenericServlet {
public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("Hello, world!");
pw.close();
}
}








VISUAL BASIC

Visual Basic (VB) is an event driven programming language and associated development environment from Microsoft for its COM programming model. VB has been replaced by Visual Basic .NET. The older version of VB was derived heavily from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using DAO, RDO, or ADO, and creation of ActiveX controls and objects.

A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations.

In business programming, Visual Basic has one of the largest user bases. With 62% of developers using some form of Visual Basic, it currently competes with C++ and JavaScript as the third most popular programming language behind C# and Java.[1]



Visual Basic was designed to be easy to learn and use. The language not only allows programmers to easily create simple GUI applications, but also has the flexibility to develop fairly complex applications as well. Programming in VB is a combination of visually arranging components or controls on a form, specifying attributes and actions of those components, and writing additional lines of code for more functionality. Since default attributes and actions are defined for the components, a simple program can be created without the programmer having to write many lines of code. Performance problems were experienced by earlier versions, but with faster computers and native code compilation this has become less of an issue.

Although programs can be compiled into native code executables from version 5 onwards, they still require the presence of runtime libraries of approximately 2 MB in size. This runtime is included by default in Windows 2000 and later, but for earlier versions of Windows it must be distributed together with the executable.

Forms are created using drag and drop techniques. A tool is used to place controls (e.g., text boxes, buttons, etc.) on the form (window). Controls have attributes and event handlers associated with them. Default values are provided when the control is created, but may be changed by the programmer. Many attribute values can be modified during run time based on user actions or changes in the environment, providing a dynamic application. For example, code can be inserted into the form resize event handler to reposition a control so that it remains centered on the form, expands to fill up the form, etc. By inserting code into the event handler for a keypress in a text box, the program can automatically translate the case of the text being entered, or even prevent certain characters from being inserted.

Visual Basic can create executables(EXE), ActiveX controls, DLL files, but is primarily used to develop Windows applications and to interface web database systems. Dialog boxes with less functionality (e.g., no maximize/minimize control) can be used to provide pop-up capabilities. Controls provide the basic functionality of the application, while programmers can insert additional logic within the appropriate event handlers. For example, a drop-down combination box will automatically display its list and allow the user to select any element. An event handler is called when an item is selected, which can then execute additional code created by the programmer to perform some action based on which element was selected, such as populating a related list.

Alternatively, a Visual Basic component can have no user interface, and instead provide ActiveX objects to other programs via Component Object Model (COM). This allows for server-side processing or an add-in module.

The language is garbage collected using reference counting, has a large library of utility objects, and has basic object oriented support. Since the more common components are included in the default project template, the programmer seldom needs to specify additional libraries. Unlike many other programming languages, Visual Basic is generally not case sensitive, although it will transform keywords into a standard case configuration and force the case of variable names to conform to the case of the entry within the symbol table entry. String comparisons are case sensitive by default, but can be made case insensitive if so desired.


JONAS GALILEO BELOCURA S.
RHYAN AYUBAN


2 Comments:

  • I really enjoyed your rundown on some of the major programming languages, so I blogged it here.

    Some of the newer languages are missing, such as C#, Python, Ruby, etc, as well as one of my favourite languages, Clipper, but you've got most of the major ones and there was loads of information I didn't know, so thanks!

    By Blogger Stephen Cronin, at 7:23 PM  

  • Hi,When looking for a website designer there is a lot more to consider, apart from the various technical aspects with Web Design Cochin when making a decision.Thanks......

    By Blogger Unknown, at 10:24 PM  

Post a Comment

<< Home