CSC 311 SURVEY OF PROGRAMMING OF PROGRAMMING LANGUAGES OVERVIEW OF PROGRAMING LANGUAGES

LECTURE ONE Lesson objectives By the end of this lesson, students should be able to:

 Understand programming and

 Describe flow of programming language

 Describe the structure of programming language

 Describe different classification of programming language

 Identify why are there so many programming languages

 Identify what makes a language successful

 Describe importance of programming language What is Programming? A program is a set of instructions use in performing specific task. Therefore, Programming is an act of writing programs. Meaning of Programming Language

Programming Languages are important for software technologies. It is a basic one, without it programming could not do a thing about software. It is a key factor to every software.

There are different types of programming languages that are currently trendy. Such as: • • C++ • Java • C# • Python • Ruby. etc

Normal Language is a communication between two people. We are using English, Tamil, Hindi and so on using communication between two people. Flow of programming Languages

Compiler

Compiler is an intermediary to understand each language. Compiler converts High level languages to low level languages as well as low level languages convert to high level languages. Each language needs at least one compiler. Without compiler we could not understand low level language.

Input

Output Structure of Programming Languages

Each programming Language has separate structure but a little bit changes in each programming change. Syntax wise we only have changes of each programming language otherwise it's the same structure. Header file is some supporting files. It is located at the top of program. Header file is the head of program. We call header file a different name in different languages. Like bellow. Header File -> C Language Header File -> C++ Language Package -> Java Language Namespace -> C# Language Main Function is important part of programming languages. Main function is like our body, each and every function happens in main function section. Main function is starting point of programming languages. Sub function is optional one. If need it we can use, otherwise leave it.

All programming language is syntax wise different apart from others, these are same. For example if I need to print one line using any program using below. printf(“Welcome To C# Corner”) C Language cout<<”Welcome To C# Corner”; C++ Language System.out.print(“Welcome To C# Java Language Corner”); Console.WritLine(“Welcome To C# C# language Corner”); A classification of languages

There are many systems of classifying languages, but for the present purposes the following division into four kinds of languages seems appropriate.

 Traditional programming languages include C, Pascal, Java, and many more; a first course in just "programming" will usually teach programming in one of these (but the exact choice beyond that has varied considerably over time). Common for these is that one uses an external compiler to transform source code into executable code (often but not always native machine code for the computer you run the compiler on). Primary concerns are speed of the executable code, detail specification of what should be done, and the ability to write large programs.

 Dynamic programming languages (also known as 'scripting languages') do typically not have a separate compiler; they may be interpreted (parse one instruction and then immediately execute it), compiled (at the time you run the program), or a combination thereof. Primary concerns are that programs should be easy to write and modify. Dynamic programming languages can often be run interactively, where you type instructions at a prompt and see them executed in turn.

 Specialised programming languages are in principle similar to the dynamic programming languages, but with a particular focus on one kind of data or one problem domain. This class includes the major systems (Maple, Mathematica, Maxima), the matrix-oriented Matlab, and the statistics-oriented language R.

 Unconventional programming languages is a catch-all category for "everything else". These are things which you can use for programming, but may be strange to use as such. If you end up in this category, you're probably doing something very clever or something very stupid, possibly both. Notes on specific languages

.Traditional languages

 C is a very low level language — it's been described as "structured assembly language" — but it constitutes a reference point to which most later languages have needed to relate themselves (as evidenced by the large number of languages that are named 'C-something'). The main thing to realize about C is that everything you write maps very directly onto machine code. The good thing about this is that C lets you do pretty much anything. It is perfectly possible to code anything in C, but it requires knowing what you're doing and also some discipline to keep things sane. Coding something in C means you're starting at a very low level, even if there are plenty of code libraries out there which might provide you with higher level operations.

 C++ (a name that may be interpreted as "successor of C") is an extension of C with features for object-oriented programming (OOP), which simplifies higher-level programming. C++ is a very large language, both because it contains all of C in addition to the object-oriented extensions, and because of how these extensions were implemented; a design goal has been that should be free to pick their own programming style (meaning that C++ should support some realization of said style, for every style imaginable).

 A good thing about C++ is that it comes with a standard library of data structures, that cater for most needs one tends to have in that direction. A problem can however be that the design of this library prioritizes being optimal (in the eyes of theoretical computer scientists of the 1990's), so sometimes the interfaces may appear obscure to the user who is not schooled in computer science.

 C# (Microsoft), Java (Sun/Oracle), and Objective-C (Apple) are three other languages that — like C++ — aim to be "similar to C, but higher level with object-orientation". Whereas C++ aims to support everything, these three are more inclined to pick one thing as the "correct" way of doing something, which allows them to be smaller. Another difference is that they are all being promoted by a particular company (as indicated), either because the language was invented there, or because it got adopted by the company.

 Haskell is a pure language (in contrast to the imperative nature of mainstream programming languages); this makes it close to pure mathematics, but can also make it hard to comprehend. The language has ties to category theory, which places it in high regard in certain research communities. The reason it is listed under "Traditional languages" is that one still uses a compiler to produce executable code. Dynamic languages

 JavaScript (or ECMA-script, as is nowadays the official name) is a dynamic programming language most known for its use in web pages (client-side scripting), but it is in fact a general programming language. Some nice things about it is that it is probably the most widely deployed dynamic language today (pretty much every web browser has it built in), it is fairly easy to make user interfaces for it (embed your program in an HTML file that serves as the user interface), and it's pretty fast (because much effort has been spent on optimizing engines for it) for being a dynamic programming language. A disadvantage is that since it's predominantly being used for scripting in webpages, it might be hard to find information about how to use this language for doing anything else.

 LISP is one of the oldest programming languages there is, and for many decades the obvious choice for anything "AI" (which was short for "Artificial Intelligence", but in practice could mean just about any computation that was not on simple numerical data). Though since the 1990's not fashionable anymore, it remains among the languages used for doing mathematical things, and the ELISP dialect is built into every Emacs editor.

 A close (and more modern) relative of LISP is Scheme. There is a rigorous definition distinguishing dialects of LISP from dialects of Scheme, but the details are somewhat technical (i.e., unless you know what to look for it might as well appear to be two dialects of a single language).

 A word of warning is that LISP (and Scheme) handles data at a pretty low level (similar to how C programs are close to machine code: you can express things using only structured concepts, but they really map onto lower level realizations, and there is little cushioning); this is in part due to the age of the language, as early LISP programs had to keep their data in very tiny memories (by today's standards). If you choose to use LISP, then you need to be aware of things like how what looks like a list of items is actually a linked list of cons cells, since most language operations presume that you know this.

 Python is probably the most fashionable dynamic language for mathematical/scientific calculations nowadays. It fits well within the current programming language mainstream, except perhaps in that it uses indentation to encode (rather than just indicate) block structures in programs.

 Tcl is a very simple language, and may as such be appropriate for the beginner , although some experienced programmers are confounded by it because the language does not implicitly do several things that they may be used to from other languages (such as distinguish between the number 11 and the string of two digits 1). All values in Tcl have a textual representation, and all commands can be specified in terms of their effects on the textual representation, so checking whether your subroutines calculate what they are supposed to is straightforward: just type in the command, with explicit textual representations for its argument, and see if the result is as you expected it to be.

 Tcl can be used alone, but it is also easy to integrate with C. One side of this is that functions written in C can be wrapped up as Tcl commands; the interface between the Tcl language and a user command implemented in C is similar to that between a command-line shell and system utility programs (such as grep), but far more lightweight (no separate processes or context switches). Another side is that Tcl provides a library of C functions for handling composite values (data structures), which handle many of the same needs as the standard C++ library does, even if with fewer bells and whistles. A classical C+Tcl development paradigm is to first implement everything in Tcl (because it's much easier) and then reimplement in C those things which need to be faster; many programs have fairly small performance-critical parts, if counting lines of code. Specialised languages

 Maple is a commercial developed by Waterloo Maple Inc. It is available for use in some MDH computer labs, but we can't provide student licenses (though there have been a couple of cases where the supervisors really wanted that).

 Mathematica is a commercial Computer Algebra System developed by Wolfram, Inc. (also providers of the web service). The command language of that system is being rebranded as the general purpose Wolfram language, but adoption outside Mathematica itself has been limited. Though programs can be written in a variety of styles, the language has a preference for the pattern-matching functional style. A distinguishing feature is that programs can be actual mathematical formulae, e.g., the integration operation may be named ∫ (integral sign) rather than really being some function Int that perhaps get prettyprinted as an integral sign (as is rather the case in most other CASes).

 Matlab is a fairly basic dynamic language, with the distinguishing feature that "everything is a matrix" (or at least most things are matrices; strings are for example 1×n matrices where element k holds the character code of the kth character in the string). But you've probably been subjected to Matlab already if you're advanced enough in your studies to begin writing a thesis, as it is used in several courses at MDH.

 Matlab can be quite efficient if you can make use of vectors and matrices to express iteration in your program, but ordinary loops are comparatively slow. It also displays many flaws typical of specialised languages, where language designers only added general programming features as an afterthought. One awkward trait is the rule that you need a separate source file for each subroutine in your program.

 Finally, Matlab is one of those systems for which there exist lots and lots of libraries for doing all sorts of computations. Being commercial, the set of libraries that are available may however vary quite a bit between different installations of Matlab; what works on an expensive premium installation need not be available in a basic installation. This can be a problem if switching between university computers and your own private computer.

 Maxima is an open source/free Computer Algebra System. It is implemented in LISP, but provides a more mathematical command language similar to that of Maple or Mathematica.

 R is an open source/free programming language and software environment for statistical computing and graphics. It is also installed in most MDH computer labs. Unconventional languages

 SQL is primarily a language for accessing databases. It can be surprisingly good at some calculations, if one can figure out how to phrase them as a query of tables in a database, but utterly useless for other things. SQL is rarely used as a stand-alone language, but very often to encode operations on a database issued by a program primarily written in another language. SQL has several known flaws (it was designed by a committee back in the 1970's), but it is fairly intuitive to use (SQL statements are for example quite readable even if you only know English).

 XSLT (abbreviation of eXtensible Stylesheet Language Transformations) was originally intended as a mechanism for generating formatted renderings (think web pages) of structured data (stored as an XML file), but for that it competes with many other technologies. On the other hand, it turned out to be quite useful for certain kinds of operations on the data, particularly such operations that make local transformations of the structure of the data — a description which covers algebraic transformations of symbolic expressions. XSLT is somewhat of a Swiss army knife in certain research communities, but is almost unknown in the mathematics mainstream. Why are there so many programming languages?

 evolution -- we've learned better ways of doing things over time

 socio-economic factors: proprietary interests, commercial advantage

 orientation toward special purposes

 orientation toward special hardware

 diverse ideas about what is pleasant to use What makes a language successful?

 easy to learn (BASIC, Pascal, LOGO, Scheme)

 easy to express things, easy use once fluent, "powerful” (C, Common Lisp, APL, Algol-68, Perl)

 easy to implement (BASIC, Forth)

 possible to compile to very good (fast/small) code (Fortran)

 backing of a powerful sponsor (COBOL, PL/1, Ada, Visual Basic)

 wide dissemination at minimal cost (Pascal, Turing, Java) Important of Programming Languages

Programming language is the heart of software. Without programming we cannot make many applications and software. Programming Language is a key factor of software as well as embedded systems. Without programming language we cannot communicate with machines or systems. Systems only know machine code. Machine codes mean some set of series of numbers. Machine code we can call bits.

Humans only know high level languages but machines do not know high level languages. Humans and machine could not communicate directly. We need one intermediate because humans could not understand machine languages like machines could not understand high level languages. Why study programming Languages  Help you choose a language.  C vs. Modula-3 vs. C++ for systems programming  Fortran vs. APL vs. Ada for numerical computations  Ada vs. Modula-2 for embedded systems  Common Lisp vs. Scheme vs. ML for symbolic data manipulation  Java vs. C/CORBA for networked PC programs  Make it easier to learn new languages some languages are similar; easy to walk down family tree  Help you make better use of whatever language you use  •In C, help you understand unions, arrays & pointers, separate compilation, varargs, catch and throw  •In Common Lisp, help you understand first-class functions/closures, streams, catch and throw, symbol internals Resource Material(s)

•S.O. Akinola , “Structured programming with Java” •Java™ Programming Language, sun services •Overview of Programming Languages - Mälardalen University Sweden