Jan 19, 2021, 04:54 AM

News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!


Paradigms of Programming Languages

Started by sukishan, Jul 12, 2009, 11:30 PM

previous topic - next topic
Go Down

sukishan

Paradigms of Programming Languages

Although many different computer architectures are being developed, the most prevalent is still the traditional von Neumann architecture - consisting of a single sequential CPU separate from memory, with data piped between cpu and memory. This is reflected in the design of the dominant computer languages, with dynamic variables (representing memory cells with changing values); sequential iteration (reflecting the single sequential cpu); assignment statements (reflecting piping). This combination of choices gives rise to the imperative language paradigm - C, Ada, Pascal, FORTRAN, COBOL, Basic etc.

But other choices are possible - variables do not have to directly reflect memory cells (logic programming); repetition need not be iterative (logic, functional, concurrent); assignment need not be important (logic, functional); data and control need not be separated (object oriented, functional).

A paradigm is essentially a high level model of what computation is about - the unifying factor that makes Ada and C seem very similar, ignoring details such as what data or control structures are available, exactly how variables are passed to procedures, and so on.


Some Paradigms

Procedural (COBOL, FORTRAN, Pascal, C)
functional (LISP)
logic (PROLOG)
structured
object-oriented (Smalltalk)
4GL (Dbase)
Visual (Visual Basic)
1 Procedural

This is focusing on grouping organizations and/or code by similar operations or by the operations that can be done on them.

2 Functional

Functional programming is so called because a program consists entirely of functions. The program itself is written as a function which receives the program's input as its argument and delivers the program's output as its result. Typically the main function is defined in terms of other functions, which in turn are defined in terms of still more functions, until at the bottom level the functions are language primitives. These functions are much like ordinary mathematical functions.

Functional programs contain no assignment statements, so variables, once given a value, never change. Functions can be described intentionally by a rule describing the association, or extensionally as a set of associated pairs (argument, result) which are called the graph of the function. Functional programming also provides greater abstraction for solution. One such a feature is polymorphism which allows general definition of functions which could be applied to objects of any type. To achieve such a behavior we use type variables which stand for any type. Further higher order functions provide facility to treat functions as a data objects and use them like other data objects. It means that function (higher order function) can manipulate and create other functions. Another important feature of the functional programming is that evaluation of arguments could be delayed but done at most once. This technique is called lazy evaluation. Postponing sometimes can lead to such a situation that postponed value could be found as not necessary to evaluate, even when argument is undefined. If such a function can return a defined result we call it non-strict, else if returns undefined is called strict.

3 Logic

The basic constructs of logic programming, terms and statements are inherited from logic. There are three basic statements: facts, rules and queries. There is a single data structure: the logical term.

In a logic programming language the logical relationship between various entities are declared. The programmer writes a database of facts and rules. The user supplies a queries (goals) which the system tries to prove. This involves matching the current goal against each fact or the left hand side of each rule using unification. If the goal matches a fact, the goal succeeds; if it matches a rule then the process recurses, taking each sub-goal on the right hand side of the rule as the current goal. If all sub-goals succeed then the rule succeeds.

Logic programming languages tend to be declarative programming languages, as opposed to the more traditional imperative programming languages. In a declarative language, you concentrate on the relationships between the parts of the problem, rather than on the exact sequence of steps required to solve the problem. An example of a well-known declarative languages are SQL, Prolog.
A good beginning makes a good ending

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:
Verification:
Please leave this box empty:

Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

shortcuts: alt+s submit/post or alt+p preview
IT Acumens Web Designing Chennai | GinGly :: Build your Personal Website | CineBuzz :: Cinema News | My Kids Diary :: Kids Memories Writing :: Book Website @ 349 Rs monthly
Copyright 2005 - 2020 :: IT Acumens :: All Rights Reserved. :: Sitemap
ITAcumens Discussion Forum with 2 lakhs post running for 15 years - Powered by IT Acumens Dedicated Server